Skip to content

feat: add proof-verify-pcrs target - #974

Merged
piohei merged 5 commits into
mainfrom
chore/pin-nitro-enclave-image
Aug 5, 2026
Merged

feat: add proof-verify-pcrs target#974
piohei merged 5 commits into
mainfrom
chore/pin-nitro-enclave-image

Conversation

@0xOsiris

@0xOsiris 0xOsiris commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Note

Low Risk
Changes are limited to Justfile deployment/ops scripts and env comments; no contract or runtime code paths are modified.

Overview
Adds Phase 3c (proof-verify-pcrs): re-measures PCR0/1/2 from the running enclave (via existing proof-get-pcrs), hashes them the same way as proof-approve-pcrs, and calls isPCRSetApproved on NitroAttestationVerifier. Fails with actionable output (running vs recorded sets, fix hint) when the allowlist does not match—so EIF rebuilds under a mutable PROOF_NITRO_IMAGE tag cannot silently break registerKey / TEE proofs after setup.

proof-setup now runs this step after approval when not in dry-run, and workflow docs extend through 0a–3c. scripts/proof-envs/alphanet.env documents the mutable-tag / PCR drift risk and points operators at verify + optional digest pinning (image line is still :nightly; no digest change in this diff).

Reviewed by Cursor Bugbot for commit fe922e6. Configure here.

0xOsiris and others added 3 commits August 4, 2026 11:38
The enclave image is built from a mutable tag, so every EIF rebuild changes PCR0 (enclave
image) and PCR2 (application) while PCR1 (kernel) stays put. Nothing re-approves the new
measurements, so the running enclave silently drops off the on-chain allowlist and every
registerKey / TEE proof reverts — with no signal until someone reads a revert reason.

This is not hypothetical: on alphanet the running enclave measures
PCR0=4f1adb…/PCR2=e89ada… while the verifier only approves b94235…/f0e0ed…, and
`isPCRSetApproved` returns false.

`just proof-verify-pcrs` measures the enclave that is actually running and asserts its PCR
set is approved on-chain, printing both sets side by side and the remediation command when
it is not. It deliberately re-measures rather than trusting PCR0/1/2 from the shell —
trusting the shell would reproduce exactly the drift this is meant to catch.

Wired into `proof-setup` as Step 3c so setup verifies rather than assumes (skipped under
dry_run, which approves nothing). Also documents the mutable-tag hazard where
PROOF_NITRO_IMAGE is defined — note that variable is currently declarative only, so
pinning a digest there does not by itself prevent drift.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@0xOsiris 0xOsiris changed the title Chore/pin nitro enclave image chore: pin nitro image Aug 4, 2026
@0xOsiris
0xOsiris marked this pull request as ready for review August 4, 2026 18:52
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@0xOsiris 0xOsiris changed the title chore: pin nitro image feat: add proof-verify-pcrs target Aug 4, 2026
@0xOsiris
0xOsiris changed the base branch from main to fix/nitro-auto-register-not-fatal August 4, 2026 22:12
Base automatically changed from fix/nitro-auto-register-not-fatal to main August 5, 2026 11:09
@piohei
piohei merged commit d917fcb into main Aug 5, 2026
12 checks passed
@piohei
piohei deleted the chore/pin-nitro-enclave-image branch August 5, 2026 11:10
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.

2 participants