Skip to content

feat(attest): every VM boots the EDK2 line's OVMF with SMM and Secure Boot, PCR 0 is the same at every size, nothing on the ESP changes a boot unnoticed, and vm.ovmf is removed - #313

Merged
teemow merged 2 commits into
mainfrom
fix-attestation-secureboot
Dec 1, 2026

Conversation

@teemow

@teemow teemow commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Closes #293, after #302 and #350.

Problem

Root on a node can write the ESP. With Secure Boot off, systemd-stub boots the command line a loader entry's options passes instead of the UKI's own, so ipe.enforce=0 turns IPE off on the next boot. #302 makes that fail attestation, and #350 kills the boot, but the initrd ran with it until its quote. The ESP reaches the initrd in two more ways #302 cannot judge:

  • Credential archives: sealed credentials loaded from the ESP, accepted by their description.
  • Extension images: they extend the initrd and land in PCR 13, which the initrd quote did not cover.

PCR 0 also depended on the VM: OVMF's PEI code writes into its own firmware volume before Tcg2Pei measures it. So one golden value did not fit every VM size, or a VM's reboots.

Change

  • Firmware: every VM boots the OVMF release of the Giant Swarm EDK2 line, an SMM, Secure Boot and TPM 2.0 build. The Dockerfile pins it by tag and digest: gsoci.azurecr.io/giantswarm/edk2-ovmf:edk2-stable202611-gs.5@sha256:22ca05b3….
    • firmware/fetch.sh checks the manifest and both images against it. The container image ships them under /usr/share/vm-manager/firmware, and make firmware fetches the same files on a host.
    • The line carries the fixes that keep PlatformPei from writing into the measured volume, so PCR 0 is the same for every VM size and every boot.
    • Renovate tracks the tag and digest.
    • Ubuntu's ovmf-generic, the firmware probe and the chart's vm.ovmf values are gone.
  • Secure Boot, always: the image signs its UKI, kernel and systemd-boot with the image key, and images/scripts/verify checks both signatures with sbverify. sbsigntools is now installed in the image build container, which fixes this PR's earlier failing check.
    • vm-manager enrolls the image certificate as PK, KEK and db before every start. Each VM runs with smm=on and a secure variable store flash.
    • create_vm refuses an image without a certificate or without secure_boot. A VM installed from such an image does not start.
    • The certificate is also enrolled on a start after a restart of vm-manager.
  • No credentials on the ESP: the installer forwards none and copies no setting. The pcrlock notification is off.
  • Verifier:
    • PCR 12 rejects every credential and configuration extension archive.
    • The initrd quote covers PCR 13, which may hold only zero or the os-separator.
    • Under Secure Boot a loader entry's options no longer take effect, and the boot is still refused because systemd-boot measured them.
  • Golden values: PCR 0 and PCR 7 change, and the release records them with this firmware (hack/guest-image-golden.sh).

Breaking (0.30): vm.ovmf.code and vm.ovmf.vars are removed. VMs installed from a guest image without secure_boot do not start; delete and recreate them from a current image.

Acceptance criteria

  • With Secure Boot on, a changed loader entry does not take effect and refuses the boot (TestKernelCommandLineAttestation).
  • A credential file added on the ESP refuses the next boot (e2e).
  • An extension image added on the ESP refuses the next boot on PCR 13 (e2e).
  • PCR 0 is the same at every VM size and every boot: the gs.5 build quotes 55d980d7… at 1 vCPU and 1 GiB, 4 and 4 GiB, 8 and 2 GiB, 16 and 2 GiB, and the e2e suite's VMs of different sizes and their reboots all verify against one recorded value.
  • images/README.md no longer lists the ESP among what is not covered.

Tested

  • go test ./..., go vet with the e2e tag, golangci-lint on the code and on e2e/, hack/verify-chart.sh, and shellcheck on firmware/fetch.sh: pass.
  • Full e2e suite (workflow_dispatch, suite full) on this branch, on top of feat(attest): every boot is attested or killed; --attestation, --attestation-learn-golden, vm.attestation, vm.learnGolden and create_vm's require_attestation are removed, and golden values come from a reference boot of vm-manager image golden #350: all 22 tests pass. Among them TestKernelCommandLineAttestation (Secure Boot enabled, options measured and refused, credential and extension image refused), TestAttestation (tamper on a distribution's Secure Boot OVMF: golden mismatch on PCR 0), TestKubernetesCluster, TestHostIsolation and TestRestart. The recorded golden PCR 0 is 55d980d7….
  • agentlab (agent-platform 4.188.0-rc.3 with this branch's dev chart, a container image of this branch built with the machine's build key, and the CI guest image of this branch). The golden values were recorded with that container image by hack/guest-image-golden.sh, PCR 0 55d980d7…. agentlab vm-manager-test passes: a 1 vCPU, 1 GiB VM verifies at both stages against the values recorded at 2 vCPUs, IPE enforces, and the pod reports the firmware OVMF edk2-stable202611-gs.5. A 4 vCPU VM quotes the same PCR 0, and the guest reports Secure Boot: enabled (user). After root appends options … ipe.enforce=0 to its loader entry, the next boot is refused at its initrd quote on PCR 12 and the VM is failed, never ready.

@teemow
teemow requested a review from a team as a code owner November 29, 2026 00:18
@teemow teemow self-assigned this Nov 29, 2026
@circleci-architect

circleci-architect Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Published Helm chart vm-manager

0.29.17-r3d52ab65t20261201004845h49191c8
Chart vm-manager
Version 0.29.17-r3d52ab65t20261201004845h49191c8
OCI reference oci://gsoci.azurecr.io/charts/giantswarm/vm-manager:0.29.17-r3d52ab65t20261201004845h49191c8
Digest sha256:bb49b6013429ec2df5022f21b4841864a3d10063e2696dbf4a2249b7ef50dcc0
Registry public — gsoci.azurecr.io
Git catalog giantswarm-test-catalog (index)
Pull this chart
helm pull oci://gsoci.azurecr.io/charts/giantswarm/vm-manager --version 0.29.17-r3d52ab65t20261201004845h49191c8

Posted by architect-orb · build 6164 · commit 49191c8 · updated in place on every push

@teemow
teemow marked this pull request as draft November 29, 2026 00:51
@teemow
teemow force-pushed the fix-attestation-secureboot branch 6 times, most recently from 2854167 to f863992 Compare December 1, 2026 00:20
…s a boot unnoticed

The image signs its UKI, the kernel in it and systemd-boot with the image
key and says so in policy.json (secure_boot). vm-manager enrolls the image
certificate as PK, KEK and db before every start and boots the Secure Boot
build of OVMF, with SMM where its QEMU firmware descriptor asks for it, so
systemd-stub ignores a command line a loader entry passes.

The installer seals no credentials onto the ESP (vm-manager passes them over
SMBIOS on every boot) and the image turns off the pcrlock notification that
would write one, so PCR 12 holds only bound events: the verifier now rejects
any credential or configuration extension archive. The initrd quote covers
PCR 13 and accepts only zero or the os-separator, so an extension image on
the ESP fails the quote that releases user-data. The release's golden
recording boots the Secure Boot firmware.

Closes #293.
@teemow
teemow force-pushed the fix-attestation-secureboot branch from f863992 to 02f46ca Compare December 1, 2026 00:47
@teemow teemow changed the title fix(attest): VMs boot with Secure Boot, and nothing on the ESP changes a boot unnoticed feat(attest): every VM boots the EDK2 line's OVMF with SMM and Secure Boot, PCR 0 is the same at every size, nothing on the ESP changes a boot unnoticed, and vm.ovmf is removed Dec 1, 2026
…e, pinned by digest, always with SMM and Secure Boot

The Dockerfile's firmware stage fetches the line's OVMF artifact
(gsoci.azurecr.io/giantswarm/edk2-ovmf, a reproducible SMM, Secure Boot and
TPM 2.0 build) by tag and digest, checks manifest and images against them, and
the image ships it under /usr/share/vm-manager/firmware instead of Ubuntu's
ovmf-generic. The line carries the fixes that keep PlatformPei from writing
into the PEI volume before Tcg2Pei measures it, so PCR 0 no longer depends on
the VM's CPU count, memory or reboots. Renovate tracks tag and digest; `make
firmware` fetches the same files for a host, the e2e tests and the smoke boot.

Every VM boots that firmware with SMM and the image certificate as PK, KEK
and db: no firmware probe, no setup mode. create_vm refuses an image without
a certificate or secure_boot, a VM installed from such an image does not
start, and the chart's vm.ovmf values are gone. get_host names the build
from its firmware.json.
@teemow
teemow force-pushed the fix-attestation-secureboot branch from 02f46ca to 49191c8 Compare December 1, 2026 01:50
@teemow
teemow marked this pull request as ready for review December 1, 2026 01:50
@teemow
teemow merged commit d7ce0b1 into main Dec 1, 2026
24 checks passed
@teemow
teemow deleted the fix-attestation-secureboot branch December 1, 2026 02:15
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.

guest image: root on a node turns IPE off through the boot loader entry, and attestation still verifies

1 participant