stage0: fail closed unless Secure Boot enabled and Deployed Mode#7
Merged
Conversation
Read SecureBoot and DeployedMode from the UEFI global variables at the top of run() (before network bring-up) and refuse to boot -- routed to the existing fail-closed shutdown -- unless both are exactly 1. Reading the variables here, pre-ExitBootServices, is reliable (unlike later from Linux). This folds the platform-state requirement into stage0's own behaviour: because stage0's binary is pinned by its firmware measurement, "authentic stage0 ran" now implies Secure Boot was enabled and the platform was in Deployed Mode -- even on firmware that does not measure DeployedMode into PCR 7. State only: the release signing cert is ephemeral and unknown at build time, so key identity is bound by the attested PCRs, not here. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
stage0 reads
SecureBootandDeployedModefrom the UEFI global variables at the very top ofrun()(before network bring-up) and refuses to boot -- via the existing fail-closed shutdown -- unless both are exactly1. Reading them here, pre-ExitBootServices, is reliable, unlike later from Linux.Why
It makes the platform state part of stage0's measured behaviour: since stage0's binary is pinned by its firmware measurement, "authentic stage0 ran" now implies Secure Boot was enabled and the platform was in Deployed Mode -- even on firmware that doesn't fold
DeployedModeinto PCR 7. State only: the release signing cert is ephemeral and unknown at build time, so key identity stays bound by the attested PCRs, not by anything checked here.Verification
x86_64-unknown-uefiviamake.make smoke-boot-x86_64: 5/5 modes still PASS -- the test boot.disk enrolls PK/KEK/db andvirt-fw-vars --set-true DeployedMode --secure-boot, so the gate passes under the harness (and would fail-closed with a specific error otherwise).🤖 Generated with Claude Code