Auth0 Tenant Access Control List (ACL) Use Case Examples
Last Updated:
Overview
Auth0 evaluates incoming requests based on conditional properties, signal matching logic, scopes, and actions to provide granular control over network-level access to an Auth0 tenant. Configure Tenant Access Control List (ACL) rules to block malicious IP addresses, redirect traffic based on country, combine multiple network signals, and restrict access to specific scopes, such as the Management API.
Applies To
- Auth0
- Tenant Access Control List (ACL)
Solution
What are the components of a Tenant ACL rule?
Review the following components to understand how a Tenant ACL rule evaluates incoming requests and triggers actions.
- Conditional Property: The rule evaluates based on a
matchornot_matchcondition. Thematchproperty applies the rule when the specified condition is true for the request. Thenot_matchproperty applies the rule only when the condition does not match. - Scope: Rules apply to requests targeting different scopes, including
management,authentication,tenant, anddynamic_client_registration. - Action: When a condition is met, the rule triggers an action, such as
block,allow,redirect,redirect_uri, orlog.
How does condition matching logic work in a Tenant Access Control List rule?
Understand how the evaluation engine processes multiple values within a single signal array versus multiple distinct signal types within the same rule by reviewing the condition matching logic.
|
Logic Type
|
Behavior
|
Description
|
Example
|
|---|---|---|---|
|
Signal Matching (Single Array)
|
OR |
Within a specific signal array, a request must match at least one entry in the list to satisfy that signal requirement.
|
If
ipv4_cidrs contains ["111.111.111.111/32", "222.222.222.222/32"], matching either IP CIDR satisfies the ipv4_cidrs condition. |
|
Multiple Signals
|
AND |
If a rule contains multiple different signal types (within
match, within not_match, or across both match and not_match), the request must satisfy all provided signal types. |
If a rule includes both
ipv4_cidrs and asns (Autonomous System Numbers), the request must match at least one entry in ipv4_cidrs AND at least one entry in asns. |
|
IPv4 and IPv6 Exception
|
OR |
As an exception to the Multiple Signals
AND rule, if a rule contains both ipv4_cidrs and ipv6_cidrs, the request must match only one of the two IP signal types. |
If a rule defines
ipv4_cidrs, ipv6_cidrs, and asns, the request must match (ipv4_cidrs OR ipv6_cidrs) AND asns. |
|
Combined
match and not_match |
AND |
If a single rule contains both
match and not_match conditional blocks, the request must satisfy every signal condition in match and simultaneously match none of the signal values in not_match. |
If
match specifies geo_country_codes: ["US"] and not_match specifies geo_subdivision_codes: ["US-CA", "US-NY"], the rule triggers only when the country is US and the state is neither US-CA nor US-NY. |
NOTE: The evaluation engine ignores any signal types not provided in a rule, and they do not impact the rule's evaluation logic. In Management API payloads (/api/v2/network-acls), use the exact plural parameter names, such as asns, ipv4_cidrs, ipv6_cidrs, geo_country_codes, and geo_subdivision_codes.
Block Management API Access From Known Malicious IP Addresses
Configure the Tenant ACL to block up to 10 IP addresses with a single rule by applying a JavaScript Object Notation (JSON) payload that matches the target IP addresses and triggers a block action on the management scope.
{
"description": "Block Management API Access from Known Malicious IPs",
"active": true,
"priority": 1,
"rule": {
"match": {
"ipv4_cidrs": [
"111.111.111.111/32",
"222.222.222.222/32"
]
},
"scope": "management",
"action": {
"block": true
}
}
}
Configure the Tenant ACL to allow specific IP addresses and block all others by applying a JSON payload containing multiple rules that allow known IP addresses and use a final rule with a not_match condition to block the rest.
[
{
"description": "Allow known IP addresses",
"active": true,
"priority": 1,
"rule": {
"match": {
"ipv4_cidrs": [
"111.111.111.111/32",
"111.111.111.222/32"
]
},
"scope": "management",
"action": {
"allow": true
}
}
},
{
"description": "Allow known IP addresses",
"active": true,
"priority": 2,
"rule": {
"match": {
"ipv4_cidrs": [
"111.111.222.111/32",
"111.111.222.222/32"
]
},
"scope": "management",
"action": {
"allow": true
}
}
},
...,
{
"description": "Allow known IP addresses and block any others",
"active": true,
"priority": 10,
"rule": {
"not_match": {
"ipv4_cidrs": [
"111.111.000.111/32",
"111.111.000.222/32"
]
},
"scope": "management",
"action": {
"block": true
}
}
}
]
NOTE: The final rule in the multiple-rule configuration uses the block action and the not_match condition.
How does Auth0 evaluate AND logic across multiple signal arrays in a match condition?
Block authentication traffic when the request matches at least one listed IPv4 CIDR range and originates from at least one listed ASN by applying the following JSON payload.
{
"description": "Block authentication traffic matching CIDR ranges AND ASNs",
"active": true,
"priority": 3,
"rule": {
"action": {
"block": true
},
"match": {
"ipv4_cidrs": [
"198.51.100.0/24",
"203.0.113.0/24"
],
"asns": [
64496,
64497
]
},
"scope": "authentication"
}
}
Evaluation:(ipv4_cidrs matches 198.51.100.0/24 OR 203.0.113.0/24) AND (asns matches 64496 OR 64497). Both signal arrays must evaluate to true for the block action to execute.
How does Auth0 evaluate AND logic combining match and not_match conditions in the same rule?
Block authentication traffic originating from the United States except when the request comes from California or New York by applying the following JSON payload.
{
"description": "Block US authentication traffic except California and New York",
"active": true,
"priority": 4,
"rule": {
"action": {
"block": true
},
"match": {
"geo_country_codes": [
"US"
]
},
"not_match": {
"geo_subdivision_codes": [
"US-CA",
"US-NY"
]
},
"scope": "authentication"
}
}
Evaluation:(geo_country_codes matches US) AND NOT (geo_subdivision_codes matches US-CA OR US-NY). Requests from US-TX satisfy both match and not_match and are blocked, whereas requests from US-CA fail the not_match check and bypass the rule.
How is traffic redirected based on country location?
Redirect users from a specific country to a designated policy page by applying a JSON payload that matches the geographic country code and triggers a redirect action to the specified Uniform Resource Locator (URL).
{
"description": "Redirect German users to policy page",
"active": true,
"priority": 20,
"rule": {
"action": {
"redirect": true,
"redirect_uri": "https://example.com/restrictions"
},
"match": {
"geo_country_codes": ["DE"]
},
"scope": "tenant"
}
}
Configure Rules Based on Specific Scopes
Apply the following JSON snippets to configure rules that target specific scopes, such as allowing VPN access, permitting regional authentication, or redirecting regional traffic. Allow Canadian VPN access to the Management API by applying this configuration.
{
"description": "Allow Canadian VPN access to management API",
"active": true,
"priority": 10,
"rule": {
"action": { "allow": true },
"match": {
"ipv6_cidrs": ["2002:7bcd:/32"]
},
"scope": "management"
}
}
Allow traffic from a specific country to access the Authentication scope by applying a JSON payload that matches the geographic country code and triggers an 'allow' action on the authentication scope.
{
"description": "Allow access to authentication API from France",
"active": true,
"priority": 10,
"rule": {
"action": { "allow": true },
"match": {
"geo_country_codes": ["FR"]
},
"scope": "authentication"
}
}
Redirect United States traffic to a US-based Auth0 tenant by applying a JSON payload that matches the US geographic country code and triggers a redirect action to the US tenant URL on the authentication scope.
{
"description": "Redirect US users to US tenant",
"active": true,
"priority": 5,
"rule": {
"action": {
"redirect": true,
"redirect_uri": "https://us.example-tenant.com/login"
},
"match": {
"geo_country_codes": ["US"]
},
"scope": "authentication"
}
}