fix: build releases on a BuildKit that honours rewrite-timestamp - #1
Merged
Conversation
The docker driver bundled with dockerd accepts the exporter's rewrite-timestamp option and then ignores it: layer mtimes keep the build clock, so two builds of one revision produce different images and different measurements. It still normalises the image config's created field, which is the only thing the old guard compared, so the check passed and unreproducible releases shipped anyway. Three builds of 96e1c23 demonstrate it -- CI attempt 1 measured PCR0 41459ff7, attempt 2 measured 98c3915c, and a local rebuild measured f8abaf0f. Only a docker-container BuildKit honours the option, so the release now runs on one and refuses to build otherwise. Replace the created-only guard with a real one: build the enclave image twice and require both to be identical. A normalised created field is not evidence that the layers were normalised, and the manifest's reproducibility claim should be tested by the release that makes it rather than merely asserted. verify-build.sh gets the same driver check. Without it a verifier on the docker driver sees a mismatch against an honest release, which reads as an accusation that the published measurements are dishonest. Both scripts now build the nitro-cli image with buildx --load: a docker-container builder leaves results in the build cache, so build-enclave would either fail on a clean machine or silently reuse a stale image of the same tag. Verified locally: verify-build.sh now reports PASS against a manifest produced by the fixed release path, and both scripts refuse to run on the docker driver. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Marketen
force-pushed
the
fix/reproducible-enclave-builds
branch
from
September 3, 2026 10:04
9da3705 to
2808e2b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
deploy/nitro/verify-build.shfails against every release we have published. The enclave build is not reproducible, so the manifest's"reproducibility": {"measurements": true}claim — and the "rebuild it yourself" half of the Nexus privacy story — does not currently hold.Three builds of the same commit
96e1c23b, sameSOURCE_DATE_EPOCH, three different measurements:41459ff7…98c3915c…f8abaf0f…PCR1 matched in all three, so the kernel is fine; PCR0/PCR2 track the enclave image.
Root cause
rewrite-timestampis honoured only by adocker-containerBuildKit. Thedockerdriver bundled with the daemon — which CI was using (building with "default" instance using docker driver) — accepts the option and ignores it. Reproduced on one machine, same source, driver as the only variable:docker-containere5e60655…e5e60655…docker534102407d…9a240abe…The existing guard could not catch this. It compared the image config's
CreatedagainstSOURCE_DATE_EPOCH, andSOURCE_DATE_EPOCHsets that field whether or not the layers were normalised — bothdocker-driver builds above reported a correctly normalisedCreated.This was latent from the start rather than a recent regression: every previous release built a different commit, so a different PCR0 was always expected and nothing ever compared two builds of one revision.
Changes
release-and-push.yml:docker/setup-buildx-action(SHA-pinned) withdriver: docker-containerbefore the EIF step.build-release-assets.sh: refuse to release unless the driver isdocker-container; replace theCreated-only guard with building the enclave image twice and requiring identical IDs.verify-build.sh: same driver guard. Without it a verifier on thedockerdriver sees a mismatch against an honest release — a false accusation, which is worse for us than a missed detection.buildx --load: adocker-containerbuilder leaves results in the build cache, sobuild-enclavewould fail on a clean machine or silently reuse a stale image of the same tag.Verification
verify-build.shondockerdriverbuild-release-assets.shondockerdriverdocker-containerf8abaf0f…verify-build.shagainst the fixed path's own manifestFollow-up
v0.1.60's published measurements came from a non-reproducible build. After this merges, cut v0.1.61, repoint the SDK trust policy at it, and redeploy before making the repos public.
🤖 Generated with Claude Code