Engineering guide · Security

Trusted Origins And Browser Boundaries

Status: implemented; unit, gateway, middleware, OpenAPI, and bounded PostgreSQL Docker tests passReviewed: 2026-07-26Audience: API developers, application integrators, security engineers, ingress operators
On this pageLifecycle and assuranceCanonical origin rulesAPI mapCreate and activateCORS enforcementPersistence and evidenceFailure behaviorVerify

Atlas exposes the familiar trusted-origin collection at /api/v1/trustedOrigins. The compatibility baseline is the collection, item, and activate/deactivate lifecycle documented by the Okta Trusted Origins API. Atlas accepts the CORS and REDIRECT scope names and adds bounded paths, inactive-first creation, strong ETags, actor-bound idempotency, independent phishing-resistant activation, a signed runtime policy, and append-only evidence.

A trusted origin is an allow-list boundary, not executable routing. It cannot create a redirect, bypass API authorization, grant a browser a token, or replace an OAuth client’s exact registered redirect URI. Application activation requires both:

  1. an exact redirect or logout URI in the authoritative client/application configuration; and

  2. an active tenant REDIRECT scope covering that URI’s canonical origin and path.

Atlas intentionally rejects IFRAME_EMBED. The trusted-origin API therefore cannot weaken frame-ancestors or other clickjacking defenses.

Lifecycle and assurance

State Operation Invariant

INACTIVE

POST /api/v1/trustedOrigins

A fresh AAL2 author creates a non-operative canonical origin.

INACTIVE

PUT /api/v1/trustedOrigins/{trustedOriginId}

A fresh AAL2 author replaces the complete policy using If-Match.

ACTIVE

POST …​/lifecycle/activate

A different, fresh phishing-resistant AAL3 reviewer signs the exact tenant, ID, revision, origin, scopes, and paths with ECDSA P-384.

INACTIVE

POST …​/lifecycle/deactivate

A fresh AAL2 operator performs a risk-reducing emergency withdrawal. New CORS and redirect decisions deny immediately after commit.

RETIRED

DELETE /api/v1/trustedOrigins/{trustedOriginId}

A different phishing-resistant AAL3 actor soft-retires an inactive resource. State and evidence are never deleted.

An active policy is immutable. Changing an origin or path requires deactivation, optimistic replacement, and another independent activation. This prevents an approved signature from remaining attached to different policy.

Canonical origin rules

Production accepts only https origins. Development may additionally accept exact http loopback hosts such as http://127.0.0.1:3000 or http://localhost:3000. Atlas:

  • lowercases schemes and hosts and converts internationalized names to IDNA ASCII;

  • removes only default ports 443 and 80;

  • accepts no path other than the syntactic root slash in the origin value;

  • rejects user information, query strings, fragments, trailing-dot hosts, wildcards, unsafe ports, FTP, and custom schemes;

  • preserves non-default ports and brackets canonical IPv6 literals;

  • limits one canonical origin and one case-insensitive name to one tenant.

The optional paths extension bounds where a scope applies. Omitted CORS paths default to /api/v1/; omitted REDIRECT paths default to /. Prefix matching is segment-aware: /api/v1/mission matches /api/v1/mission/orders but not /api/v1/missionary.

API map

Method Path Minimum assurance Capability

GET, POST

/api/v1/trustedOrigins

Fresh AAL2

security.trusted-origins.read or .manage

GET, PUT

/api/v1/trustedOrigins/{trustedOriginId}

Fresh AAL2

Matching read or manage capability

DELETE

/api/v1/trustedOrigins/{trustedOriginId}

Phishing-resistant AAL3

security.trusted-origins.activate

POST

/api/v1/trustedOrigins/{trustedOriginId}/lifecycle/activate

Phishing-resistant AAL3

security.trusted-origins.activate

POST

/api/v1/trustedOrigins/{trustedOriginId}/lifecycle/deactivate

Fresh AAL2

security.trusted-origins.manage

GET

/api/v1/trustedOriginEvents?originId=…​

Fresh AAL2

security.trusted-origins.read

List accepts q, status, Okta-compatible filter=status eq "ACTIVE", after, and limit up to 200. When more results exist, Atlas returns the next cursor in the RFC 8288 Link header. The OpenAPI contract and Swagger UI expose complete shapes at /openapi.json and /docs/. Mutations require Idempotency-Key and an administrative reason in X-Atlas-Reason or the body. Replacement and transitions require the returned numeric ETag as If-Match.

Create and activate

curl -X POST "$ATLAS/api/v1/trustedOrigins" \
  -H "Authorization: Bearer $AUTHOR_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: mission-console-origin-2026-001" \
  -H "X-Atlas-Reason: establish the reviewed mission console browser boundary" \
  -d '{
    "name": "Mission Console",
    "origin": "https://console.example.mil",
    "scopes": [
      {"type": "CORS", "paths": ["/api/v1/mission"]},
      {"type": "REDIRECT", "paths": ["/oauth/callback", "/logout/callback"]}
    ]
  }'

The response is INACTIVE, version 1. Activation uses a different principal:

curl -X POST "$ATLAS/api/v1/trustedOrigins/$ORIGIN_ID/lifecycle/activate" \
  -H "Authorization: Bearer $INDEPENDENT_AAL3_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: mission-console-origin-activate-2026-001" \
  -H 'If-Match: "1"' \
  -H "X-Atlas-Reason: independently approve the exact browser boundary" \
  -d '{}'

The activation object contains the policy SHA-256 digest, signer identifier, reviewer, time, and ecdsa-p384:<key-id>:<base64url-signature>. Atlas verifies the signature and aggregate evidence chain before every runtime allow decision.

CORS enforcement

The gateway resolves the tenant before authentication by matching the server-side request Host to the tenant’s authoritative primary_domain. It does not accept a browser-supplied tenant header for this decision. Ingress must therefore preserve and validate the public Host before forwarding traffic.

Explicit deployment allowedOrigins remain bootstrap origins, primarily for local administration. They must be exact; * is never honored. Every other origin requires an active signed tenant policy. A disallowed actual request or preflight receives 403. Allowed responses:

  • reflect only the exact accepted origin and set credentials;

  • include Vary: Origin, Access-Control-Request-Method, and Access-Control-Request-Headers;

  • allow only the documented method and header set;

  • cache preflight for at most 600 seconds;

  • include PATCH, DPoP, idempotency, concurrency, and Atlas proof headers.

Bearer authorization, capability checks, tenant isolation, CSRF defenses where applicable, and request-bound DPoP remain mandatory after CORS permits browser delivery.

Persistence and evidence

PostgreSQL owns:

  • trusted_origins, the current tenant-qualified aggregate;

  • trusted_origin_revisions, every immutable state revision;

  • trusted_origin_events, the ordered HMAC evidence chain;

  • trusted_origin_replays, tenant/actor/request-bound replay responses.

A serializable tenant advisory lock makes origin and name uniqueness deterministic across replicas. The state document and SQL columns cross-check tenant, ID, origin, status, and version. Triggers reject deletion, skipped versions, active policy edits, terminal-state changes, and evidence mutation. Administrative reason plaintext and raw idempotency keys are not stored.

Production requires PostgreSQL, the stable Atlas P-384 policy signer, and ATLAS_TRUSTED_ORIGIN_INTEGRITY_KEY_B64 with at least 256 bits. Missing authority or failed verification denies runtime decisions. Development may use process-local state and ephemeral keys, which is not restart-durable.

Failure behavior

400 means malformed origin, unsupported scope, unsafe path, body, or header. 403 means missing capability, weak/stale authentication, non-independent approval, or denied runtime origin. 404 means no resource exists in the caller’s tenant. 409 means stale If-Match, duplicate name/origin, invalid state, or replay-binding mismatch. 503 means persistence, signature, or evidence verification is unavailable.

Verify

Internal implementation checks are omitted from this public guide.

The bounded Docker test applies the real embedded identity migrations, creates two tenants, proves canonical uniqueness and exact replay, independently signs activation, exercises CORS and redirect decisions, reconstructs the SQL service, verifies restart-stable policy, proves cross-tenant denial and immediate deactivation, and confirms PostgreSQL rejects revision and event tampering. The runner first checks available memory and exits with code 75 instead of competing with active container jobs. The focused run passed on 2026-07-26 and wrote a SHA-256-manifested artifact under artifacts/trusted-origin-docker-validation/20260726T051214Z/.