- UI logins, including SSO users who belong to several organizations
- Requests made with an API key, including personal API keys
- Requests from your self-hosted agents to the Agent API
This page covers traffic coming into env zero. To let env zero’s outbound traffic reach your VCS or cloud resources, see IP addresses.
How the allowlist is enforced
A user who belongs to several organizations can’t log in from an IP address that any of those organizations’ allowlists excludes. This applies even if their other organizations have no allowlist.
Requests env zero makes during a deployment aren’t checked, such as OIDC token requests and module downloads from the private registry. SaaS agents aren’t checked either. Deployments on env zero-hosted runners keep working when your organization has an allowlist.
If env zero can’t read your organization’s allowlist, it denies the request.
Changes apply to the next login or request. An API key or self-hosted agent that already connected from an IP address you remove can keep working from that address for up to one hour.
Rule format
The allowlist is theipAllowlist organization policy, a list of rules. A request is allowed if its IP address matches any rule.
Every rule also takes
family, either ipv4 or ipv6. It defaults to ipv4, so set "family": "ipv6" on every IPv6 rule. env zero rejects a rule that is missing a required field or has a field that doesn’t belong to its type.
Set the allowlist
You also need your Organization ID.1
Send the allowlist
Call the Update Policy API with your rules:The request replaces the whole list. Other organization policies you leave out of the request don’t change.
2
Check the saved list
The Get Organization API returns the current rules, or
null if the organization has no allowlist:Remove the allowlist
Send an empty list. The organization accepts requests from any IP address again.Allowed IPs for one API key
An API key, including a personal API key, can have its own list of allowed IPs. A request made with the key must come from an address on that list. Organization allowlists still apply, so the address must also be on the allowlist of every organization the key has access to. A key with no list of its own is checked against the organization allowlists only. A key’s list uses the same rules as the organization allowlist, up to 50 per key. Use a subnet to cover many addresses with one rule. A key that already connected from an address you remove can keep working from that address for up to one hour.Set a key’s allowed IPs in env zero
1
Open the key list
For an organization API key, go to Organization Settings > API Keys. You need the Edit Organization Settings permission.For a personal API key, go to Personal settings > Personal API Keys. You can change only your own personal API keys.
2
Enter the allowed IPs
When you create a key, enter its addresses in Allowed IPs. To change an existing key, click the edit button next to it.Each entry is one of:
- An address, for example
192.0.2.17 - A subnet, for example
198.51.100.0/28 - A range, for example
198.51.100.40-198.51.100.60
3
Save
Create the key, or click Save in the edit dialog.
Set a key’s allowed IPs with the API
Each request replaces the key’s whole list. An empty list removes the key’s restriction. For an organization API key, call Update an API Key IP allowlist. Get the key’sid from List Organization API Keys. It looks like auth0|..., so encode the | as %7C in the URL:
id from List personal API keys. Only the key’s owner can change it, so authenticate with one of your own personal API keys:
ipAllowlist.
Next steps
- Review the other security controls env zero provides
- Run deployments from inside your own network with a self-hosted agent