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, servicevpc-lattice-svcs) as its own IAM role. There’s no shared secret to leak, rotate or inject. Any one layer stops a request.
- Identity, per request. Lattice verifies the signature. A same-account caller needs
vpc-lattice-svcs:Invokein its own IAM policy (theRehydrateCallerPolicy/rehydrate_caller_policyoutput) and in the service’s auth policy — either alone is denied. - Auth policy, per route and method. The rehydrate service allows
POST /reidentifyonly toRehydrateInvokerRoleArns(rehydrate_invoker_role_arns,lattice.rehydrateInvokerRoleArns) plus the break-glass role, only fromAllowedSourceVpcIds, and — with the approval tag required — only from a role session taggedtenet-approval-id. The tag is checked on every call. The listener forwards only that exact route; anything else is a Lattice404. - Network. Tasks and pods admit port 19991 only from the
com.amazonaws.<region>.vpc-latticeprefix list (security groups on ECS, a NetworkPolicyipBlockon EKS). A direct call to a task IP doesn’t connect. - 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 atWARNING:refused POST on route reidentify: <principal> is not allowed to call reidentify. - Route isolation. The detect service doesn’t mount
/reidentifyat all; the rehydrate service mounts nothing else. - 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.
- Audit before plaintext. The record is written synchronously after authorization and before the response. Write fails →
503 {"detail": "reidentify audit failed; nothing was restored"}.
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
WithRequireRehydrateApprovalTag=true (require_rehydrate_approval_tag, lattice.requireApprovalTag):
- On approval, your workflow assumes the invoker role with
sts:TagSession, setting the session tagtenet-approval-id=<ticket>. Make the invoker role’s trust policy requireaws:RequestTag/tenet-approval-id. - 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. - 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 onetenet.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:
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_URIis set and looks likes3://bucket/prefix/—the rehydrate role requires an audit sink: set TENET_AUDIT_S3_URI(orthe detect role …).GetObjectLockConfigurationon the bucket succeeds and shows Object LockEnabled. A bucket without a default retention rule is accepted with aWARNING— objects aren’t retention-locked unless one is set.
Reading the trail
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.
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_refcorrelation 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
403doesn’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’sWARNINGline 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.