Skip to content

SDK: verify enclave release statements in Rust sessions, report-only - #1672

Draft
w3irdrobot wants to merge 3 commits into
masterfrom
codex-sigrs-maple
Draft

w3irdrobot wants to merge 3 commits into
masterfrom
codex-sigrs-maple

Conversation

@w3irdrobot

@w3irdrobot w3irdrobot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

The Rust SDK now checks an enclave's signed release statement after Transport V2 session setup and logs the result. It is report-only: it never changes, delays or fails a session, and there is no UI. This is the Rust counterpart of #1668.

After a remote enclave's attestation and transcript checks pass, the SDK starts a background task that:

  • finds the release bundle for the authenticated PCRs: a verified in-memory cache, then the bundle shipped with the SDK, then a bounded fetch from the environment's fixed host (attestations-dev.maple.ai or attestations.maple.ai);
  • verifies it with that environment's approval key and Sigstore's trusted root: DSSE signature, one Rekor v2 entry with its inclusion proof and a checkpoint bound to that entry's log, one RFC 3161 timestamp;
  • checks the statement: predicate type, signed environment, and PCR0, PCR1 and PCR2 equal to the authenticated ones;
  • on a verification failure, refreshes Sigstore's trusted root once through TUF and retries once;
  • logs the outcome and a failure category, and keeps the latest result readable through the client.

Read this first: publishing maple-sdk

This makes maple-sdk unpublishable to crates.io until its Sigstore dependency comes from the registry again. Upstream sigstore-verify cannot verify P-384 keys logged in Rekor v2, so the SDK depends on the MaplePrivacyLabs/sigstore-rust fork by Git revision, and crates.io rejects Git-only dependencies.

  • Prepare maple-sdk 5.0.0 and maple-proxy 0.5.1 for crates.io #1671 prepared maple-sdk 5.0.0 and maple-proxy 0.5.1 for crates.io. Publish those before merging this, or hold this until they are out.
  • After this merges, a later maple-sdk release needs one of: an upstream release with the fix (feat(rekor,verify): verify P-384 Rekor v2 hashedrekord entries sigstore/sigstore-rust#375 is open for the P-384 part), or published copies of the fork's crates.
  • Because cargo package cannot run, the third commit changes the sdk-rust lane: it still runs format, Clippy, tests and docs, and it skips packaging and the upload validation while the manifest has a Git-only dependency, printing why. It does not add a registry version beside the Git source, since packaging would then ship the unpatched upstream crate. The lane therefore no longer proves that a packaged crate builds. I have not run the real publish workflow against this; I expect it to stop for lack of a crate file.

How to read it

Three commits, in order:

  1. Verifier and policy, not wired into anything. sdk/rust/src/release_verification/bundle.rs, the trust assets, and the tests. 100 of the files are a copied test corpus under sdk/rust/tests/fixtures/managed-key/.
  2. Lookup and the session hook. Fetch, cache, refresh, the embedded bundle, the hook in sdk/rust/src/transport_v2/client.rs, and the lockfiles of the three in-tree consumers (proxy, Agent, Research desktop) plus the fork's hash in Agent's flake.nix.
  3. CI. The trust-input comparison and the packaging skip described above.

Outside the corpus and the generated lockfiles it is about 3,000 lines.

Things worth knowing

  • Only the Dev approval key ships. A Production session reports approval-key-not-configured, makes no request and never falls back to the Dev key.
  • Loopback development servers are not checked. Their documents are not authenticated, so they get no release check and local stacks do not call a hosted service.
  • The session does not wait. The check is a task owned by the client and is cancelled when the client is dropped; queued verification work does not start after cancellation.
  • The key and the host come from the SDK's own environment setting. Nothing in a bundle or a response can add a key or change the environment. A TUF refresh can update Sigstore's log and timestamp keys, never Maple's approval key.
  • The subject digest is a signed claim only, not logged or exposed as a verified EIF digest. Repository and commit are audit data, not policy inputs.
  • Repeated JSON member names are rejected before anything is trusted, using Serde's own parser.
  • The one published Dev bundle is embedded exactly as served, so that enclave verifies offline.
  • Dependencies: nine sigstore-* crates, all from one fork revision, in all four lockfiles; none from the registry. The SDK and proxy lockfiles gain 61 crate names, Agent 19, Research 22.

Checked

  • SDK library tests: 171 pass, 1 ignored. The 56-vector corpus gives the expected outcome and reason for every vector.
  • The published Dev bundle passes, and fails for Production, another key, each changed PCR, zero or two timestamps, an extra log entry, an integrated time or inclusion promise, a missing or older media type, both content types together, and a repeated member name.
  • A bundle host delayed 500 ms does not delay a session with a 100 ms deadline.
  • The pre-commit gates for the touched components: Agent 3,038 tests, Research 93, proxy 41, all passing; the four dependency-policy lanes pass.
  • The embedded Dev key and trusted root are compared with the reviewed copies under scripts/ci/opensecret-release/ in the SDK lane, and a change to either selects that lane.
  • After rebasing onto Prepare maple-sdk 5.0.0 and maple-proxy 0.5.1 for crates.io #1671: cargo metadata --locked --offline passes for all four manifests. The test suites were not rerun locally after that rebase.

Not checked

  • A live hosted Dev connection and a real TUF refresh against Sigstore's public repository.
  • Any native runtime: macOS, Windows, iOS, Android devices. Only a Linux build and an Android aarch64 compile.
  • Agent's full Nix package build.

🤖 Generated with Claude Code


Run Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Verify signed release bundles using a local approval key, a pinned trusted
root, and the expected environment and measurement tuple. Require a DSSE
statement, one Rekor v2 log entry with a bound checkpoint, and one RFC 3161
timestamp.

Enforce JSON and content-shape rules for statements, log entries, timestamp
evidence, signatures, certificates, and media types. Add accepted and
rejected managed-key corpus cases without connecting the verifier to
sessions.
Observe the authenticated enclave's release after attestation and transcript
checks without delaying or failing the session. Support the embedded
Development bundle, bound remote lookups to 1 MiB, cache verified results,
and permit one bounded TUF refresh before one retry.

Expose the latest outcome through the client without observing
unauthenticated loopback sessions. Cancel pending observations with the
client and prevent queued cryptographic work from starting afterward.
Keep Rust formatting, Clippy, tests and documentation active while the
manifest has Git-only dependencies that cannot be packaged. Emit an explicit
marker for that state, restore packaging when registry versions are
available, and reject missing archives otherwise.

Stage and compare the approval key and trusted root through the SDK lane
tests, and select that lane when either trust input changes.

This branch has not been deployed

No deployments
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