IP Access Control
Restrict login access to specific IP addresses or CIDR ranges. Useful for corporate environments where users should only log in from office networks or VPNs.
How It Works
IP access control operates in one of two modes, configured per-tenant:
Allowlist Mode
Only IPs in the list can log in. All others are denied. Use this when you know exactly which networks your users should connect from (office, VPN, CI servers).
Blocklist Mode
All IPs can log in except those in the list. Use this to block known-bad actors, abusive ranges, or geographic regions you don't operate in.
Early rejection: The IP check happens before credential verification. A blocked IP receives a 403 Forbidden immediately without the system checking whether the account exists or the password is correct. This prevents IP-blocked clients from performing user enumeration.
Enabling IP Access Control
Enable IP access control by updating your tenant settings. The example below enables allowlist mode with a mix of individual IPs and CIDR ranges — only these addresses will be permitted to log in.
/api/v1/settings🔒 AuthEnable IP access control in allowlist mode with permitted addresses.
{
"ip_access": {
"enabled": true,
"mode": "allowlist",
"addresses": [
"203.0.113.42",
"203.0.113.100",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.1.0/24"
]
}
}CIDR Range Examples
CIDR notation lets you specify entire network blocks instead of individual IPs. Here's a quick reference for common patterns:
| CIDR | Range | Notes |
|---|---|---|
| 10.0.0.0/8 | All 10.x.x.x addresses | Private — large corporate networks |
| 172.16.0.0/12 | 172.16.x.x – 172.31.x.x | Private — medium networks |
| 192.168.0.0/16 | All 192.168.x.x addresses | Private — home/small office |
| 203.0.113.0/24 | 203.0.113.0 – 203.0.113.255 | Specific /24 block (256 IPs) |
| 203.0.113.42/32 | 203.0.113.42 only | Single IP (equivalent to bare IP) |
Switching to Blocklist Mode
If you want to allow all IPs except specific known-bad actors, switch to blocklist mode. Any IP in the list will be denied; all others are permitted.
/api/v1/settings🔒 AuthSwitch to blocklist mode with known malicious IPs.
{
"ip_access": {
"enabled": true,
"mode": "blocklist",
"addresses": [
"185.220.101.0/24",
"23.129.64.0/24",
"198.51.100.50"
]
}
}Adding & Removing IPs
Updates to the address list are replace-based, not additive. When you PATCH the addresses array, the entire list is replaced with the new value. To add or remove entries, follow this pattern:
- 1.Read the current settings to get the existing address list
- 2.Modify the array in your application (add new entries or filter out removed ones)
- 3.Write the full updated array back via PATCH
/api/v1/settings🔒 AuthReplace the full address list (read → modify → write pattern).
{
"ip_access": {
"addresses": [
"203.0.113.42",
"203.0.113.100",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.1.0/24",
"198.51.100.0/24"
]
}
}Safety Considerations
Risk of locking yourself out
If you enable allowlist mode and forget to include your own admin IP, you'll lose the ability to log in and change the setting. Plan carefully before enabling.
Built-in safeguard: The API respects the current session. Your active access token continues to work until it expires (default 15 minutes), even if your IP is no longer in the allowlist. This gives you a window to revert the change if you make a mistake. Refresh tokens from a blocked IP will fail, so act before your access token expires.
- •Always include your admin IP or CIDR range before enabling allowlist mode.
- •Keep a break-glass API key (with a fixed, known IP) that can bypass restrictions if needed.
- •Test configuration changes in a staging tenant before applying to production.
Combining with Risk Engine
IP access control and the risk engine are complementary security layers that can run simultaneously:
IP Access Control
A hard gate — binary allow/deny based on source IP. Evaluated first. If the IP is blocked, the request is rejected immediately (no risk scoring, no credential check).
Risk Engine
A scoring system — evaluates behavioral signals (device, location, velocity) to detect anomalies from allowed IPs. Runs after the IP check passes.
A typical layered setup: use allowlist mode to restrict logins to your corporate network, then let the risk engine catch anomalies within that network (compromised devices, credential stuffing from inside the VPN, unusual login times).
Best Practices
Always include admin & CI IPs
Before enabling allowlist mode, ensure your admin IP, CI/CD runner IPs, and monitoring service IPs are in the list. Forgetting these causes outages.
Test in staging first
Create a staging tenant, enable IP access control there, and verify that legitimate users can still log in. Only then apply the same config to production.
Use CIDR ranges for office networks
Don't list individual IPs that may change with DHCP. Use the CIDR range assigned to your office or VPN gateway (e.g., 203.0.113.0/24).
Keep a break-glass API key
Maintain a service-account API key from a known, fixed IP that bypasses IP restrictions. Store it securely (vault, secrets manager) for emergency access if you lock yourself out.
What's Next
Risk Engine Guide →
Layer behavioral risk scoring on top of IP access control for defense-in-depth.
Tenant Settings Guide →
Explore all configurable settings including security, branding, and limits.
Session Management Guide →
Manage active sessions, configure timeouts, and revoke access.
Settings API →
Full API reference for reading and updating tenant settings.