Engineering guide · Security
Network Zones And Trusted Proxies
On this page
Zone ModelAPICreate Policy And Blocklist ZonesTrusted Proxy ResolutionFederation Policy ReferencesPersistence And EvidenceFailure BehaviorVerifyNetwork Zones are a tenant-scoped security primitive shared by authentication and federation policy.
Atlas supports named IP and dynamic zones, organization blocklists, and explicit trusted-proxy boundaries through /api/v1/zones.
This corresponds to the resource family in the Okta Network Zones API, while Atlas additionally makes optimistic versions, actor/request-bound idempotency, trusted-proxy chain resolution, and state-bound append-only evidence part of the service contract.
Zone Model
| Type | Usage | Behavior |
|---|---|---|
|
|
Matches canonical IPv4 or IPv6 CIDRs after exclusions. Other policy engines reference the stable zone ID instead of copying network lists. |
|
|
Matches configured country codes, ASNs, proxy types, and IP-service categories. Non-empty selector groups use AND semantics; values within one group use OR semantics. |
|
|
Denies matching clients before Atlas processes credentials or federation state. A blocklist match dominates policy-zone and routing matches. |
|
|
Authorizes a proxy address to contribute one hop to client-address resolution. Dynamic zones cannot become trusted proxies. |
Every zone has an explicit active or inactive status and priority.
IP zones require at least one includeCidrs entry.
Dynamic zones prohibit CIDRs and require at least one dynamic selector.
At most 500 zones and 128 values per selector are accepted for one tenant.
Zones are deactivated rather than deleted so routing references, decisions, and evidence remain explainable.
The lifecycle action endpoints provide a concise compatibility surface while retaining Atlas version and evidence controls.
Dynamic location and reputation claims are not inferred from a browser request.
Production enforcement accepts them only from an independently authenticated enrichment boundary and sets contextAttested after verification.
The protected evaluate API can use them for simulation, but simulation input does not become authentication evidence.
API
| Method | Route | Purpose | Authorization |
|---|---|---|---|
|
|
List or create zones |
|
|
|
Read or version one zone |
Matching zone capability; fresh AAL2 |
|
|
Verify and return append-only evidence |
|
|
|
Perform a versioned lifecycle transition without resending selectors |
|
|
|
Preview IP or attested dynamic matching |
|
|
|
Preview trusted-proxy chain resolution |
|
The gateway OpenAPI contract and Swagger UI document all operations at /openapi.json and /docs/.
JSON bodies are limited to 64 KiB, must contain exactly one object, reject unknown fields, and require Content-Type: application/json.
Create and update requests require a 16-to-200-character Idempotency-Key.
Atlas stores only a tenant-domain-separated digest.
An exact replay by the same actor returns the original response; a changed request or actor binding returns 409.
Create Policy And Blocklist Zones
curl -sS -X POST "$ATLAS_URL/api/v1/zones" \
-H "Authorization: Bearer $ATLAS_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: network-zone-mission-20260724" \
--data '{
"id": "mission-network",
"name": "Mission network",
"type": "ip",
"usage": "policy",
"status": "active",
"priority": 100,
"includeCidrs": ["10.40.0.0/16"],
"excludeCidrs": ["10.40.66.0/24"],
"expectedVersion": 0,
"reason": "establish named mission network boundary"
}'
A blocklist uses the same shape with "usage": "blocklist".
Atlas checks all active blocklists independently of routing-rule order.
The first integrated enforcement consumers are the primary authentication endpoint, public federation route resolution, federation route-token consumption, and federation routing previews.
Other service ingress paths must opt into the shared resolver before they claim organization-wide network enforcement.
Trusted Proxy Resolution
Atlas never trusts X-Forwarded-For merely because the immediate peer is private, loopback, or link-local.
The immediate peer must match an active trusted_proxy IP zone.
If it does not, forwarding headers are ignored and the transport peer is the client.
For a trusted peer, Atlas parses at most 16 addresses and walks the chain from right to left. Each current hop must itself be trusted before the resolver advances to the preceding address. Resolution stops at the first untrusted hop, so an attacker-controlled left prefix cannot replace the client. A malformed address or oversized trusted chain fails closed. The decision contains the resolved client, trusted hops, and deterministic hash; the raw forwarding chain is never persisted.
Define every load balancer and reverse-proxy tier that may append a hop:
{
"id": "atlas-ingress",
"name": "Atlas ingress proxies",
"type": "ip",
"usage": "trusted_proxy",
"status": "active",
"priority": 10,
"includeCidrs": ["10.90.0.0/16"],
"expectedVersion": 0,
"reason": "authorize the managed ingress tier"
}
Do not include broad internal ranges unless every address in the range is an administered forwarding proxy.
Federation Policy References
Federation routing conditions can use networkZoneIds.
Only active policy zones can be referenced.
Blocklists and trusted-proxy zones remain independent enforcement controls and cannot be converted into selectable routing attributes.
Enabling a rule with an absent, inactive, blocklist, or trusted-proxy reference fails closed.
{
"loginHintDomains": ["mission.example.mil"],
"networkZoneIds": ["mission-network"],
"applicationIds": ["mission-planning"]
}
The routing input hash binds the zone decision hash and matched IDs.
A later organization blocklist match returns deny with network-zone-blocklist before any provider rule can match.
Persistence And Evidence
PostgreSQL owns network_zones, network_zone_events, and network_zone_replays.
Rows are tenant-keyed and versioned.
Replay rows store a key digest, request digest, actor binding, and original response; raw keys and forwarding headers are not stored.
Events bind the complete committed zone state, operator, version, time, reason digest, and prior evidence hash.
Database triggers reject zone deletion, immutable identity changes, skipped versions, a zone version without a matching evidence event, and any update or deletion of event or replay rows. Mutations serialize on a tenant-scoped transaction lock and recheck the replay binding inside the same transaction. Outside a development-like environment, a missing PostgreSQL zone authority makes dependent enforcement unavailable instead of restoring implicit forwarding-header trust.
Failure Behavior
400 indicates invalid input, CIDR, chain, enum, or body shape.
403 indicates missing capability, stale or weak authentication, untrusted dynamic context, or an active organization blocklist.
404 indicates a tenant-local zone is absent.
409 indicates a replay binding, optimistic version, or storage invariant conflict.
413 indicates a request over 64 KiB.
415 indicates a missing or non-JSON content type.
503 indicates authorization, zone persistence, or a dependent enforcement service is unavailable.
Verify
Internal implementation checks are omitted from this public guide.
The integration test applies the real migrations, creates IP, dynamic, blocklist, and trusted-proxy state, proves exact replay, reconstructs the SQL service, verifies restart-stable decisions, checks that raw replay keys and proxy chains did not reach storage, and proves PostgreSQL rejects evidence mutation.
Run it through make icam-workflow-docker-test when the validation host has sufficient memory.