Tessera

IDENTITY ENGINE

An identity engine you can watch work.

OIDC and SAML at the edge, SCIM 2.0 provisioning, policy-as-code with OPA/Regorus, and keyless federation into AWS, Azure and GCP — every layer real and running. Below, an identity travels the whole system live.

Identity flow graph (static)
The whole solution moving: an identity flows from the IdP through the edge engine and policy into the control plane and the three clouds. Run the demo to drive a live cascade.

WHAT IT IS

One engine for identity across every IdP and every cloud.

Identity is fragmented: workforce IdPs (Okta, Entra) speak OIDC, SAML and SCIM; each cloud has its own trust model; authorization lives in scattered app code; and lifecycle (joiner / mover / leaver) leaks standing privilege. Tessera is one bespoke engine that unifies all of it — authentication, authorization, provisioning and lifecycle — built to the current security bar end to end.

The edge is a single Rust/WASM Cloudflare Worker. It is an OIDCRelying Party to Okta and Entra and a real OIDC Provider that the clouds trust, a SCIM 2.0 service provider that absorbs both Okta and Entra PATCH dialects, and the Protocol Enforcement Point that evaluates Regorus (Rego v1) policy on every request and fails closed. A native Go control plane runs the lifecycle saga and exchanges short-lived, keyless tokens into AWS, Azure and GCP.

Nothing here is a mockup. Discovery, JWKS, federation, decisions and SCIM are real endpoints (see Usage); every claim on this page is backed by a standard or a cited source.


SYSTEM DESIGN

The whole system, one keyless data path.

From the external IdP through the Rust edge engine and Cloudflare state into the Go control plane and keyless federation across AWS, Azure and GCP — every plane, traced end to end.

External IdP

Okta / Entra

Workforce identity source — brokered, never trusted blindly.

Cloudflare Pages

Astro · R3F

Static-first site; one capability-gated island streams live telemetry into the 3D graph (SVG fallback).

OIDC PKCE · SCIM pushSSE telemetry · trigger demo ⇅

Cloudflare Workers — Edge Identity Engine

Rust → WASM
  • OIDC RPPKCE · iss-param · mix-up defense
  • OIDC IdPdual-alg JWKS — EdDSA + RS256
  • OAuth 2.1DPoP · introspect · revoke
  • SCIM 2.0service provider (Okta + Entra)
  • RegorusRego v1 eval — RBAC-A + ABAC
  • TelemetryQueue producer

binds state ▾

Cloudflare Bindings

  • Durable Objectssessions · aggregator · audit head
  • D1identity graph / relational state
  • KVJWKS / discovery cache
  • R2audit WORM + signed bundles
  • Queuesasync jobs / telemetry fan-in

control plane drives lifecycle & federation ▾

Control Plane

native Go · Actions Cron
  • JML state machinesJoiner / Mover / Leaver saga
  • Access-review campaigns
  • Federation orchestrationSTS · WIF · FIC
  • Policy adminsigns + pushes bundles to R2

RS256 token → keyless trust ▾

Infrastructure as Code

  • Terraformaws-oidc-trust · gcp-wif · azure-fic
  • AWS CDKAccessReview + Reaper stacks

Multi-Cloud Federation

keyless · ephemeral
  • AWS STS
  • GCP Workload Identity
  • Azure FIC

Every cloud credential is minted just-in-time from CI and destroyed after each run; a tag-scoped reaper backstops orphans. No long-lived secrets cross any boundary.


HOW IT WORKS

Five flows, traced step by step.

The same identity, viewed five ways. The live graph below replays these as real telemetry.

OIDC login → session(a) Login: state/nonce/PKCE generated at the edge, iss verified (RFC 9207), ID token validated against the registered key, opaque __Host- session minted in a Durable Object.BrowserEdge WorkerOkta / EntraDurable ObjGET /authorizestate · nonce · PKCE (S256)302 → IdPauthenticate/callback?code&issverify state + issPOST /token (code_verifier)id_tokenvalidate alg/iss/aud/exp/noncecreate opaque sessionSet-Cookie __Host-session
(a) Login: state/nonce/PKCE generated at the edge, iss verified (RFC 9207), ID token validated against the registered key, opaque __Host- session minted in a Durable Object.
Per-cloud federated token mint + exchange(b) Federation: the edge mints a distinct RS256 token per cloud (correct aud each); the Go control plane exchanges each live for real short-lived credentials. Keyless, free, destroyed after.Demo triggerEdge WorkerGo controlAWS·GCP·AZPOST /federatesession + Regorus policymint RS256 × 3 (per-cloud aud)tokens (EdDSA-auth)AssumeRole / token exchangeshort-lived credsfederation results{ aws, gcp, azure }
(b) Federation: the edge mints a distinct RS256 token per cloud (correct aud each); the Go control plane exchanges each live for real short-lived credentials. Keyless, free, destroyed after.
SCIM provisioning from Okta / Entra(c) Provisioning: constant-time bearer verify, tenant isolation (BOLA), dialect normalization and a writable-attribute allow-list before any upsert. active:false never hard-deletes.Okta / EntraEdge (SCIM SP)D1Durable ObjPOST /scim/v2/Usersconstant-time bearer verifytenant isolation (BOLA)dialect normalize · allow-listupsert (userName + externalId)lifecycle state201 CreatedPATCH active:falseset active=false (no delete)
(c) Provisioning: constant-time bearer verify, tenant isolation (BOLA), dialect normalization and a writable-attribute allow-list before any upsert. active:false never hard-deletes.
Authorization decision (PEP → Regorus → bundle)(d) Decision: the edge PEP builds the four-category input and evaluates Regorus in-process against a signed bundle. Any error / undefined / unverified bundle → 403. Decision logged, tokens masked.ClientEdge (PEP)RegorusQueue / logrequest + sessionvalidate opaque tokenbuild {subj,res,act,env}evaluate data.authz.allow{ result, reason }allow=true → continue / else 403decision log (masked)
(d) Decision: the edge PEP builds the four-category input and evaluates Regorus in-process against a signed bundle. Any error / undefined / unverified bundle → 403. Decision logged, tokens masked.
Live telemetry: Queue → DO → SSE → 3D(e) Telemetry: the edge emits events fail-open to a Queue; a Durable Object aggregates with replay; the browser streams over SSE and the R3F graph damps toward each pulse in useFrame — zero React state on the hot path.Edge WorkerDO aggregatorBrowser (SSE)R3F useFrameemit_phase (fail-open)EventRing + monotonic idGET /stream (Last-Event-ID)SSE frame (event/data/id)zustand transient subscribedampC toward target; park
(e) Telemetry: the edge emits events fail-open to a Queue; a Durable Object aggregates with replay; the browser streams over SSE and the R3F graph damps toward each pulse in useFrame — zero React state on the hot path.
LIVEThe telemetry path (e), running. Run the demo to drive flows (a)–(d).
Identity flow graph (static)

WHAT TECHNOLOGY IS USED

The stack, and each part's job.

  • Go

    Native control plane — JML lifecycle, offboarding saga, real cloud SDKs.

  • Rust → WASM

    The edge identity engine, compiled to wasm32 on Cloudflare Workers.

  • Terraform

    Three per-cloud trust modules; state on R2 with the native lockfile.

  • AWS CDK

    The one AWS access-review slice; cdk-nag v3, RemovalPolicy.DESTROY.

  • OPA / Regorus

    Rego v1 policy, opa-tested; evaluated in-process at the edge, fail-closed.

  • Cloudflare Workers

    Edge compute + DO + D1 + KV + R2 + Queues — the whole platform.

  • OIDC / SAML

    RP to Okta + Entra; a real OIDC IdP the clouds trust. SAML brokered.

  • SCIM 2.0

    A service provider that absorbs both Okta and Entra PATCH dialects.

  • OAuth 2.1 · PKCE · DPoP

    The stricter bar: PKCE everywhere, exact redirects, sender-constrained tokens.

  • JWT (JOSE)

    One key, one alg, explicit allow-list; token key-URLs ignored (anti-SSRF).

  • Workload Identity Federation

    Keyless AWS/Azure/GCP — a distinct RS256 token per cloud, exact aud + sub.

  • Astro · R3F

    Static-first site + one live 3D telemetry island over SSE.


HOW TO USE IT

Real endpoints, copy-pasteable.

Secret-gated endpoints check a Bearer token constant-time and fail closed if the secret is unset. Discovery and JWKS are public. The decision PEP is authenticated by an Ed25519-signed policy bundle, not a bearer.

#discovery OIDC discovery

Public, cached 300s. S256 is the only PKCE method advertised; plain is never listed.

Request

bash
curl https://idp.tessera.example/.well-known/openid-configuration

Response

json
{
  "issuer": "https://idp.tessera.example",
  "jwks_uri": "https://idp.tessera.example/jwks",
  "authorization_endpoint": "https://idp.tessera.example/authorize",
  "token_endpoint": "https://idp.tessera.example/token",
  "id_token_signing_alg_values_supported": ["EdDSA", "RS256"],
  "code_challenge_methods_supported": ["S256"],
  "scopes_supported": ["openid", "profile", "email"]
}

#jwks JWKS (dual key ring)

EdDSA for internal tokens, RS256 for cloud federation. Private members never served.

Request

bash
curl https://idp.tessera.example/jwks

Response

json
{
  "keys": [
    { "kty": "OKP", "crv": "Ed25519", "kid": "int-2026-06",   "use": "sig", "x": "<base64url>" },
    { "kty": "RSA", "alg": "RS256",   "kid": "cloud-2026-06", "use": "sig", "n": "<modulus>", "e": "AQAB" }
  ]
}

#authorize Authorize (start an OIDC login)

The Worker generates state, nonce and the PKCE verifier (256-bit CSPRNG) and 302s to the upstream IdP — no caller-supplied params.

Request

bash
curl -i https://idp.tessera.example/authorize

Response

json
HTTP/2 302
location: https://okta.example/oauth2/v1/authorize
  ?response_type=code&client_id=tessera-rp
  &redirect_uri=https://idp.tessera.example/callback
  &scope=openid+profile+email
  &state=<rnd>&nonce=<rnd>
  &code_challenge=<S256>&code_challenge_method=S256

#federate Mint a per-cloud federation token

Bearer-gated (constant-time). cloud ∈ {aws,azure,gcp}; the token is an RS256 JWT with the cloud-specific aud and a fixed 900s TTL.

Request

bash
curl -X POST https://idp.tessera.example/federate \
  -H "authorization: Bearer $FEDERATION_API_TOKEN" \
  -H "content-type: application/json" \
  -d '{"cloud":"aws","sub":"arn:aws:iam::123456789012:role/tessera-worker"}'

Response

json
{ "token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImNsb3VkLTIwMjYtMDYi...<RS256 JWT>" }

#decision Authorization decision (PEP → Regorus)

HTTP is always 200; the allow boolean is authoritative. Absent/unverified bundle → deny (fail-closed). Callers MUST NOT grant unless allow === true.

Request

bash
curl -X POST https://idp.tessera.example/decision \
  -H "content-type: application/json" \
  -d '{
        "subject": {"id":"user-123","roles":["reader"],"tenant":"acme","mfa":true},
        "resource": {"type":"users","tenant":"acme"},
        "action": "read",
        "environment": {"maintenance_window": false}
      }'

Response

json
{ "allow": true, "reason": null }
// denied:            { "allow": false, "reason": "policy denied" }
// bundle unavailable: { "allow": false, "reason": "policy unavailable: no bundle" }

#scim SCIM provisioning (Okta / Entra)

Bearer on every /scim/v2/** request, verified constant-time; the resolved tenant is enforced (BOLA — cross-tenant reads 404, not 403). Content-Type application/scim+json.

Request

bash
curl -X POST https://idp.tessera.example/scim/v2/Users \
  -H "authorization: Bearer $SCIM_BEARER_TOKEN" \
  -H "content-type: application/scim+json" \
  -d '{
        "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
        "userName": "alice@acme.example",
        "active": true,
        "externalId": "okta-00u1abc"
      }'

Response

json
HTTP/2 201
{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
  "id": "2819c223-7f76-453a-919d-413861904646",
  "userName": "alice@acme.example",
  "active": true,
  "externalId": "okta-00u1abc",
  "meta": { "resourceType": "User", "location": "https://idp.tessera.example/scim/v2/Users/2819c223-..." }
}

STANDARDS FOLLOWED

Every standard, what it governs, where it lives.

The authoritative compliance map — RFCs, NIST, ISO, OWASP, SLSA, Rego v1, WCAG. Full per-technology citations are in Standards & technologies.

OAuth & OIDC

StandardGovernsWhere
OAuth 2.0RFC 6749Authorization-code grant, token endpoint, error responsesedge/rp.rs · edge/lib.rs
OAuth 2.1draftPKCE mandatory; no implicit/ROPC; exact redirect matchedge/rp.rs
OAuth Security BCPRFC 9700Current OAuth security bar (PKCE, sender-constraining, rotation)edge/rp.rs · dpop.rs · session_do.rs
PKCERFC 7636S256 code challenge; verifier ≥256 bits; anti-downgradeedge/rp.rs
DPoPRFC 9449Sender-constraining via proof-of-possession; cnf.jktedge/dpop.rs
Issuer IdentificationRFC 9207iss response param; mix-up defense (Okta + Entra)edge/lib.rs /callback
Token RevocationRFC 7009Refresh-token revocation during offboardingcontrol-plane/offboard/saga.go
Token IntrospectionRFC 7662Authenticated callers; inactive → {active:false}edge/introspect.rs
OIDC Core 1.0errata 2ID-token validation §3.1.3.7; nonce; UserInfoedge/rp.rs · lib.rs
OIDC Discovery 1.0/.well-known/openid-configuration; jwks_uriedge/discovery.rs
OIDC Back-Channel Logoutlogout_token; server-initiated session terminationcontrol-plane/offboard/saga.go

JWT / JOSE

StandardGovernsWhere
JSON Web KeyRFC 7517JWK structure; use/alg/kid; JWKS formatedge/jwks.rs
JWK ThumbprintRFC 7638Canonical thumbprint for cnf.jkt DPoP bindingedge/dpop.rs
JWT Best PracticesRFC 8725Reject alg:none; explicit allow-list; ignore jku/x5u/jwkedge/jwt.rs · ssrf.rs
JWT Access TokensRFC 9068typ:at+jwt; local edge validation from cached JWKSedge/jwt.rs · lib.rs

SCIM

StandardGovernsWhere
SCIM DefinitionsRFC 7642Concepts; tenant isolation; provisioning modelcontrol-plane/scim/reconcile.go
SCIM Core SchemaRFC 7643User/Group schema; active, userName, externalIdedge/scim/model.rs
SCIM ProtocolRFC 7644CRUD; PATCH; filter; pagination; scim+jsonedge/scim/*

SAML

StandardGovernsWhere
SAML 2.0OASISSP-initiated SSO; assertion validation; XSW defensebrokered (Access / WorkOS); no in-engine XML-DSig

NIST

StandardGovernsWhere
RBACINCITS 359Roles, permissions, sessions, user-role assignmentpolicy/authz.rego · domain/identity.go
ABACSP 800-162Subject/resource/action/environment; RBAC-A hybridpolicy/authz.rego
Zero TrustSP 800-207PEP/PDP/PA; per-request re-evaluation; least privilegeedge/authz/seam.rs · engine.rs
Security & Privacy ControlsSP 800-53AC / AU / PS families; least privilege; audit; SoDcontrol-plane/audit · sod · offboard

ISO / OWASP / Supply chain

StandardGovernsWhere
ISO/IEC 270012022Clauses 5.15–5.18: access control, identity, authn, reviewRegorus PEP · JML state machine · sessions
OWASP ASVSv5.0V6/V7/V8/V9/V10/V11/V16 — authn, session, authz, tokens, crypto, loggingedge/* · policy/authz.rego
OWASP API Top 102023BOLA, broken-auth, BFLA, mass-assignment, SSRFedge/scim/auth.rs · ssrf.rs
SLSAL2/L3Build provenance attestation; source integrity.github/workflows/release.yml

Policy / Accessibility

StandardGovernsWhere
Rego v1 / OPA 1.0Jan 2025if/contains mandatory; strict check; Regal lint; conftestpolicy/* (CI-gated)
Token ExchangeRFC 8693Standard token-exchange grant used in GCP WIFcontrol-plane/federation/gcp.go
WCAG2.2 AAKeyboard nav; color independence; reduced-motion; contrastsite/ — SVG source of truth; pause control

BEST PRACTICES FOLLOWED

74 cited practices across 16 technologies.

Grouped by area; every claim links to its authoritative source.

OpenID Connect (OIDC)

  • Send code_challenge_method=S256 explicitly — it defaults to `plain` if omitted (OIDC/PKCE §4.3). source
  • Validate the ID token with the registered/expected algorithm, never the token's self-declared `alg` (OIDC §3.1.3.7). source
  • Send and verify both `state` (CSRF) and `nonce` (replay / code-injection) on every flow. source
  • With more than one upstream AS (Okta + Entra) implement the RFC 9207 `iss` response parameter to defend against mix-up. source
  • As an OIDC Provider, publish discovery + jwks_uri over public HTTPS with a CA-signed cert and a byte-identical `issuer` (GCP rejects self-signed). source

OAuth 2.1 · PKCE · DPoP

  • Require PKCE for ALL clients (OAuth 2.1 raises it beyond public clients) and reject `plain`. source
  • Enforce exact redirect-URI matching — no wildcards (localhost port is the only exception). source
  • Prohibit the Implicit grant, ROPC, and `response_type=token` (all removed in OAuth 2.1). source
  • Audience-restrict access tokens and never put bearer tokens in query strings. source
  • Sender-constrain browser tokens with DPoP (cnf.jkt); use mTLS (cnf.x5t#S256) for confidential clients. source
  • Rotate refresh tokens with reuse detection — a replayed refresh token invalidates the whole grant family. source

JSON Web Tokens (JWT)

  • Verify against an explicit algorithm allow-list and reject `alg:none`. source
  • Bind one key to exactly one algorithm to defeat RS256 to HS256 key-confusion. source
  • Require an explicit `typ` (e.g. `at+jwt`) and validate `iss`/`aud`/`exp` so an ID token can't be replayed as an access token. source
  • Ignore token-supplied `jku`/`x5u`/`jwk` — keys come only from the cached, allow-listed JWKS (SSRF defense). source
  • Validate self-contained access tokens locally with cached JWKS; use introspection (RFC 7662) only for opaque / real-time revocation. source

SAML 2.0 (brokered)

  • Do not hand-roll XML-DSig at the edge/WASM — broker SAML to OIDC and keep the Worker out of the XML trust path. source
  • Defend XML Signature Wrapping — verify the signed `<ds:Reference URI>` covers the exact assertion consumed, and reject more than one assertion. source
  • Use one XML parser end-to-end and disable DTDs/XXE to avoid parser-differential revival (CVE-2025-25291/25292). source
  • Validate assertions fail-closed — Conditions, Audience=SP entityID, Recipient=ACS, InResponseTo, one-time IDs; require >=RSA-SHA256. source

SCIM 2.0

  • Normalize `op` case-insensitively and accept `active` as a boolean AND the string "False" (Entra legacy dialect). source
  • Handle `replace` both with and without `path`, and group-member removal as both a value array and `members[value eq "..."]`. source
  • Never hard-delete on `active:false` — keep the resource GET-able (soft delete). source
  • Match by `userName` AND `externalId`; a zero-result filter returns a 200 empty ListResponse, never 404; counts are integers. source
  • Serve `application/scim+json` over TLS 1.2+ with a public CA, and statically compile /Schemas, /ResourceTypes, /ServiceProviderConfig. source

OPA / Rego v1 · Regorus

  • Author all policy in Rego v1 (`if`/`contains` mandatory) and gate CI with `opa fmt --rego-v1` then `opa check --strict` then Regal. source
  • Default `allow := false` and have the PEP fail closed on any error, timeout, or undefined decision. source
  • Evaluate at the edge with Regorus (pure-Rust Rego that compiles to wasm32 and IS the Worker), pinned and gated behind a conformance suite (it is pre-1.0). source
  • Inject time/random/HTTP results as `input`/`data` to keep evaluation deterministic — Regorus does not do network or non-determinism. source
  • Emit decision logs from the Rust host (Regorus has no decision-log plugin), mirroring OPA's event shape with masking before logs leave the Worker. source

RBAC / ABAC (policy-as-code)

  • Use role-centric RBAC-A — the role is the envelope and ABAC may only narrow it; an add-only Mover is a bug. source
  • Model NIST's four input categories — subject (+roles), resource, action, environment. source
  • Encode Separation of Duties as a Rego matrix and evaluate it both preventively (request-time) and detectively (review sweeps). source
  • Keep roles and bindings in `data` and per-request subject/resource/action/environment in `input` (clean PEP/PDP split). source

Zero Trust (NIST SP 800-207)

  • Re-evaluate authorization per request with fresh environment input (tenets source
  • Map the architecture cleanly — PEP = edge Worker (no policy logic), PE = Regorus-evaluated bundle, PA = Go control plane. source
  • Make authorization decisions server-side only, deny-by-default, with immediate effect on entitlement changes (ASVS V8). source
  • Use identity-centric authorization across clouds rather than network location (SP 800-207A). source

Go (control plane)

  • Deprovisioning is a saga, not `active=false` — disable, revoke OAuth grant/refresh, terminate sessions, revoke API keys (all must succeed). source
  • Terminate all sessions on disable/delete via OIDC Back-Channel Logout — a disabled account with live sessions is still active. source
  • On a Mover, recalculate `grant = target - current` and `revoke = current - target`; add-only privilege is a bug (NIST PS-5). source
  • Run native Go (not TinyGo) in scheduled CI so the real AWS/Azure/GCP SDKs and full stdlib are available. source

Rust (edge engine to WASM)

  • Target wasm32-unknown-unknown with pure-Rust crypto only — no ring/aws-lc-rs/openssl (C/asm won't build). source
  • Wire randomness with getrandom feature `wasm_js` AND the `getrandom_backend="wasm_js"` rustflag; run `cargo tree -i getrandom` before deploy. source
  • Use jsonwebtoken with the `rust_crypto` backend (not the C `aws_lc_rs` backend, which won't build for WASM). source
  • Do RSA sign/keygen via WebCrypto SubtleCrypto, not the `rsa` crate (RUSTSEC-2023-0071 Marvin timing attack; rsa verify-only is fine). source
  • Enable `--panic-unwind` and keep the bundle under the free 3 MB limit (`opt-level="z"`, `lto`, `wasm-opt`). source

Terraform

  • Use small composable per-cloud modules (aws-oidc-trust / gcp-wif / azure-fic) over a cross-cloud monolith — the clouds differ too much. source
  • Lock state with the native S3 `use_lockfile` (TF 1.10+); DynamoDB-based locking is deprecated. source
  • Test with `terraform test` + `mock_provider` to assert trust-policy `sub`/`aud` conditions without touching any cloud. source
  • Pin all providers with `~>`, commit `.terraform.lock.hcl`, and pass providers explicitly to modules (aliased configs aren't auto-inherited). source

AWS CDK

  • Use the cdk-nag v3 API `Validations.of(app).addPlugins(new AwsSolutionsChecks())` — not the stale `Aspects.of().add()` pattern. source
  • Pin `env` (env-agnostic stacks can't use `fromLookup`) and set RemovalPolicy.DESTROY / autoDeleteObjects for clean ephemeral teardown. source
  • Keep the ownership boundary — CDK owns the single AWS app slice; Terraform owns the trust plane; neither references the other except as read-only import. source
  • Test with `Template.fromStack` fine-grained assertions plus Jest snapshots. source

Workload Identity Federation (AWS · Azure · GCP)

  • Pin `aud` exact AND `sub` exact (StringEquals, never wildcards) on every cloud — the source
  • Sign federation tokens RS256 (Azure is RS256-only; AWS and GCP also accept it) and issue a distinct token with the correct `aud` per cloud. source
  • On AWS, omit `thumbprint_list` — thumbprints are obsolete since 2024-07 with a public CA; the JWKS endpoint must be publicly reachable (no upload fallback). source
  • On GCP use direct resource access (principalSet://, no service account) with a CEL attribute-condition and `exp - iat <= 24h`. source
  • On Azure use an app registration with a Federated Identity Credential (not UAMI), exact-match iss/sub/aud, and build in a propagation delay + retry (new FICs take minutes). source

Cloudflare Workers

  • Back sessions with a single-writer Durable Object for strong consistency and instant revocation; use KV only as a read-cache. source
  • Write the audit log to R2 with Bucket Locks (WORM-style) plus an app-level hash chain — R2 locks are not S3 Compliance mode. source
  • Respect the platform limits — 3 MB free bundle, 400 ms startup CPU, no OS threads/filesystem; outbound only via `fetch`. source
  • Cache discovery/JWKS in KV + the Cache API with single-flight refresh as a DoS absorber; never fetch JWKS per request. source

CI/CD · SLSA supply chain

  • SHA-pin every third-party action; tags are movable (tj-actions CVE-2025-30066 re-pointed all tags — SHA-pinned users were safe). source
  • Use keyless OIDC to the clouds with zero static keys, pinning the `sub` to a GitHub Environment (`repo:O/R:environment:NAME`). source
  • Attest SLSA provenance with `actions/attest-build-provenance` (L2 keyless on hosted runners) and verify on consume with `--certificate-identity`. source
  • Keep the top-level `GITHUB_TOKEN` read-only and escalate per job; route untrusted PR strings through `env:`, never inline them in `run:`. source
  • Reach SLSA Build L2 by default and L3 via a reusable workflow; verify artifacts before consuming them, never just "is it signed". source

3D frontend · WCAG 2.2 AA

  • Make a semantic SVG/HTML graph the source of truth so it doubles as the a11y equivalent, reduced-motion alternative, and low-end fallback (one artifact, triple duty). source
  • Distinguish node types by icon + text label, never color alone (WCAG 1.4.1); keep contrast >=4.5:1 (1.4.3); provide a visible Pause and keep pulses <=3/s (2.3.1). source
  • Make the poster Image the LCP element (the canvas is not an LCP candidate) and reserve the canvas box with `aspect-ratio` for zero CLS. source
  • Keep content static-first (zero JS); the 3D graph is one capability-gated `client:only` island mounted behind an IntersectionObserver. source
  • Apply R3F discipline — `frameloop="demand"`, drei Instances with shared geometry/material, `dispose={null}`, and never `setState` per frame. source

TECHNOLOGIES

Every technology, with a real example.

All 16 technologies inline — each with the standards it follows, the cited best practices, and a real code sample. Expand any tile.

OpenID Connect (OIDC)

The engine is an OIDC Relying Party to Okta and Entra, and a real OIDC Provider that the clouds trust.

OpenID Connect layers identity on top of OAuth 2.0. The Tessera edge engine plays both OIDC roles. As a Relying Party it consumes Okta and Entra using the Authorization Code flow with PKCE: it generates a fresh code_verifier, sends the S256 challenge explicitly, and on the callback verifies state, exchanges the code, and validates the ID token against the provider’s registered signing key — checking iss, aud, exp, and the nonce it issued.

Because the engine consumes two authorization servers at once, it is the textbook mix-up scenario, so it implements the RFC 9207 iss response parameter: it confirms the response came from the AS it actually redirected the user to before trusting any token.

As an OIDC Provider, the engine publishes /.well-known/openid-configuration and a jwks_uri over public HTTPS with a CA-signed certificate and a byte-identical issuer value, so AWS, Azure and GCP can establish trust against it (see Workload Identity Federation).

Code

rust
// Edge RP: Authorization Code + PKCE with EXPLICIT S256 (defaults to
// `plain` if omitted — the top RP bug). state + nonce always sent.
use openidconnect::{PkceCodeChallenge, CsrfToken, Nonce, Scope};

let (pkce_challenge, pkce_verifier) = PkceCodeChallenge::new_random_sha256();

let (auth_url, csrf_state, nonce) = client
    .authorize_url(CsrfToken::new_random, Nonce::new_random)
    .add_scope(Scope::new("openid".into()))
    .add_scope(Scope::new("email".into()))
    .set_pkce_challenge(pkce_challenge) // method = S256, explicit
    .url();

// On callback: verify `iss` (RFC 9207) matches the AS we redirected to,
// verify `state` == csrf_state, exchange code with pkce_verifier, then
// validate the ID token: iss exact, aud contains client_id, signature
// against the REGISTERED alg (never the token's self-declared `alg`),
// exp in the future, and nonce == the nonce we sent.

Standards it follows

Authorization Server Issuer IdentificationRFC 9207
https://www.rfc-editor.org/rfc/rfc9207

Best practices applied

  • Send code_challenge_method=S256 explicitly — it defaults to `plain` if omitted (OIDC/PKCE §4.3). source
  • Validate the ID token with the registered/expected algorithm, never the token's self-declared `alg` (OIDC §3.1.3.7). source
  • Send and verify both `state` (CSRF) and `nonce` (replay / code-injection) on every flow. source
  • With more than one upstream AS (Okta + Entra) implement the RFC 9207 `iss` response parameter to defend against mix-up. source
  • As an OIDC Provider, publish discovery + jwks_uri over public HTTPS with a CA-signed cert and a byte-identical `issuer` (GCP rejects self-signed). source

OAuth 2.1 · PKCE · DPoP

Built to the stricter OAuth 2.1 bar — PKCE everywhere, exact redirect matching, and DPoP sender-constrained browser tokens.

OAuth 2.1 consolidates a decade of security hard-won lessons (RFC 9700 / BCP 240) into one stricter baseline. Tessera builds to the OAuth 2.1 bar, which is forward-compatible with the published BCP: PKCE on every client, exact redirect-URI matching, no Implicit/ROPC/response_type=token, single-use authorization codes under ten minutes, and audience-restricted access tokens.

For browser and SPA clients the edge is the natural enforcement point for DPoP (RFC 9449) — a per-request signed proof that binds the token to the client’s key (cnf.jkt). Confidential clients are bound with mTLS (cnf.x5t#S256, RFC 8705) instead. Refresh tokens are rotated with reuse detection, so a stolen-and-replayed refresh token revokes the entire grant.

Code

rust
// DPoP proof verification at the edge (the natural enforcement point for
// browser/SPA clients). The proof is a signed JWT: typ=dpop+jwt, embedded
// jwk, with htm/htu/jti/iat (+ ath when an access token is presented).
fn verify_dpop(proof: &DpopProof, method: &str, url: &str, cnf_jkt: &str) -> bool {
    proof.typ == "dpop+jwt"
        && proof.htm.eq_ignore_ascii_case(method)
        && proof.htu == url
        && proof.iat_within_skew()
        && proof.jti_unused()                 // single-use
        && proof.thumbprint() == cnf_jkt      // bind to the access token's cnf.jkt
        && proof.verify_signature()           // against the embedded jwk
}

Standards it follows

OAuth 2.0 Authorization FrameworkRFC 6749
https://www.rfc-editor.org/rfc/rfc6749
OAuth 2.1 (draft)
https://oauth.net/2.1/
OAuth 2.0 Security Best Current PracticeRFC 9700/BCP 240
https://www.rfc-editor.org/rfc/rfc9700.html
Demonstrating Proof of Possession (DPoP)RFC 9449
https://www.rfc-editor.org/rfc/rfc9449
OAuth 2.0 Mutual-TLS Client AuthenticationRFC 8705
https://www.rfc-editor.org/rfc/rfc8705

Best practices applied

  • Require PKCE for ALL clients (OAuth 2.1 raises it beyond public clients) and reject `plain`. source
  • Enforce exact redirect-URI matching — no wildcards (localhost port is the only exception). source
  • Prohibit the Implicit grant, ROPC, and `response_type=token` (all removed in OAuth 2.1). source
  • Audience-restrict access tokens and never put bearer tokens in query strings. source
  • Sender-constrain browser tokens with DPoP (cnf.jkt); use mTLS (cnf.x5t#S256) for confidential clients. source
  • Rotate refresh tokens with reuse detection — a replayed refresh token invalidates the whole grant family. source

JSON Web Tokens (JWT)

One key, one algorithm, an explicit allow-list, and token key-URLs ignored — defeating alg-confusion and SSRF.

A JWT is only as safe as its verifier. Tessera follows the JWT BCP (RFC 8725) literally: an explicit algorithm allow-list, alg:none rejected, and one key bound to one algorithm so an attacker cannot downgrade an RS256 public key into an HS256 shared secret. Every token must carry an explicit typ and pass iss/aud/exp checks, which is what stops an ID token being replayed as an access token (RFC 9068).

Keys are never selected by the token: jku, x5u and inline jwk headers are ignored, and verification keys come only from a cached, allow-listed JWKS. The engine validates self-contained access tokens locally at the edge and reaches for introspection (RFC 7662) only when it needs real-time revocation of an opaque token.

Code

rust
// Pin the algorithm allow-list; never trust the token's own `alg`.
// One key bound to one algorithm defeats the RS256 to HS256 confusion attack.
use jsonwebtoken::{decode, Validation, Algorithm, DecodingKey};

let mut v = Validation::new(Algorithm::EdDSA); // internal tokens = EdDSA
v.algorithms = vec![Algorithm::EdDSA];          // explicit allow-list, no `none`
v.required_spec_claims = ["iss", "aud", "exp"].into_iter().map(String::from).collect();
v.set_audience(&[expected_aud]);
v.set_issuer(&[expected_iss]);
// typ must be `at+jwt` for access tokens (RFC 9068); jku/x5u/jwk in the
// token header are IGNORED — keys come only from our cached, allow-listed JWKS.
let data = decode::<Claims>(token, &DecodingKey::from_ed_components(/* ... */), &v)?;

Standards it follows

JSON Web Token Best Current PracticesRFC 8725/BCP 225
https://www.rfc-editor.org/rfc/rfc8725
JSON Web Key (JWK)RFC 7517
https://www.rfc-editor.org/rfc/rfc7517
JWT Profile for OAuth 2.0 Access TokensRFC 9068
https://www.rfc-editor.org/rfc/rfc9068
Token IntrospectionRFC 7662
https://www.rfc-editor.org/rfc/rfc7662

Best practices applied

  • Verify against an explicit algorithm allow-list and reject `alg:none`. source
  • Bind one key to exactly one algorithm to defeat RS256 to HS256 key-confusion. source
  • Require an explicit `typ` (e.g. `at+jwt`) and validate `iss`/`aud`/`exp` so an ID token can't be replayed as an access token. source
  • Ignore token-supplied `jku`/`x5u`/`jwk` — keys come only from the cached, allow-listed JWKS (SSRF defense). source
  • Validate self-contained access tokens locally with cached JWKS; use introspection (RFC 7662) only for opaque / real-time revocation. source

SAML 2.0 (brokered)

Consumed via a hardened broker, never hand-rolled XML-DSig in WASM — defending against XML Signature Wrapping and parser differentials.

SAML 2.0 remains a real enterprise on-ramp, but its XML Signature / canonical- ization machinery is hostile to a WASM edge and is the historical home of XML Signature Wrapping and, more recently, parser-differential CVEs (CVE-2025-25291/25292). Tessera therefore treats SAML as a brokered legacy on-ramp: a hardened broker (Cloudflare Access / WorkOS / Keycloak) terminates SAML and re-issues OIDC, so the edge engine never sits in the XML trust path.

Where SAML is validated, the rules are non-negotiable and fail-closed: one parser end-to-end, DTDs disabled, the signed reference must cover the exact assertion consumed, multiple assertions rejected, and signatures must be at least RSA-SHA256.

Code

yaml
# SAML is brokered to OIDC, NOT hand-rolled in WASM (XML-DSig / c14n is
# unsafe in WASM and prone to XML Signature Wrapping). A broker terminates
# SAML and re-issues OIDC to the edge engine.
broker:
  upstream: okta-saml-app          # SAML SP lives in the broker
  downstream: oidc                 # edge engine only ever sees OIDC
  assertion_rules:
    single_parser: true            # one XML parser end-to-end
    reject_multiple_assertions: true
    disable_dtd: true              # XXE off
    min_signature_alg: RSA-SHA256  # reject SHA-1
    verify_reference_covers_consumed_assertion: true

Best practices applied

  • Do not hand-roll XML-DSig at the edge/WASM — broker SAML to OIDC and keep the Worker out of the XML trust path. source
  • Defend XML Signature Wrapping — verify the signed `<ds:Reference URI>` covers the exact assertion consumed, and reject more than one assertion. source
  • Use one XML parser end-to-end and disable DTDs/XXE to avoid parser-differential revival (CVE-2025-25291/25292). source
  • Validate assertions fail-closed — Conditions, Audience=SP entityID, Recipient=ACS, InResponseTo, one-time IDs; require >=RSA-SHA256. source

SCIM 2.0

A service provider that passes both Okta CRUD and the Microsoft SCIM Validator — absorbing both Entra PATCH dialects.

SCIM 2.0 (RFC 7642/7643/7644) is the provisioning wire protocol, and the only real test of a SCIM service provider is that both Okta and Microsoft Entra drive it cleanly — and they disagree. Entra sends a capitalized op, can encode active as the string "False", and uses a no-path multi-attribute replace; Okta sends a no-path replace with a boolean. The Tessera SCIM endpoint absorbs all of it with one PATCH engine over a canonical attribute tree.

Two rules prevent the classic failures: active:false is a soft delete (the user stays GET-able), and an unknown-user filter returns a 200 empty ListResponse, never a 404 — which is exactly what Entra’s “Test Connection” probe checks. Everything is served as application/scim+json over TLS 1.2+.

Code

rust
// Absorb both IdP dialects: Entra sends capitalized `op` and (legacy)
// `active` as the STRING "False"; Okta sends a no-path replace. One
// PATCH engine handles add/replace/remove over a canonical attribute tree.
fn normalize_op(op: &str) -> Op { op.to_ascii_lowercase().parse().unwrap() }

fn parse_active(v: &serde_json::Value) -> bool {
    match v {
        serde_json::Value::Bool(b) => *b,
        serde_json::Value::String(s) => !s.eq_ignore_ascii_case("false"),
        _ => true,
    }
}
// active=false is a SOFT delete: the user stays GET-able (never hard-delete).
// Unknown user filter to 200 empty ListResponse (never 404); counts are integers.

Standards it follows

SCIM Definitions, Overview, ConceptsRFC 7642
https://www.rfc-editor.org/rfc/rfc7642

Best practices applied

  • Normalize `op` case-insensitively and accept `active` as a boolean AND the string "False" (Entra legacy dialect). source
  • Handle `replace` both with and without `path`, and group-member removal as both a value array and `members[value eq "..."]`. source
  • Never hard-delete on `active:false` — keep the resource GET-able (soft delete). source
  • Match by `userName` AND `externalId`; a zero-result filter returns a 200 empty ListResponse, never 404; counts are integers. source
  • Serve `application/scim+json` over TLS 1.2+ with a public CA, and statically compile /Schemas, /ResourceTypes, /ServiceProviderConfig. source

OPA / Rego v1 · Regorus

Rego v1 policy authored and `opa test`-ed, evaluated at the edge by Microsoft Regorus (pure-Rust Rego), fail-closed.

Policy-as-code in Tessera is authored as OPA Rego v1 (OPA 1.0, Jan 2025, where if and contains are mandatory) and unit-tested with opa test, Regal lint, and conftest over Terraform plan JSON. But at runtime the edge cannot nest OPA-compiled-WASM inside a V8 Worker, so evaluation is done by Regorus — a pure-Rust Rego interpreter (Microsoft) that compiles to wasm32 and becomes the Worker.

The policy is role-centric RBAC-A: a role sets the envelope and ABAC may only narrow it. default allow := false, and the policy-enforcement point (the edge Worker) fails closed on any error, timeout, or undefined result. Because Regorus has no decision-log plugin, the Rust host emits OPA-shaped decision logs with masking applied before anything leaves the edge.

Code

rego
# Rego v1: `if` / `contains` mandatory. Default-deny; role-centric RBAC-A
# where ABAC may only narrow, never expand.
package authz

default allow := false

allow if {
    role_permits
    every constraint in abac_constraints { constraint }
}

role_permits if {
    some role in input.subject.roles
    data.role_permissions[role][input.action][input.resource.type]
}

Standards it follows

Regorus (Rust-native Rego)
https://github.com/microsoft/regorus

Best practices applied

  • Author all policy in Rego v1 (`if`/`contains` mandatory) and gate CI with `opa fmt --rego-v1` then `opa check --strict` then Regal. source
  • Default `allow := false` and have the PEP fail closed on any error, timeout, or undefined decision. source
  • Evaluate at the edge with Regorus (pure-Rust Rego that compiles to wasm32 and IS the Worker), pinned and gated behind a conformance suite (it is pre-1.0). source
  • Inject time/random/HTTP results as `input`/`data` to keep evaluation deterministic — Regorus does not do network or non-determinism. source
  • Emit decision logs from the Rust host (Regorus has no decision-log plugin), mirroring OPA's event shape with masking before logs leave the Worker. source

RBAC / ABAC (policy-as-code)

Role-centric RBAC-A per NIST — the role sets the envelope, attributes only narrow it; SoD evaluated preventively and detectively.

Tessera blends the two NIST access-control models without picking a side. RBAC (INCITS 359) is simple and auditable; ABAC (SP 800-162) is flexible. The bridge the standard itself suggests — “a role may be viewed as a subject attribute” — becomes role-centric RBAC-A: the role sets the permission envelope and attribute rules may only narrow it. An access change recalculates grant = target - current and revoke = current - target; an add-only update would silently accumulate privilege.

Authorization is expressed over NIST’s four input categories — subject (with roles), resource, action, and environment — with roles and bindings living in data and the per-request facts in input. Separation of Duties is a Rego matrix evaluated both at request time (preventive) and during periodic review sweeps (detective).

Code

rego
# NIST four input categories: subject / resource / action / environment.
# ABAC constraints only NARROW the role-granted envelope (add-only would be a bug).
package authz

abac_constraints contains "within_business_hours" if {
    input.environment.time_hour >= 9
    input.environment.time_hour < 18
}

# Separation of Duties as a Rego matrix — evaluated preventively (request
# time) and detectively (review sweeps).
sod_violation if {
    some a, b in input.subject.roles
    data.sod_matrix[a][b]
}

Best practices applied

  • Use role-centric RBAC-A — the role is the envelope and ABAC may only narrow it; an add-only Mover is a bug. source
  • Model NIST's four input categories — subject (+roles), resource, action, environment. source
  • Encode Separation of Duties as a Rego matrix and evaluate it both preventively (request-time) and detectively (review sweeps). source
  • Keep roles and bindings in `data` and per-request subject/resource/action/environment in `input` (clean PEP/PDP split). source

Zero Trust (NIST SP 800-207)

Authorize per request, not per session — the edge is the PEP, Regorus is the PE, the Go control plane is the PA.

Zero Trust (NIST SP 800-207) removes implicit trust from the network and makes every request prove itself. The load-bearing tenet for Tessera is continuous verification: the engine re-evaluates authorization per request with a fresh environment (device, time, risk) and never caches an allow decision for the life of a session.

The architecture maps onto the standard’s roles exactly: the edge Worker is the Policy Enforcement Point and carries no policy logic; the Regorus-evaluated bundle is the Policy Engine; and the Go control plane is the Policy Administrator that mints and revokes sessions and signs and pushes policy bundles. Decisions are server-side, deny-by-default, and fail closed.

Code

rust
// Zero Trust tenet #3/#6: re-evaluate authorization PER REQUEST with fresh
// environment input — never cache an allow decision for the session.
async fn handle(req: Request, ctx: Ctx) -> Result<Response> {
    let input = Input {
        subject: ctx.session.subject(),          // who, + roles
        action: req.action(),
        resource: req.resource(),
        environment: ctx.fresh_environment(),     // device, time, risk — fresh each call
    };
    // PEP = this edge Worker (no policy logic). PE = Regorus bundle.
    match ctx.regorus.eval_allow(&input).await {
        Ok(true) => proceed(req).await,
        _ => Response::forbidden(), // fail closed on deny/error/undefined
    }
}

Standards it follows

NIST SP 800-207 (Zero Trust Architecture)
https://csrc.nist.gov/pubs/sp/800/207/final
NIST SP 800-207A (ZT for multi-cloud)
https://csrc.nist.gov/pubs/sp/800/207/a/final

Best practices applied

  • Re-evaluate authorization per request with fresh environment input (tenets source
  • Map the architecture cleanly — PEP = edge Worker (no policy logic), PE = Regorus-evaluated bundle, PA = Go control plane. source
  • Make authorization decisions server-side only, deny-by-default, with immediate effect on entitlement changes (ASVS V8). source
  • Use identity-centric authorization across clouds rather than network location (SP 800-207A). source

Go (control plane)

Native idiomatic Go orchestrator running the JML lifecycle and a multi-step offboarding saga with the real cloud SDKs.

Go is where the control plane lives — native, idiomatic Go with the real AWS, Azure and GCP SDKs, running as scheduled GitHub Actions and locally (not TinyGo on Workers, which can’t load those SDKs). It drives the Joiner-Mover- Leaver lifecycle, risk-tiered access reviews, and federation orchestration.

Its most important correction is the Leaver saga. Setting SCIM active=false only blocks the next login; live sessions and refresh tokens stay valid. So offboarding is a four-step saga that must all go green: disable in SCIM, revoke the OAuth grant and refresh tokens (RFC 7009), terminate sessions via OIDC Back-Channel Logout, and revoke API keys. For-cause offboards run immediately (under five minutes); routine ones run at termination via Cron.

Code

go
// Leaver is a SAGA, not a flag flip: active=false alone leaves live sessions
// and refresh tokens valid. All four steps must go green to be "offboarded".
func Offboard(ctx context.Context, id Identity) error {
    if err := scim.Disable(ctx, id); err != nil { return err }            // 1. SCIM active=false
    if err := oauth.RevokeGrant(ctx, id); err != nil { return err }       // 2. RFC 7009
    if err := oidc.BackChannelLogout(ctx, id); err != nil { return err }  // 3. terminate sessions
    return apikeys.RevokeAll(ctx, id)                                     // 4. revoke API keys
}

Standards it follows

NIST SP 800-53 r5 (AC-2, PS-4, PS-5)
https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final
OAuth 2.0 Token RevocationRFC 7009
https://www.rfc-editor.org/rfc/rfc7009

Best practices applied

  • Deprovisioning is a saga, not `active=false` — disable, revoke OAuth grant/refresh, terminate sessions, revoke API keys (all must succeed). source
  • Terminate all sessions on disable/delete via OIDC Back-Channel Logout — a disabled account with live sessions is still active. source
  • On a Mover, recalculate `grant = target - current` and `revoke = current - target`; add-only privilege is a bug (NIST PS-5). source
  • Run native Go (not TinyGo) in scheduled CI so the real AWS/Azure/GCP SDKs and full stdlib are available. source

Rust (edge engine to WASM)

The identity engine compiled to wasm32 on Cloudflare Workers — pure-Rust crypto, WebCrypto for RSA, randomness wired to crypto.getRandomValues.

The edge identity engine is Rust compiled to wasm32 and run on Cloudflare Workers via the first-class workers-rs. That target has one governing rule: anything that links C or assembly crypto (ring, aws-lc-rs, OpenSSL) will not build, so the whole crate set is pure Rust — jsonwebtoken on the rust_crypto backend, ed25519-dalek for internal signing, pasetors for sessions, and regorus for policy.

Two footguns are designed out: randomness must be explicitly wired to crypto.getRandomValues (the wasm_js getrandom feature and the matching rustflag — the number-one cause of broken builds), and RSA signing/keygen is delegated to WebCrypto SubtleCrypto rather than the rsa crate, which carries the RUSTSEC-2023-0071 Marvin timing advisory.

Code

toml
# wasm32-unknown-unknown: C/asm crypto won't build (no ring/openssl).
# Randomness MUST be wired: feature `wasm_js` AND the rustflag below.
[dependencies]
worker = { version = "0.8", features = ["http", "d1"] }
jsonwebtoken = { version = "10.4", default-features = false, features = ["use_pem", "rust_crypto"] }
ed25519-dalek = { version = "2.2", default-features = false, features = ["rand_core", "pkcs8", "zeroize"] }
regorus = { version = "0.10", default-features = false, features = ["arc", "regex", "semver"] }
getrandom = { version = "0.3", features = ["wasm_js"] }
# .cargo/config.toml => [target.wasm32-unknown-unknown]
#   rustflags = ['--cfg', 'getrandom_backend="wasm_js"']

Standards it follows

workers-rs (Cloudflare Rust on Workers)
https://developers.cloudflare.com/workers/languages/rust/
RustSec Advisory RUSTSEC-2023-0071 (RSA Marvin)
https://rustsec.org/advisories/RUSTSEC-2023-0071.html

Best practices applied

  • Target wasm32-unknown-unknown with pure-Rust crypto only — no ring/aws-lc-rs/openssl (C/asm won't build). source
  • Wire randomness with getrandom feature `wasm_js` AND the `getrandom_backend="wasm_js"` rustflag; run `cargo tree -i getrandom` before deploy. source
  • Use jsonwebtoken with the `rust_crypto` backend (not the C `aws_lc_rs` backend, which won't build for WASM). source
  • Do RSA sign/keygen via WebCrypto SubtleCrypto, not the `rsa` crate (RUSTSEC-2023-0071 Marvin timing attack; rsa verify-only is fine). source
  • Enable `--panic-unwind` and keep the bundle under the free 3 MB limit (`opt-level="z"`, `lto`, `wasm-opt`). source

Terraform

Three thin per-cloud trust modules composed in one root, state on R2 with native lockfile, tested with mock providers.

Terraform owns the multi-cloud identity-trust plane: the OIDC trust that lets AWS, Azure and GCP accept tokens from the edge engine. Following the HashiCorp style guide, that is three thin per-cloud modules — aws-oidc-trust, gcp-wif, azure-fic — composed in a single root, rather than a leaky “universal federation” abstraction, because the three clouds genuinely differ.

State lives on Cloudflare R2 through the s3 backend with the native use_lockfile (DynamoDB locking is deprecated). The trust conditions — exact aud and exact sub, never wildcards — are unit-tested with terraform test and mock_provider, so the confused-deputy guardrails are verified without ever calling a cloud API.

Code

hcl
# State on Cloudflare R2 via the s3 backend, native S3 lockfile (TF >= 1.11).
# DynamoDB locking is DEPRECATED — do not use it.
terraform {
  required_version = ">= 1.11"
  backend "s3" {
    bucket                      = "tessera-tfstate"
    key                         = "federation/terraform.tfstate"
    region                      = "auto"
    use_lockfile                = true
    skip_credentials_validation = true
    skip_metadata_api_check     = true
    skip_region_validation      = true
    skip_requesting_account_id  = true
    skip_s3_checksum            = true
    use_path_style              = true
  }
}

Best practices applied

  • Use small composable per-cloud modules (aws-oidc-trust / gcp-wif / azure-fic) over a cross-cloud monolith — the clouds differ too much. source
  • Lock state with the native S3 `use_lockfile` (TF 1.10+); DynamoDB-based locking is deprecated. source
  • Test with `terraform test` + `mock_provider` to assert trust-policy `sub`/`aud` conditions without touching any cloud. source
  • Pin all providers with `~>`, commit `.terraform.lock.hcl`, and pass providers explicitly to modules (aliased configs aren't auto-inherited). source

AWS CDK

A TypeScript app provisioning the one AWS access-review slice — cdk-nag v3 enforced, RemovalPolicy.DESTROY for clean teardown.

AWS CDK provisions exactly one AWS slice — the access-review pipeline (EventBridge to Step Functions to DynamoDB) — shown alongside Terraform to demonstrate both IaC styles. The ownership boundary is strict: CDK owns this in-account app slice; Terraform owns the multi-cloud trust plane, and neither tool’s state references a resource the other created except as a read-only import.

The build enforces cdk-nag v3, whose API changed from the pattern most tutorials still show: it is Validations.of(app).addPlugins(new AwsSolutionsChecks()), with suppressions acknowledged with a written reason. env is pinned so fromLookup works, and every stateful resource is RemovalPolicy.DESTROY so the ephemeral demo tears down to zero.

Code

typescript
// cdk-nag v3 API (most tutorials are stale): Validations.of().addPlugins(),
// NOT Aspects.of().add(). Suppress with reasons via .acknowledge().
import { App } from 'aws-cdk-lib';
import { Validations } from 'aws-cdk-lib';
import { AwsSolutionsChecks } from 'cdk-nag';
import { AccessReviewStack } from '../lib/access-review-stack';

const app = new App();
new AccessReviewStack(app, 'AccessReviewStack', {
  env: { account: process.env.CDK_ACCOUNT, region: 'us-east-1' }, // pinned env
});
Validations.of(app).addPlugins(new AwsSolutionsChecks({ verbose: true }));

Standards it follows

cdk-nag (AwsSolutions rule pack)
https://github.com/cdklabs/cdk-nag

Best practices applied

  • Use the cdk-nag v3 API `Validations.of(app).addPlugins(new AwsSolutionsChecks())` — not the stale `Aspects.of().add()` pattern. source
  • Pin `env` (env-agnostic stacks can't use `fromLookup`) and set RemovalPolicy.DESTROY / autoDeleteObjects for clean ephemeral teardown. source
  • Keep the ownership boundary — CDK owns the single AWS app slice; Terraform owns the trust plane; neither references the other except as read-only import. source
  • Test with `Template.fromStack` fine-grained assertions plus Jest snapshots. source

Workload Identity Federation (AWS · Azure · GCP)

Keyless, free, live federation into all three clouds — a distinct RS256 token per cloud, exact aud + exact sub, no wildcards.

Multi-cloud federation needs trust plus short-lived token exchange, not running cloud compute — which is why Tessera’s live federation into AWS, Azure and GCP is genuinely keyless and free. The edge engine, acting as an OIDC Provider, mints a distinct RS256 token per cloud (the only algorithm all three accept; Azure is RS256-only), each with that cloud’s correct aud.

The single most important rule, learned from real confused-deputy breaches, is applied identically to all three: pin exact aud and exact sub, never a wildcard. Each cloud then adds its own quirk — AWS drops the obsolete thumbprint and requires a publicly reachable JWKS, GCP uses direct resource access with a CEL condition and a 24h token limit, and Azure needs an app-registration FIC plus a propagation delay and retry because new credentials take minutes to take effect.

Code

hcl
# The confused-deputy lesson applied to all three clouds: pin aud EXACT and
# sub EXACT (StringEquals, never StringLike / wildcards).
resource "aws_iam_role" "federated" {
  assume_role_policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Effect    = "Allow"
      Principal = { Federated = aws_iam_openid_connect_provider.edge.arn }
      Action    = "sts:AssumeRoleWithWebIdentity"
      Condition = {
        StringEquals = {
          "${local.issuer_host}:aud" = var.aws_client_id        # exact
          "${local.issuer_host}:sub" = var.expected_subject      # exact, no wildcard
        }
      }
    }]
  })
}

Best practices applied

  • Pin `aud` exact AND `sub` exact (StringEquals, never wildcards) on every cloud — the source
  • Sign federation tokens RS256 (Azure is RS256-only; AWS and GCP also accept it) and issue a distinct token with the correct `aud` per cloud. source
  • On AWS, omit `thumbprint_list` — thumbprints are obsolete since 2024-07 with a public CA; the JWKS endpoint must be publicly reachable (no upload fallback). source
  • On GCP use direct resource access (principalSet://, no service account) with a CEL attribute-condition and `exp - iat <= 24h`. source
  • On Azure use an app registration with a Federated Identity Credential (not UAMI), exact-match iss/sub/aud, and build in a propagation delay + retry (new FICs take minutes). source

Cloudflare Workers

The whole edge platform — Workers, Durable Objects for single-writer sessions, R2 WORM audit, KV as read-cache only.

Cloudflare Workers is the entire edge platform for Tessera, and each concern maps to the primitive that fits its consistency needs. The engine, SCIM endpoint and OIDC Provider run as a Rust/WASM Worker. Sessions are opaque tokens backed by a single-writer Durable Object, so “log out everywhere” and revocation are strongly consistent and instant — KV is only ever a read-cache, never the sole revocation authority because it is eventually consistent.

The audit log is the system of record on R2 with Bucket Locks (WORM-style, though not S3 Compliance mode, so an app-level hash chain is added). Discovery and JWKS documents are cached in KV and the Cache API with single-flight refresh to absorb DoS, and the engine respects the platform’s hard limits: a 3 MB free bundle, a 400 ms startup-CPU budget, and outbound calls only through fetch.

Code

rust
// Sessions are OPAQUE tokens backed by a single-writer Durable Object, so
// "log out everywhere" / revocation is instant. KV is a read-cache only —
// never the sole revocation authority (it is eventually consistent).
#[durable_object]
pub struct SessionStore { state: State }

impl SessionStore {
    pub async fn revoke_all(&self, subject: &str) -> Result<()> {
        // strong consistency: subsequent reads see the revocation immediately
        self.state.storage().delete_all().await
    }
}

Best practices applied

  • Back sessions with a single-writer Durable Object for strong consistency and instant revocation; use KV only as a read-cache. source
  • Write the audit log to R2 with Bucket Locks (WORM-style) plus an app-level hash chain — R2 locks are not S3 Compliance mode. source
  • Respect the platform limits — 3 MB free bundle, 400 ms startup CPU, no OS threads/filesystem; outbound only via `fetch`. source
  • Cache discovery/JWKS in KV + the Cache API with single-flight refresh as a DoS absorber; never fetch JWKS per request. source

CI/CD · SLSA supply chain

Hardened GitHub Actions — SHA-pinned, keyless OIDC to the clouds, SLSA provenance attested and verified on consume.

Every deploy in Tessera runs through hardened GitHub Actions. The two load-bearing controls are SHA-pinning and keyless OIDC. Tags are mutable — the tj-actions/changed-files incident (CVE-2025-30066) silently re-pointed every tag, and only SHA-pinned consumers were safe — so every third-party action is pinned to a commit SHA with Dependabot keeping it fresh.

Cloud access is keyless: jobs request short-lived credentials via OIDC with zero static keys, and the trust is pinned to a GitHub Environment subject. Build artifacts (the WASM engine, the CDK assets) get SLSA provenance via actions/attest-build-provenance (Build L2 by default on hosted runners), and consumers verify that provenance with --certificate-identity rather than trusting that something is merely signed.

Code

yaml
# SHA-pin every third-party action (tags are movable — the tj-actions
# CVE-2025-30066 re-pointed all tags; SHA-pinned users were safe).
# Top-level read-only token; escalate per job. Keyless OIDC pinned to env.
permissions:
  contents: read
jobs:
  deploy:
    environment: production           # pin OIDC subject to the environment
    permissions:
      contents: read
      id-token: write                 # keyless OIDC, zero static cloud keys
      attestations: write             # SLSA provenance
    steps:
      - uses: step-security/harden-runner@<pinned-sha>   # audit -> block egress
      - uses: actions/checkout@<pinned-sha>

Best practices applied

  • SHA-pin every third-party action; tags are movable (tj-actions CVE-2025-30066 re-pointed all tags — SHA-pinned users were safe). source
  • Use keyless OIDC to the clouds with zero static keys, pinning the `sub` to a GitHub Environment (`repo:O/R:environment:NAME`). source
  • Attest SLSA provenance with `actions/attest-build-provenance` (L2 keyless on hosted runners) and verify on consume with `--certificate-identity`. source
  • Keep the top-level `GITHUB_TOKEN` read-only and escalate per job; route untrusted PR strings through `env:`, never inline them in `run:`. source
  • Reach SLSA Build L2 by default and L3 via a reusable workflow; verify artifacts before consuming them, never just "is it signed". source

3D frontend · WCAG 2.2 AA

A live R3F flow graph that is purposeful, not gimmicky — with a semantic SVG that is the source of truth, the reduced-motion alt, and the low-end fallback all at once.

The site’s signature is a live 3D identity-flow graph, used because it is genuinely informational — you watch a token flow from the IdP through the edge engine and into the clouds — not as decoration. It is one capability-gated client:only Astro island; everything else on the site is static with zero client JS.

Accessibility is designed in, not bolted on. A semantic SVG graph is the source of truth, and the same artifact serves triple duty: the screen-reader- accessible equivalent, the prefers-reduced-motion alternative, and the low-end fallback. Node types are distinguished by icon and label (never color alone), contrast stays >=4.5:1 on the light theme, a visible Pause control exists, and pulses stay under three per second. The poster image — not the canvas — is the LCP element, and the canvas box is reserved with aspect-ratio so layout never shifts.

Code

tsx
// The SVG graph is the source of truth and triple-duties as the a11y
// equivalent, the reduced-motion alternative, and the low-end fallback.
function decideRenderMode(i: CapabilityInputs): RenderMode {
  if (i.reducedMotion || i.saveData) return 'poster';   // static poster = LCP
  if (!i.webgl || i.gpuTier <= 1 || i.cores < 4) return 'svg';
  if (i.gpuTier === 2) return 'webgl-lite';
  return 'webgl-full';
}
// R3F discipline: frameloop="demand", drei Instances, dispose={null},
// never setState per frame — mutate refs / shader uniforms in useFrame.

Standards it follows

WCAG 2.2 (W3C Recommendation)
https://www.w3.org/TR/WCAG22/

Best practices applied

  • Make a semantic SVG/HTML graph the source of truth so it doubles as the a11y equivalent, reduced-motion alternative, and low-end fallback (one artifact, triple duty). source
  • Distinguish node types by icon + text label, never color alone (WCAG 1.4.1); keep contrast >=4.5:1 (1.4.3); provide a visible Pause and keep pulses <=3/s (2.3.1). source
  • Make the poster Image the LCP element (the canvas is not an LCP candidate) and reserve the canvas box with `aspect-ratio` for zero CLS. source
  • Keep content static-first (zero JS); the 3D graph is one capability-gated `client:only` island mounted behind an IntersectionObserver. source
  • Apply R3F discipline — `frameloop="demand"`, drei Instances with shared geometry/material, `dispose={null}`, and never `setState` per frame. source