Repository navigation
Pin every image input and check measurements.txt in CI - #205
Merged
Merged
Conversation
measurements.txt is meant to publish the PCRs of the image this repo builds, but nothing kept it current (last updated in July), and the build could not keep it stable: golang:1.24 and the python base were floating tags, and apt installed whatever Debian served that day. The same commit measured differently from week to week. - Dockerfile: base images pinned by digest (golang 1.24.13, python 3.12.10-slim-bookworm, uv 0.7.3). apt reads from snapshot.debian.org at 2026-11-24 (DEBIAN_SNAPSHOT), with Check-Valid-Until off because snapshot Release files expire. - scripts/measure-enclave.sh: builds the EIF with nitro-cli 1.5.3 in a pinned Amazon Linux container against the Docker socket and prints PCR0-2 in measurements.txt's shape. No Nitro hardware needed. PCR1 is identical across nitro-cli 1.3.4-1.5.3 (and matches the July file), so the hosts' nitro-cli version does not matter. - make measurements: builds the image and writes measurements.txt. The image target now depends on the files the Dockerfile copies in, so an edited source file triggers a rebuild. - Measurements workflow: on PRs touching image inputs and on pushes to main, builds and measures the image and fails if PCR0-2 differ from measurements.txt, printing the JSON to commit. - README/CLAUDE.md: how to reproduce and update the measurements. measurements.txt itself is updated in a follow-up commit with the PCRs CI computes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SQvDLzSf3RR7U4hG3QQD24
PCR0-2 as computed by the Measurements job on 85644e4. PCR1 is unchanged from July, as expected: it depends only on nitro-cli's enclave kernel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SQvDLzSf3RR7U4hG3QQD24
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
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.
Why
measurements.txtis meant to publish the PCRs of the image this repo builds, so anyone can check what code an enclave runs, and third-party operators can match it. Today:FROM golang:1.24andFROM python:3.12.10-slim-bookwormare tags, re-pushed with patch updates.apt-get update && apt-get installtakes whatever Debian bookworm serves that day, and bookworm gets security updates roughly weekly.The existing reproducible-build workflow doesn't catch the drift because it builds twice back to back.
What
Every input is pinned (
Dockerfile):name:tag@sha256:…in bothFROMandCOPY --from.snapshot.debian.orgat 2026-11-24 (ARG DEBIAN_SNAPSHOT), withCheck-Valid-Until=falsesince snapshot Release files expire. Tested: the same package set installs from that snapshot on the pinned base.DEBIAN_SNAPSHOT(plus re-recording the PCRs).scripts/measure-enclave.shbuilds the EIF with nitro-cli 1.5.3 inside a pinnedamazonlinux:2023container against the Docker socket, and prints PCR0–2 inmeasurements.txt's shape. No Nitro hardware needed.measurements.txt. The enclave kernel is the same in each, so the hosts' nitro-cli version doesn't affect the measurements.build-enclavelabels the algorithmSha512_48 { .. }wheredescribe-enclavessaysSha384 { ... }. The script writes the label the file has always carried.make measurementsbuilds the image and writesmeasurements.txt; passMEASUREMENTS=pathto write elsewhere. The image target now depends on everything the Dockerfile copies in, so an edited source file rebuilds it.Measurements workflow runs on PRs that touch an image input, on pushes to
main, and on demand. It builds and measures the image and fails if PCR0–2 differ frommeasurements.txt. On a mismatch it prints the JSON to commit, puts it in the job summary, and uploads it as an artifact.Docs: README and CLAUDE.md say how to reproduce and update the measurements. I removed the README line saying "your PCR values will differ", the opposite of what this repo promises.
Follow-ups this creates
measurements.txtin this PR: I can't build the real image in my sandbox without changing it (its proxy needs an extra CA certificate). So this PR's first CI run computes the PCRs, and I'll commit them here so the check passes.keepalive = 0): it changes the image, so whichever of the two merges second needs itsmeasurements.txtre-recorded.pathsfilter first. A required check that never runs blocks the PR.Testing
scripts/measure-enclave.shrun locally on a test image: it produces the EIF and the measurements JSON.bash -non the script.Generated by Claude Code