Skip to main content
The reference architecture: detect and rehydrate services on EC2 Graviton in your private subnets, each behind an Amazon VPC Lattice service with a per-route IAM auth policy, an Aurora PostgreSQL vault, a customer-managed KMS key, an Object Lock audit bucket, and VPC endpoints for every AWS API — no NAT, no internet route, no Tenet principal anywhere.

When to use it

For your security review, your network team, and anyone changing IAM, auth or endpoint policies after deploy. The CloudFormation template, Terraform module and Helm chart all implement this design; the ECS variant is drawn below, with EKS differences after it.

Component diagram

EKS differences: the AWS Gateway API Controller creates the Lattice services from the chart’s HTTPRoutes and IAMAuthPolicies, and the ClusterIP Services are only Lattice backends; DNS is CoreDNS; credentials come from IRSA through the sts endpoint; a NetworkPolicy ipBlock admits only the Lattice ranges in place of the task security groups; logs ship through your cluster’s log agent; vault credentials come from a Kubernetes Secret (typically synced from Secrets Manager); the cluster also needs the ec2, eks, eks-auth and elasticloadbalancing endpoints, plus vpc-lattice and tagging for the controller. Deploy on EKS.

Every network edge

Absent by design: NAT gateways, internet gateway routes, security-group egress to 0.0.0.0/0, public IPs, internet-facing load balancers, IMDS access from tasks, cross-Region calls, any Tenet endpoint, crash reporting. The one opt-in exception is usage telemetry egress (CloudFormation and Terraform only): a NAT gateway and a tcp/443 path from the detect task carrying the counts-only usage records. The opt-in opens tcp/443 from the detect task to any destination through the NAT. Monitoring.

Caller authorization

Rehydration returns plaintext, so a caller clears every layer below, and any one of them stops a request:
  1. Identity, per request. Lattice verifies the SigV4 signature. A same-account caller needs vpc-lattice-svcs:Invoke in its own IAM policy and in the service’s auth policy. Credentials are the role’s short-lived session credentials — there’s no shared secret to leak, rotate or inject.
  2. Auth policy, per route and method. The rehydrate service allows POST /reidentify only to RehydrateInvokerRoleArns, only from AllowedSourceVpcIds, and with the approval tag required, only from a role session tagged tenet-approval-id — checked on every call. Break-glass is allowed the same route without the tag. Detect allows POST /detect, /redact, /deidentify to DetectInvokerRoleArns and DELETE /sessions/* to ErasureInvokerRoleArns. The listeners forward only those exact routes; anything else is a Lattice 404.
  3. Network. Tasks admit 19991 only from the Lattice prefix list (EKS: a NetworkPolicy admitting only lattice.peerCidrs). A direct call to a task IP doesn’t connect.
  4. App-side re-check. The runtime refuses, with a fixed 403 {"detail":"forbidden"}, any request whose peer isn’t a Lattice address, that lacks exactly one of each Lattice identity header, that targets another service, whose raw path isn’t canonical, or — for /reidentify and erasure — whose principal isn’t on the role’s own allow-list. Lattice strips client copies of the identity headers.
  5. Route isolation. Detect doesn’t mount /reidentify; rehydrate mounts nothing else.
  6. Audit before plaintext or deletion. Every rehydration writes its record before the response, and every erasure before the delete; if the record can’t be written, the call fails with 503 and nothing is restored or deleted.
Details and the record schemas: Rehydration and audit.

KMS design

Each vault key is a key pair, in two parts:
  1. A lookup key (32 bytes) keys the per-session HMAC-SHA256 dedupe digest — so a recurring value reuses its placeholder — and the audit session_ref. Both services hold it.
  2. An X25519 key pair. Detect seals each value to the public key with HPKE (RFC 9180; AES-256-GCM), bound to its (session, placeholder) slot. Only the private key opens it, and only rehydrate holds the private key.
Detect generates the pair on first start (or in rotate-key), wraps the lookup key and the private key with kms:Encrypt, stores both blobs and the public key in the vault’s metadata table, and keeps only the write-only half in memory. Each wrapped blob carries its own encryption context:
Every key-policy and IAM statement pins kms:EncryptionContext:tenet:purpose and kms:EncryptionContext:tenet:deployment. tenet:key_id and tenet:public_key change with every key, so don’t pin them. Because the public key is in both contexts, someone who can write the vault but can’t call KMS can’t swap in a public key of their own — the lookup key would fail to unwrap and the service refuses to start. An explicit Deny beats every Allow, so no IAM policy attached to the detect role later can lift it, and the role-policy copy holds even on an existing CMK whose policy the templates don’t write. What KMS enforces. A compromised detect task, even with the vault’s database credentials, can’t decrypt any value stored under a key pair. Only the rehydrate role can. What it doesn’t cover:
  • Detect sees the plaintext of every request it’s sent. Key isolation protects what’s stored.
  • With the lookup key and vault read access, detect can test guesses of a low-entropy value against a session’s dedupe digests.
The key policy the templates write names a key admin (no data-plane encrypt or decrypt), the roles above, the Logs service principal scoped to this deployment’s log groups, and the deployer through RDS and Secrets Manager. The account-root statement is opt-in (KeyPolicyIncludeAccountRoot). No Tenet principal appears. With your own key: Bringing your own KMS key.

IAM roles

✔ = granted. ctx = the tenet:deployment pin plus the purposes above. via X = kms:ViaService for service X. Only detect has aws-marketplace:MeterUsage: rehydrate doesn’t check the subscription or meter. It’s on Resource: "*" — it has no resource-level scoping — and AWS accepts it only from the ECS task role or IRSA, not node roles, EKS Pod Identity or long-term keys. Task-role trust policies carry aws:SourceAccount and aws:SourceArn. Separate execution roles keep each service’s secrets to its own tasks.

Vault backend

Aurora PostgreSQL (Serverless v2 in the templates). The vault holds sealed values, keyed digests, TTLs and the wrapped key ring in three tables (tenet_pii_sessions, tenet_pii_mappings, tenet_pii_vault_meta), so it can share a database with other tenants. Both services connect as the same database user unless you provision a separate role per service.

Gotchas

  • Logging hygiene is part of the boundary. E12 is safe because the services log counts and identifiers, never values. If you add a sidecar, proxy or APM agent in front of the services, it must not log request or response bodies.
  • Caller ARNs are workforce identifiers. Audit records and Lattice access logs name the caller’s role session, and an SSO session name is often an email address. Prefer sts:SourceIdentity for human callers.
  • Opening SSM, telemetry egress, or another VPC or account to the service network changes the boundary. All are off by default; turn them on deliberately and record it in your risk assessment.
  • Adding a NAT later breaks the zero-egress claim even though the services never use it.

Check a running deployment still matches this architecture — read-only drift audit.

Open in Cursor