Attestation: measurements, PCRs, reproducible builds, and gating deploys on proof

An attestation is hardware's signed statement about what is running. It only means something if the build is reproducible, and it only earns its keep when a policy refuses to release a key or promote a deploy without it.

Read the briefing
About 4 min to read 6 drills

What to remember

  1. Attestation is worthless unless something is gated on it. A signed document filed in a report changes nothing. A KMS key policy that refuses to unwrap for the wrong measurement changes everything.
  2. Non-reproducible build, meaningless measurement. If the same source does not produce the same hash, nobody — including you — can say what the measurement corresponds to.
  3. Pin the certificate, not just the image hash. Pinning the image hash breaks on every rebuild; pinning the signing certificate allows controlled rebuilds under your key.
  4. Every legitimate rebuild changes the measurement. So rollouts need overlapping allow-lists and a current-measurement inventory, or the deploy is also an outage.
  5. The verifier trusts the vendor root, not you. That is the whole point — a counterparty can check the claim without trusting your infrastructure or your word.

The big picture

Attestation turns "we promise this is what is running" into something a third party can verify. This topic covers what is measured, how policies pin it, why reproducible builds are a prerequisite rather than a nicety, and the operational machinery of rotating measurements without breaking production.

The mental model

Hardware hashes what it loaded and signs the hashes with a key you cannot reach. Everything else is policy: which hashes you are willing to accept, who decides, and what they unlock.

In depth

What gets measured

An attestation document contains measurements — on Nitro Enclaves, PCR values — plus the enclave's public key and optional user data, signed by a certificate chaining to the platform vendor's root. Different PCRs measure different things, which is what lets a policy be as strict as it needs and no stricter: the enclave image itself, the kernel and ramdisk, the application, the certificate used to sign the image, and the identity of the parent instance and its IAM role.

The choice of which to pin is a design decision with operational consequences. Pinning the image hash means any rebuild — including a security patch — requires a policy change. Pinning the signing certificate means "any image signed by our release key", which allows controlled rebuilds while still excluding anything an attacker builds. Most production setups pin the certificate plus the parent role, and keep image-hash pinning for the highest-value keys.

Reproducible builds are the prerequisite

A measurement is a hash of bytes. If your build is not reproducible, the hash changes for reasons nobody can explain and the policy becomes an allow-list of mysteries. Reproducibility means: base images and every dependency pinned by digest, no network fetches at build time that are not content-addressed, no timestamps or build paths baked into the artefact, and a hermetic builder. The test is that a colleague on another machine produces the same hash from the same commit — and that you check this in CI rather than assuming it.

This is also the moment where "we sign our artefacts" becomes real: the signature covers a hash you can re-derive, so a mismatch is a detectable event rather than an unfalsifiable worry.

Gating: making the proof do work

Two gates matter. Key release: a KMS key policy with a condition on the attestation document's measurements, so the data key that decrypts your secrets is released only to an enclave matching the expected PCRs — possession of the ciphertext is then worth nothing to anyone else. Deploy promotion: the pipeline rebuilds, re-measures and compares against the recorded measurement before promoting, so a build whose measurement drifts cannot reach production silently.

Both are policy-as-code and both belong in review. An attestation that produces a dashboard is theatre; one that produces a refusal is a control.

Rotating measurements without an outage

Every legitimate rebuild changes the measurement, so operations needs: an overlapping allow-list during rollout (old and new measurements both permitted), a signed inventory of which measurements are current and why, an expiry so stale entries are removed rather than accumulating, and an emergency revocation path for a measurement you no longer trust. Get this wrong in the strict direction and a routine patch takes signing offline; get it wrong in the loose direction and last quarter's vulnerable image is still allowed to hold your keys.

Myths and facts

Myth: Attestation proves the code is trustworthy.

Fact: It proves which bytes are running. Whether those bytes deserve trust is what review, signing and reproducible builds are for.

Myth: We attest, so we are covered.

Fact: Only if something refuses to proceed on a mismatch. Attestation without enforcement is a log line.

Myth: Pin the image hash — it is the strictest option.

Fact: It is also the most brittle: every patch becomes a policy change. Certificate pinning plus parent identity is the usual production balance.

Myth: Reproducible builds are a nice-to-have.

Fact: Without them the measurement corresponds to nothing re-derivable, and the allow-list becomes unexplainable.

Myth: The verifier has to trust our infrastructure.

Fact: It trusts the platform vendor's root. That is precisely what makes the claim useful to a counterparty.

How pros do it

  • Pin deliberately: signing certificate plus parent identity for most keys, image hash for the highest value.
  • Make builds reproducible and verify reproducibility in CI, not by assertion.
  • Gate key release on attestation in the KMS key policy, and gate promotion on re-measurement in the pipeline.
  • Run overlapping allow-lists during rollout, with expiry and a revocation path.
  • Keep a signed inventory of current measurements, reviewed like any other production configuration.

Questions people ask

Which PCR should I pin?

Usually the image-signing certificate (PCR8) plus a condition on the parent's IAM role. That excludes anything an attacker builds while letting your own signed rebuilds through without a policy change. Pin the image hash (PCR0) only for the highest-value keys, where you accept that every patch becomes a coordinated deploy.

How do I roll out a new enclave version without downtime?

Expand, migrate, contract: add the new measurement to the key policy alongside the old, deploy, verify a live signature, then remove the old. It is the same shape as a schema migration. The caveat is expiry — without it the allow-list quietly accumulates last quarter's images.

Can a third party verify our attestation?

Yes, and that is the point. They validate the signature chain to the vendor's root and compare the measurements with what you published, without trusting your infrastructure or your word. What they cannot check is whether those bytes deserve trust — that is your review and build story, and you should say so.

What if the build is not reproducible today?

Fix that first; nothing else works without it. Pin dependencies and base images by digest, strip timestamps and build paths, and add a CI job that builds the same commit twice and fails on a mismatch. Until then, treat every measurement as an allow-list entry nobody can explain.

How is revocation handled?

Remove the measurement from the allow-list and the key policy — that is the whole mechanism. There is no CRL for measurements, so the allow-list is the revocation list, which is why entries carry an expiry and the inventory is reviewed like production configuration.

Further reading

Drills · 6

Answer in your head, or out loud, before you reveal. Mark each one: "Again" brings it back, "Got it" counts on your desk.

1 Answer out loud

What does an attestation document actually prove? Who signs it, who can check it, and what does it not prove? Four to five sentences.

In short

A strong answer says the hardware signs the measurements and the verifier trusts the vendor root, not you.

What a strong answer does
  • correctness: Signed measurements of image/kernel/application plus the enclave public key, chaining to a vendor root, verified by a relying party who need not trust the operator.
  • purpose: Enables a policy — key release or promotion — to refuse anything that is not the expected build, which is what makes running secrets on someone else's hardware defensible.
  • clarity: Plain, ordered, and honest about what it does not prove.
Why

The tell is the trust direction: the verifier trusts the platform vendor's root, not you. Get that right and the rest follows; get it backwards and the interviewer knows you have read about attestation rather than used it.

The common mistake

Saying attestation proves the code is safe or trustworthy. It proves which bytes are running; review, signing and reproducible builds are what make those bytes trustworthy.

2 Pick the strongest answer

You mentioned every enclave attests at start-up and you log the document to the SIEM. A reviewer says that gives you no security benefit. Are they right?

  1. Largely yes: an attestation that is only logged changes nothing. It becomes a control when a policy refuses on mismatch — a KMS key policy that releases the data key only for expected measurements, or a pipeline that refuses to promote a build whose re-measurement differs. Enforcement is what converts evidence into a control.
  2. No, because attestation is verified by the hardware automatically. Hardware produces the document; verification and policy are yours.
  3. No — logging the document proves the enclave was genuine at start-up, which is the security benefit. It proves it to nobody who acts on it; a compromised deployment logs a valid document for the wrong image.
  4. Yes, and the fix is to log it in two places. Redundant logging is still not enforcement.
In short

Yes, mostly: a logged attestation is not a control until a key policy or a deploy gate refuses on a mismatch.

Why

The question separates people who have deployed attestation from people who have read about it. The two gates worth building are key release (KMS condition on measurements) and promotion (re-measure in CI and compare).

Read the docs

3 Pick the strongest answer

Your enclave image hash comes out different on every CI run, even with no source change. What does that do to your attestation story?

  1. The measurement describes nothing re-derivable, so the attestation policy becomes an allow-list nobody can explain — fix reproducibility (pin dependencies by digest, remove timestamps and build paths, hermetic build) before relying on measurements. Reproducibility is the prerequisite for a measurement to be meaningful.
  2. Pin the certificate instead and the problem disappears. Certificate pinning tolerates rebuilds but you still cannot say what any given build contains.
  3. It is expected; enclave images are never reproducible. They are, with pinned inputs and a hermetic build; teams do this in production.
  4. Add every observed hash to the allow-list automatically. That is an allow-list of everything CI has ever produced — the control is gone.
In short

Fix the build first: the same source must always give the same hash, or the measurement means nothing.

Why

Non-reproducible builds are the most common reason attestation programmes stall: the policy either breaks constantly or gets loosened until it means nothing. Fixing the build is unglamorous and load-bearing.

Read the docs

4 Read the output

What happened here, and what is the immediate fix versus the structural one?

# 02:10 deploy of a new enclave image only — parent role, KMS key and key policy untouched; signing down since 02:12
$ nitro-cli describe-enclaves | jq -r '.[0].Measurements.PCR0'
9f1c2b...a71e   # new build
$ tail -2 /var/log/signer/enclave.log   # the enclave's own KMS Decrypt call (with attestation), relayed over vsock
An error occurred (AccessDeniedException) when calling the Decrypt operation:
The ciphertext refers to a customer master key that does not exist, does not exist in this region, or you are not allowed to access.
$ aws kms get-key-policy --key-id alias/signing --policy-name default --output text | jq -r '..|.["kms:RecipientAttestation:ImageSha384"]?|select(.)'
4b77de...0c93   # previous build
  1. IAM permissions on the parent role are missing. The artifact says only the enclave image changed at 02:10 — the parent role, key and policy did not — and the policy shown pins the previous build's PCR0 while the running enclave reports a new one.
  2. The KMS key was deleted; restore it from backup. That is KMS's generic denial wording for Decrypt; it never says whether the key exists. get-key-policy succeeded, so the key is there — its pinned measurement is what does not match.
  3. The key policy pins one image hash and the deploy changed it, so KMS refuses to release the data key. Immediate: add the new measurement to the policy (or roll back the enclave). Structural: allow overlapping measurements during rollout, or pin the signing certificate plus parent role instead of a single image hash. Classic strict-pinning outage: the deploy and the policy must move together.
  4. The enclave is not genuine and the platform rejected it. It attested fine; your own policy declined it.
In short

The policy pins the old image hash and the deploy changed it; add the new measurement now, then allow overlapping measurements on future rollouts.

Why

Pinning exactly one image hash is the strictest option and turns every rebuild into a coordinated change. Overlapping allow-lists — add new, deploy, verify, remove old — is the expand-migrate-contract pattern applied to attestation.

Read the docs

5 Design round

You said you gate on attestation. Walk me through the whole chain, from a commit to a running enclave that holds keys: the build, signing, what you pin, how deploys are gated, how you rotate measurements, and how a counterparty checks any of it.

  • Keys must be unusable by anyone who obtains the ciphertext, including your own operators.
  • A security patch must be deployable within a day without a scheduled outage.
In short

A strong answer runs the whole chain from commit to key release, and it gates both key release and deploys on the measurement.

A strong answer covers
  • Hermetic, reproducible build with dependencies and base image pinned by digest; CI proves reproducibility by double-build.
  • Artefact signed with a release key held outside CI's own credentials; SBOM produced.
  • KMS key policy conditioned on attestation measurements (certificate plus parent role, image hash for top-tier keys).
  • Pipeline gate: rebuild, re-measure, compare with the recorded measurement; refuse promotion on mismatch.
  • Rotation: overlapping allow-list, signed inventory of current measurements with expiry, documented revocation path.
  • Counterparty verification: published measurements, vendor root chain, and a documented procedure they can run themselves.
  • Failure modes named: strict pin causing outage, loose pin permitting stale images, non-reproducible build, stale allow-list.
What a strong answer does
  • chain completeness: Whole chain from commit to key release, with promotion gating, rotation and third-party verification.
  • operability: Overlapping allow-lists with expiry, inventory as reviewed config, revocation, and a patch path that meets the one-day constraint.
  • honesty: Names what the chain does not cover — a reviewed-but-malicious change, vendor root compromise — and where those are handled.
  • communication: Commit → build → sign → measure → policy → deploy → verify → rotate, with the failure mode at each step.
Why

Strong answers connect reproducibility to policy, gate both key release and promotion, and treat measurement rotation as a normal deployment concern rather than a security afterthought.

The common mistake

Pinning the exact image hash for everything. It is the strictest option and turns every security patch into a coordinated policy change; pin the signing certificate plus parent identity for most keys and reserve image-hash pinning for the top tier.

Read the docs

6 Quick recall

People say attestation is only as good as your build. What has to be true of the build before a PCR value means anything?

In short

The build must be reproducible: the same source must give the same hash.

Accepted

reproducibility · reproducible builds · deterministic build

Why

Reproducibility: the same source and pinned inputs must produce the same bytes, or the measurement corresponds to nothing you can re-derive or explain.

Next lesson Key custody: tiers, HSMs, multi-sig, ceremonies, and losing a key without losing the business
Drill · Attestation
0:00

Loading…