Protocol and deployment notes · Deployment
Session region replication
On this page
Safety contractConfigurationStartup authority policyOperationsLive AWS two-region qualificationVendor comparison boundaryAtlas can run the session authority active-active across independent regional PostgreSQL stores. Each region serves local reads and writes through the normal session API. A dedicated internal mTLS listener moves sealed lifecycle state; the public API listener never accepts replication traffic.
Safety contract
- PostgreSQL remains the lifecycle authority in each region. Redis remains an encrypted runtime projection, never a cross-region authority.
- The session-row change and local outbox event commit in one transaction.
- The payload is an explicit allow-list. Raw bearer and refresh tokens, token hashes, cookies, raw JTIs, nonces, and the general attributes document do not cross the region boundary.
- Every envelope is bound to its source region, exact target region, tenant, session, generation, creation time, and SHA-256 state commitment. The link requires TLS 1.3 with a verified client certificate.
- Transport is at least once. The receiver's durable receipt makes an identical retry have exactly one state effect and return the original decision ID.
- Revocation is terminal. Active state cannot replace a terminal local state. Equal-generation divergence fails closed by revoking the session and retaining conflict evidence.
- One immutable event has independent per-target delivery state, so delivery to one peer cannot consume the event for another peer.
Configuration
Set all ATLAS_SESSION_REGION_* variables shown in .env.production.example.
Partial configuration fails gateway startup. The primary PostgreSQL DSN must
also set the matching region on every connection, URL-encoded for libpq:
options=-c%20atlas.region_id%3Dregion-a
Mount the HMAC bundle and private keys as owner-only files. The HMAC bundle has one active generation and up to seven verification-only generations:
{
"active": {"keyId": "region-2026-08", "keyB64": "..."},
"verification": [
{"keyId": "region-2026-07", "keyB64": "..."}
]
}
Each peer entry contains only a region ID, HTTPS origin, and exact certificate server name. Atlas does not accept credentials in peer URLs.
Startup authority policy
Central federation/session engines should set:
ATLAS_SESSION_REGION_REQUIRE_AUTHORITY_ON_STARTUP=true
ATLAS_SESSION_REGION_STARTUP_AUTHORITY_TIMEOUT_SECONDS=20
Atlas starts only the dedicated internal replication listener, then challenges all configured peers in parallel. At least one exact peer must complete TLS 1.3 mutual authentication and return a fresh HMAC proof bound to the source region, authority region, random 256-bit nonce, and issue time. A reachable TCP port, an ordinary HTTPS response, a stale proof, a proof from a different region, or a peer without the configured replication key does not admit the node. If the bounded timeout expires, Atlas closes the internal listener and exits before the public API, browser-CAC, native-agent, or metrics listeners start.
ATLAS_SESSION_REGION_REQUIRE_AUTHORITY_ON_STARTUP accepts only true or
false. The optional timeout accepts 1 through 120 seconds and is rejected
unless the gate is true. The standard session-region status API reports whether
startup authority was required, the admitting region, and the non-secret
admission time.
An AIO edge intended to authenticate during WAN loss must leave the gate false. That is an explicit DDIL boundary: the edge uses its local durable identity and session authorities and can queue federation work, but it does not claim that a central cluster authority was live at startup. Central engines and offline edges therefore have distinct, operator-visible startup contracts.
Operations
Authorized operators can read the standard status endpoint:
GET /api/v1/sessions/regions/status
It reports the local region, peer queue depths, last successful delivery, and non-secret error references. It does not expose peer URLs, key material, or session contents.
The retained Docker gate is:
scripts/test/run-session-region-replication-docker-validation.sh
The gate uses two independent PostgreSQL 16 containers, databases, and named volumes, two active session origins, mTLS receivers, a lost-response retry, an actual database-container outage in each direction, standard session API reads and revocation, durable outage queueing, and terminal convergence. It is a live single-host failure-domain rehearsal, not a claim of measured WAN latency or geographic disaster-recovery performance.
Live AWS two-region qualification
The production-shaped qualification uses independent compute and PostgreSQL
authorities in us-east-1 and us-west-2. It deliberately separates the peer
listener on port 17443 from the operator listener on port 17444. Each security
group admits only the opposite authority's exact public /32 on the peer port
and the bounded operator /32 on the control port. Both listeners require TLS
1.3 mTLS; the leaf certificate must carry exactly the configured SPIFFE URI.
No SSH port is opened, west administration is SSM-only, images are pulled by
immutable ECR digest, and all added resources inherit the parent stack's
mandatory self-delete timestamp.
Deploy and verify the infrastructure and persistent runtime:
scripts/deploy/deploy-pf90-cross-region-authority.sh --apply
scripts/deploy/deploy-pf90-cross-region-runtime.sh --apply
Run the live acceptance sequence only in an authorized qualification window:
scripts/test/run-pf90-cross-region-session-validation.sh --apply
The sequence injects post-commit response loss, rewrites both peer security group rules to a non-routable source while preserving their rule IDs, performs concurrent equal-version mutations, restores the original rules, and requires fail-closed terminal convergence. It then stops the west EC2 authority, proves east-local reads and a queued revocation, restarts west, and requires the queue to drain without session resurrection. A trap restores both peer rules on any failure. The final verifier rejects missing receipts, divergent terminal state, an undrained queue, a remaining partition, or retained private-key evidence.
The passing runtime and acceptance receipts are:
artifacts/deployment/aws/20260823T081352Z-pf90-cross-region-runtime/artifacts/pf90-cross-region-session/20260823T081616Z/
This evidence qualifies the stated two-region session-authority behavior. It does not prove independent backup custody, named-vendor interoperability, physical HSM operation, external SOC procedures, or an institution-specific capacity/SLO envelope.
Vendor comparison boundary
PingFederate documents local and remote session-state replica sets with local reads in a multi-region adaptive cluster. Okta Access Gateway documents active-active or active-warm multi-data-center deployment, load-balancer failover, and session affinity until a data center is unavailable. Okta's cited page does not establish cross-data-center session replication, so Atlas does not infer that claim.
- PingFederate multi-region support: https://docs.pingidentity.com/pingfederate/12.2/server_clustering_guide/pf_multi_region_supp.html
- PingFederate cluster startup authority settings: https://docs.pingidentity.com/pingfederate/13.0/administrators_reference_guide/pf_cluster_management.html
- Okta Access Gateway multiple data center architecture: https://help.okta.com/oag/en-us/Content/Topics/access-gateway/ref-arch/many-apps-multi.htm