Skip to content

pcr-replay: GPT digest from the attestation; GCP release gate; release procedure - #6

Merged
HarryR merged 13 commits into
mainfrom
pcr-replay-gpt-digest
Nov 18, 2026
Merged

HarryR merged 13 commits into
mainfrom
pcr-replay-gpt-digest

Conversation

@HarryR

@HarryR HarryR commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Part of the GCP release changeset: with lockboot/stage0#14, lockboot/stage1#22 and lockboot/stage2#5, on top of vaportpm v0.4.1 (lockboot/vaportpm#12).

pcr-replay

  • An event marked "from_attestation": "gpt" takes its digest from the gpt {bank: hex} of the --check attestation (or vaportpm-verify output) instead of its derivation, reported as supplied with whether it equals the file's own derivation. The quote binds it: a wrong value fails the PCR comparison. Without a gpt field the event replays as before.
  • platforms/gcp/README.md: every-boot TDX verification; the superseded 2026-11-05 table removed.

Release gate on GCP (tools/cloudtest/, new)

  • gcp-setup.sh, gcp-run.sh, gcp-delete.sh and test-{sev,snp,tdx}.sh: one capped spot VM per confidential configuration, console read back from Cloud Logging.
  • check-run.py: per payload boot, vaportpm-verify accepts stage1's attestation, its nonce is sha256(stage2), the quoted PCRs replay against the golden platform file with the attested GPT digest, and the final PCRs replay with stage2's file (unsigned; covers PCR14 / PCR15). An unreproduced PCR fails the gate unless expected.

Release procedure and governance

Tracker

  • WIP-RELEASE-TODO.md trimmed to outstanding items, with the decisions made along the way under Notes; scope is GCP Confidential VMs. PLAN-GPT-MEASUREMENT.md removed (decided and implemented); its two untested questions are tracker items.

Tested

  • pcr-replay: synthetic attestations (first-boot GPT, rewritten GPT, a gpt inconsistent with the quote fails).
  • The gate, 2026-11-18, run be236c1f6330: n2d SEV, n2d SEV-SNP and c3 TDX each pass on both payload boots. test-snp.sh itself is unrun (SEV-SNP went through the same three steps by hand).

🤖 Generated with Claude Code

HarryR and others added 2 commits November 14, 2026 22:23
An event marked "from_attestation": "gpt" (stage0's EV_EFI_GPT_EVENT) uses
the gpt {bank: hex} of the --check attestation (or vaportpm-verify output)
instead of its derivation, reported as "supplied" with whether it equals the
file's own derivation. The quote binds it: a wrong value fails the PCR
comparison. Without a gpt field the event replays as before.

Verified on GCP c3-standard-4 TDX: boots 1-3 of a stage2 reboot test replay
PCR2 from the attested GPT, including after stage2's rewrite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Section 3 chosen and implemented (stage2 grow-then-reboot), verified on GCP
n2d SEV-SNP and c3 TDX: /data survives the reboot after provisioning on
both. O1 settled (read-back guard). Section 4 done (vaportpm#13, stage1#22,
stage0#14, workspace#6). Rejected: binding stage0 via PCR7 and excluding
PCR2 -- it rests on a key deletion nobody can demonstrate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HarryR and others added 2 commits November 15, 2026 11:56
- RELEASING.md: the release procedure common to stage0/1/2 and vaportpm
  (v* tag on main's merge commit, the workflow publishes an immutable,
  attested release, verify it byte-for-byte), and vaportpm's version,
  assets, pin line and consumer repin steps.
- rulesets.sh: vaportpm's required checks are ci build-x86_64
  build-aarch64, now that its CI builds the static musl binaries
  (vaportpm#13). Applied live with `make sync-rulesets`;
  `make check-rulesets` clean on every repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RELEASING.md: release workflows create the release as a draft with its
assets and publish it last; a published (immutable) release takes no
uploads. Tracker: vaportpm v0.4.0 shipped empty, v0.4.1 verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HarryR and others added 6 commits November 18, 2026 05:27
Its two untested questions (firmware on a grown volume, Nitro PCR5) move to the
tracker's open items.

Co-Authored-By: Claude <noreply@anthropic.com>
The flat zkVM format and vaportpm-zk are unchanged by design.

Co-Authored-By: Claude <noreply@anthropic.com>
…the 11-05 table

The 2026-11-05 expected-values table is superseded by the captures table.

Co-Authored-By: Claude <noreply@anthropic.com>
…-gcp

- WIP-RELEASE-TODO.md: resolved and superseded items removed (git history has them);
  scope is the GCP x86_64 release; records the kernel bump, the 2026-11-18 selftest and
  the release tooling fixes.
- Makefile: deploy-shell-aws and deploy-shell-gcp = deploy-shell with LOGIN fixed.

Co-Authored-By: Claude <noreply@anthropic.com>
…-18 run

- gcp-setup.sh (snapshot the replay inputs, bundle, upload, stage0 image), gcp-run.sh (one
  capped spot VM, console read back from Cloud Logging), gcp-delete.sh, and
  test-{sev,snp,tdx}.sh wrapping run + delete + check for one configuration.
- check-run.py: per payload boot, vaportpm-verify accepts stage1's attestation, its nonce
  is sha256(stage2), the quoted PCRs replay against the golden platform file with the
  attested GPT digest, and the final PCRs replay with stage2's file (unsigned; PCR14/15).
  An unreproduced PCR fails the gate unless expected (PCR10; PCR14 in the quoted replay).
- WIP-RELEASE-TODO.md: scope is GCP Confidential VMs; SEV, SEV-SNP and TDX pass the gate
  (cloudtest be236c1f6330).

test-snp.sh is unrun: SEV-SNP went through the same three steps by hand.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@HarryR HarryR changed the title pcr-replay: take the GPT event's digest from the attestation pcr-replay: GPT digest from the attestation; GCP release gate; release procedure Nov 18, 2026
@HarryR
HarryR marked this pull request as ready for review November 18, 2026 09:26
HarryR and others added 3 commits November 18, 2026 13:11
Committed by mistake in a56e303. The workspace .gitignore has ignored
__pycache__/ since f500cc2; that rule does not untrack a file already
committed.

Co-Authored-By: Claude <noreply@anthropic.com>
…ker and notes

RELEASING.md gains a section per stage (assets and zip layout, what the
attestation covers, the ghcr image, local build targets to compare
against, stage0's image publish) and its verify commands pin the
release's tag (--source-ref) and check the asset against the immutable
release, as create.sh does.

REPRODUCIBLE-BUILDS.md: the linker's debug record on UEFI targets as a
third trap, and the commit-date yy.mm in the UKI's os-release.

Tracker: resolved and decided items removed (decisions recorded under
Notes), the selftest on the final trees, and what the next CI runs must
confirm. AGENTS.md: GCE instances always set serial-port-enable=true.

Co-Authored-By: Claude <noreply@anthropic.com>
The two things only CI could show are confirmed on stage0#14's and
stage1#22's runs: stage0's CI build equals the local build on both
arches (PCR4 and the unsigned body), and stage1's artifact is flat with
every file byte-identical. What is left for this release is the tags.

Co-Authored-By: Claude <noreply@anthropic.com>
HarryR added a commit to lockboot/stage0 that referenced this pull request Nov 18, 2026
…ithout a debug record; publish scripts verify the release tag (#14)

Part of the GCP release changeset: with lockboot/stage1#22,
lockboot/stage2#5 and lockboot/workspace#6, on top of vaportpm v0.4.1
(lockboot/vaportpm#12).

**PCR replay**
- `predict-pcrs.py` marks stage0's EV_EFI_GPT_EVENT `"from_attestation":
"gpt"`, so workspace pcr-replay takes that event's digest from the
attestation and reproduces PCR5 (PCR2 on GCE TDX) on every boot, not
only before stage2 rewrites the GPT. `pcrs.json` stays the first-boot
reference.

**Reproducible build**
- The UEFI targets link with `/DEBUG:NONE`. CI's `stage0.efi`, `ena.efi`
and `gvnic.efi` each differed from a local build of the same commit in 8
bytes: the GUID of the linker's debug record, a hash of the `.pdb`,
which records where the toolchain is installed (`/tmp/.rustup` in CI,
`/src/.rustup` locally). The Authenticode hash and PCR4 differed with
it. No `.pdb` is written now and the image carries no debug record. This
changes the measured stage0 binary.
- `os-release`'s `yy.mm` version is the committer date (UTC) of the
commit being built, not the build date.

**Release and publish tooling**
- CI: the release job creates the release as a draft with its assets,
then publishes it. Publishing first leaves an immutable release empty,
as vaportpm v0.4.0 was (lockboot/vaportpm#14).
- `tools/publish/{ec2,gcp}/create.sh`, release path: `gh attestation
verify` gains `--source-ref refs/tags/<version>` (the provenance must
come from a build of that tag), and `gh release verify-asset` checks the
zip is an asset of the immutable release.
- Both scripts read `os-release` as data instead of sourcing it.

**Tested**
- Workspace `make selftest`, x86_64 and aarch64.
- CI's build equals the local build on both arches: PCR4 in `pcrs.json`
is identical, and the body of CI's signed `BOOT*.EFI` is byte-identical
to the local unsigned `stage0.efi` (PCR7 differs: the Secure Boot keys
are minted per build).
- GCP release gate (workspace `tools/cloudtest`, 2026-11-18, run
be236c1f6330) on n2d SEV, n2d SEV-SNP and c3 TDX, with the image built
from this branch: stage1's attestation verifies and every PCR replays
against the golden platform files on both payload boots. The gate ran
before the debug record was removed and is not re-run.
- The two `gh` checks against lockboot/vaportpm v0.4.1 (its tag passes;
another tag and refs/heads/main fail); the os-release parser on a good,
a hostile and an incomplete file.

**Not tested**
- `create.sh <arch> <tag>` end to end and the draft-then-publish release
job: both need this repo's first tag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
HarryR added a commit to lockboot/stage1 that referenced this pull request Nov 18, 2026
…rom the commit (#22)

Part of the GCP release changeset: with lockboot/stage0#14,
lockboot/stage2#5 and lockboot/workspace#6, on top of vaportpm v0.4.1
(lockboot/vaportpm#12).

**GPT digests in the attestation**
- stage1 finds the boot disk (stage2's `find_boot_device` rules,
duplicated for now), reads its GPT and passes H(UEFI_GPT_DATA) (sha256 +
sha384) to vaportpm's `attest()`, which now requires it. A verifier uses
it to replay the PCR the firmware's EV_EFI_GPT_EVENT extended (PCR5;
PCR2 on GCE TDX) after stage2 has rewritten the GPT.
- vaportpm-attest pinned to the v0.4.1 release (157ec04, guard =0.4.1).
`make update-vaportpm` re-resolves Cargo.lock after changing the rev.

**Kernel**
- Fedora CoreOS stable 44.20261023.3.1: kernel 7.0.12-201 ->
7.2.11-200.fc44, systemd-boot stub 259.6-1 -> 259.10-1.fc44. Fixes
picked up include a container escape in IP fragment handling (7.0.14),
CVE-2026-68480 (Safe-RET bypass, AMD) and CVE-2026-80590 (IP fragment
reassembly panic).
- Kernel 7.2 has no `crypto/hkdf.ko` (nvme-auth no longer depends on
it): dropped from the initramfs module list and from `init`, which
otherwise stops the boot.
- `build.sh` extracts exactly the kernel RPMs `fedora-deps.mk` pins
instead of `kernel-core-*.rpm`, and `update-fedora-deps` removes the
previous versions' RPMs. Before, a bump without a clean rebuilt the old
kernel silently.

**UKI version string**
- The `os-release` embedded in the UKI carried the build date's `yy.mm`,
so a commit built a different UKI in a different month. It is now the
committer date (UTC) of the commit being built.
- Its Fedora tag is the dist tag of the kernel `fedora-deps.mk` pins
(`fc44`); it was a hardcoded `fc41`.

**Release tooling**
- CI: the release job creates the release as a draft with its assets,
then publishes it (an immutable release takes no uploads after it is
published).
- `release-docker` gains `docker/setup-qemu-action` (it builds
linux/arm64 layers on an amd64 runner).
- The `uki-<arch>` artifact, and so the release zip, is flat again: the
build job collects the release files into one directory. Since
`build/<arch>/stage2` joined the upload list the artifact had been
rooted at the repo root, and `release-docker`'s download into
`tools/build-uki/<arch>` would have nested the files where
`Dockerfile.runtime` does not look. The release job still extracts each
zip into `contents/<arch>`, so attestation subjects stay distinct
(`<arch>/<file>`).
- `tools/publish.sh` removed: it uploaded every UKI to the same object
name and printed a `_stage1` snippet stage0 rejects. `lockboot-deploy
create` replaces it.

**Tested**
- `make ci`; workspace `make selftest`, x86_64 and aarch64, with 7.2.11
confirmed in the boot logs.
- CI's artifact is flat, and every file in it is byte-identical to the
local build on both arches. UKIs: x86_64 `fecbe639b4bb9fa0`, aarch64
`fef50d8d91a5510f`.
- GCP release gate (workspace `tools/cloudtest`, 2026-11-18, run
be236c1f6330) on n2d SEV, n2d SEV-SNP and c3 TDX with the UKI as it was
before the version-string change (`e0bc2bbc860aa046`; not re-run): on
both payload boots the attestation verifies against Google's root, its
nonce is sha256(stage2), and the quoted PCRs replay against the golden
platform file with the attested GPT digest.

**Not tested**
- The release jobs (draft-then-publish, `release-docker`): they run only
on a tag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@HarryR
HarryR merged commit e566ebc into main Nov 18, 2026
@HarryR
HarryR deleted the pcr-replay-gpt-digest branch November 18, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant