Skip to main content
Rehydration is the only path that returns stored plaintext. It runs as its own service (TENET_ROLE=rehydrate) behind its own VPC Lattice service, mounts only POST /reidentify, admits only the IAM roles you name, and writes one immutable audit record per call before it answers. If the record can’t be written, the call fails with 503 and restores nothing.

When to use it

Deploy rehydration when a person or system downstream needs the original values back — a reviewer reading a model’s summary with the real names in it. If nothing ever needs the originals, turn it off (rehydration.enabled=false, EnableRehydration=false, enable_rehydration = false): no rehydrate service, role or Lattice service is created, and detection and de-identification work fully. The audit bucket stays, because the detect service audits erasures.

Layers a caller must clear

Every caller signs each request (SigV4, service vpc-lattice-svcs) as its own IAM role. There’s no shared secret to leak, rotate or inject. Any one layer stops a request.
  1. Identity, per request. Lattice verifies the signature. A same-account caller needs vpc-lattice-svcs:Invoke in its own IAM policy (the RehydrateCallerPolicy / rehydrate_caller_policy output) and in the service’s auth policy — either alone is denied.
  2. Auth policy, per route and method. The rehydrate service allows POST /reidentify only to RehydrateInvokerRoleArns (rehydrate_invoker_role_arns, lattice.rehydrateInvokerRoleArns) plus the break-glass role, only from AllowedSourceVpcIds, and — with the approval tag required — only from a role session tagged tenet-approval-id. The tag is checked on every call. The listener forwards only that exact route; anything else is a Lattice 404.
  3. Network. Tasks and pods admit port 19991 only from the com.amazonaws.<region>.vpc-lattice prefix list (security groups on ECS, a NetworkPolicy ipBlock on EKS). A direct call to a task IP doesn’t connect.
  4. App-side re-check. The service checks every request again and refuses with a fixed 403 {"detail": "forbidden"} if the peer isn’t a Lattice address, the Lattice identity headers aren’t present exactly once, the request targets another Lattice service, the raw path isn’t canonical, or the principal’s role isn’t on its own allow-list (TENET_LATTICE_REIDENTIFY_PRINCIPALS, set from the invoker list). Lattice strips any copy of those headers a client sends. The reason is logged at WARNING: refused POST on route reidentify: <principal> is not allowed to call reidentify.
  5. Route isolation. The detect service doesn’t mount /reidentify at all; the rehydrate service mounts nothing else.
  6. KMS. Only the rehydrate role can unwrap a vault key pair’s private key, so only it can decrypt a stored value. The key policy and the detect role’s own policy deny detect that decrypt. Architecture — KMS design.
  7. Audit before plaintext. The record is written synchronously after authorization and before the response. Write fails → 503 {"detail": "reidentify audit failed; nothing was restored"}.
Allow-list entries are IAM role ARNs (arn:aws:iam::<account-id>:role/[<path>/]<name>). Each matches every session of that role. Users, the root user and wildcards are refused at startup.

Approval workflow

With RequireRehydrateApprovalTag=true (require_rehydrate_approval_tag, lattice.requireApprovalTag):
  1. On approval, your workflow assumes the invoker role with sts:TagSession, setting the session tag tenet-approval-id=<ticket>. Make the invoker role’s trust policy require aws:RequestTag/tenet-approval-id.
  2. It also sets RoleSessionName=<ticket>. Lattice access logs record principal tags only on denied requests, so the session name — part of the caller ARN in every audit record — is what ties a successful rehydration to its approval.
  3. An approval lasts as long as that session: rehydration stops when the tagged session expires.

Erasure

DELETE /sessions/{session_id} on the detect service is its own permission: the detect auth policy allows it only to ErasureInvokerRoleArns (erasure_invoker_role_arns, lattice.erasureInvokerRoleArns), and the service re-checks the same list (TENET_LATTICE_ERASE_PRINCIPALS). An empty list means nobody can erase; sessions just expire. Every erasure that passes auth writes a tenet.erasure-audit.v1 record before anything is deleted. If it can’t, the call returns 503 {"detail": "erase audit failed; nothing was deleted"} and the session survives. Otherwise the response is 204, whether the session existed or not.

The audit records

Rehydrate writes one tenet.reidentify-audit.v3 record per /reidentify call that passes auth — 200, 404 and 400 alike. Detect writes one tenet.erasure-audit.v1 record per erasure. A 403 is never audited: it never reached the handler. Look for refusals in the service log and the Lattice access log.
The schema is an allowlist: exactly these fields, each checked against a narrow pattern. A record with any other field — including a raw session_id — or a malformed value is rejected, which fails the request closed with 503. No value, placeholder or document text ever appears in a record. Where they go. Each service writes the S3 object first, then the same JSON as one line on stdout (→ your log pipeline). The first failure fails the request. Rehydrate writes under AuditPrefix (default rehydrate/), detect under ErasureAuditPrefix (default erasure/) — Helm rehydration.auditS3Uri and lattice.erasureAuditS3Uri. S3 key:
Objects are written with a SHA-256 checksum, as Object Lock requires. Who’s in it. Caller ARNs are workforce identifiers: an SSO role session name is often an email address. Tell your people they’re in the audit trail, and prefer sts:SourceIdentity for human callers.

Joining with the Lattice access log

The templates send both services’ Lattice access logs to /<NamePrefix>/lattice (Helm: lattice.accessLogDestinationArn). They record every request, including refusals, with the caller principal and source VPC. requestId there equals upstream_request_id in the audit record.

Startup checks

Both services refuse to start unless:
  • TENET_AUDIT_S3_URI is set and looks like s3://bucket/prefix/ — the rehydrate role requires an audit sink: set TENET_AUDIT_S3_URI (or the detect role …).
  • GetObjectLockConfiguration on the bucket succeeds and shows Object Lock Enabled. A bucket without a default retention rule is accepted with a WARNING — objects aren’t retention-locked unless one is set.
The rehydrate service also refuses if its allow-list is empty, and if the vault keyring has no key yet: it never creates keys, so start the detect service first.

Reading the trail

For volume, query the bucket with Athena using the year=/month=/day=/hour= partitions, or ingest the stdout lines from CloudWatch Logs into your SIEM.

Verify a deployment's rehydration controls and audit trail end to end — read-only plus a few signed test calls.

Open in Cursor

Gotchas

  • KMS enforces the split. Detect wraps each key pair’s private half but is denied unwrapping it, so a compromised detect task — even with the vault’s database credentials — can’t read a stored value. What it doesn’t cover: detect still sees the plaintext of each request it’s sent, and with the lookup key it can test guesses of a low-entropy value against a session’s dedupe digests.
  • session_ref correlation stops at a key rotation. It’s keyed under the current lookup key, and a new key takes effect at the next rollout. Key rotation.
  • A 403 doesn’t say which layer refused. Lattice’s and the service’s refusals look the same to the caller. The Lattice access log shows auth-policy denials; the service’s WARNING line shows its own.
  • The approval tag can’t be checked by the service. Lattice doesn’t forward session tags to the target, so the auth policy is the only place it’s enforced. Don’t loosen that policy by hand.