stage1: dual sha256/ed25519 admission, signed args, fallback URLs; measure code only#11
Merged
Conversation
…asure code only
Give stage1 the same payload admission stage0 has for the UKI, so a cloud instance
can be deployed once with a pinned public key and updated by "re-sign the payload,
reboot" — no reconfiguration.
- Admission: `_stage2` accepts either a pinned `sha256` or an `ed25519` release pubkey
(detached `<url>.sig`), exactly one per arch. New `sig.rs` ports stage0's verifier
(ed25519-compact); the .sig is a byte-for-byte wire contract with stage0/mkuki.
- Signed remote args: `args_url` (+ `args_sig_url`, else `<args_url>.sig`) — a signed
JSON string array verified against the same key — overrides inline args.
- Fallback URLs: every URL field (`url`/`sig_url`/`args_url`/`args_sig_url`) accepts a
string or a list, tried in order (mirror resiliency); `{sha256}` is substituted in the
sig/args URLs. Non-2xx responses fall through to the next mirror.
- Measure code only: PCR 14 = stage2 binary hash, nothing else. `extend_pcrs` and the
pre-exec attestation no longer bind the config JSON; PCR 15 is freed for the app.
Admission (pin/key/signature) is a gate, never measured.
- JSON Schema for the `_stage2` input format (schema/stage2.schema.json).
- Tooling: `--make-config-ed25519`; the Makefile chain test gains SIGN=1 (signs the UKI
and stage2), SIGN_ARGS=1, and FALLBACK=1 knobs.
Verified: 15 unit tests (validate() table, UrlList string|list, {sha256} substitution,
sign/verify round-trip) and 4 end-to-end QEMU boot modes (sha256, ed25519, signed args,
fallback) all pass; the crate builds for x86_64 and aarch64 musl.
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.
Gives stage1 the same payload admission stage0 already has for the UKI, so a cloud instance can be deployed once with a pinned public key and updated by "re-sign the payload, reboot" — no reconfiguration.
What changed
_stage2accepts a pinnedsha256or aned25519release pubkey (detached<url>.sig), exactly one per arch. Newcrates/stage1/src/sig.rsports stage0's verifier (ed25519-compact); the.sigis a byte-for-byte wire contract with stage0/mkuki.args_url(+args_sig_url, else<args_url>.sig): a signed JSON string-array verified against the same key, overriding inlineargs.url/sig_url/args_url/args_sig_url) takes a string or a list, tried in order (mirror resiliency);{sha256}is substituted in the sig/args URLs; non-2xx falls through to the next mirror.extend_pcrsand the pre-exec attestation no longer bind the config JSON; PCR 15 is freed for the app. The admission pin/key/signature is a gate, never measured. This keeps the platform quote reproducible from boot artifacts alone and lets the app attest its own config.schema/stage2.schema.json(JSON Schema 2020-12) for the_stage2input format.--make-config-ed25519; the Makefile chain test gainsSIGN=1(signs the UKI + stage2),SIGN_ARGS=1, andFALLBACK=1knobs.Verification
validate()table (exactly-one-of, https, coupling rules),UrlListstring|list parse + serialize round-trip,{sha256}substitution, ed25519 sign/verify round-trip.Note:
schema/stage2.schema.jsonis hand-traced but not yet machine-validated in CI — a follow-up config tool (Rust, jsonschema + serde) will own creation/validation/modification of these docs and validate the schema.🤖 Generated with Claude Code