Skip to content

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

Open
w3irdrobot wants to merge 8 commits into
masterfrom
codex-sigrs-maple
Open

w3irdrobot wants to merge 8 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; the repository, commit and build run must be present and well formed;
  • on a verification failure, refreshes Sigstore's trusted root once through TUF and retries once;
  • logs the outcome, and for a verified release the signed repository, commit, build run and Rekor log index; a failure logs its category. The latest result stays readable through the client.

Where the Sigstore crates come from

Upstream sigstore-verify cannot yet verify P-384 keys logged in Rekor v2 or require a checkpoint from the entry's own log, so the SDK uses MaplePrivacyLabs/sigstore-rust's patched copy, published on crates.io:

  • sigstore-verify is the registry package maple-sigstore-verify =0.17.0-maple.1, under its usual dependency key, so imports do not change. It brings maple-sigstore-rekor 0.17.0-maple.1 with it.
  • sigstore-types and sigstore-trust-root are the unmodified upstream crates at =0.17.0, the release the patched crates are built on and pin exactly.

Nothing comes from Git, so maple-sdk stays publishable and the sdk-rust lane packages it as before. Once an upstream release has both fixes (sigstore/sigstore-rust#375 is open for the P-384 part), the SDK can return to upstream sigstore-verify.

How to read it

Eight commits, in order. The first three are the feature; the rest are changes from review:

  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).
  3. CI. The trust-input comparison, and a packaging skip for the Git dependency that commit 8 removes again.
  4. Audit data. The build run is required and, with the repository, commit and log index, logged for a verified release. A log entry whose two index fields differ is rejected.
  5. The statement check follows the TypeScript SDK's order, pinned by 50 shared vectors under sdk/rust/tests/fixtures/release-statement/, byte-identical to the copy in SDK: verify enclave release statements in TypeScript sessions, report-only #1668.
  6. Statement checks run only after the signature, log evidence and timestamp have verified.
  7. The verifier comes from crates.io as described above, moving from upstream 0.16.0 to 0.17.0. No source change was needed.
  8. Packaging runs again. The sdk-rust lane's packaging skip is removed.

Outside the corpus, the vectors and the generated lockfiles it is about 3,500 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, commit and build run are audit data: logged when an approval verifies, never compared with pinned values.
  • Same answers as the TypeScript SDK. Both SDKs accept the same release evidence. For input both reject, the failure category can differ when the signature does not verify or the bundle is corrupt, because the two verifier libraries read a bundle in a different order; the fixtures' README lists this and three forms only one SDK reads.
  • 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 from crates.io in all four lockfiles: the two maple-sigstore-* crates at 0.17.0-maple.1 and seven upstream crates at 0.17.0. The SDK and proxy lockfiles gain 61 crate names, Agent 19, Research 22.

Checked

  • SDK library tests: 183 pass, 1 ignored. The 56-vector corpus and the 50 statement vectors give the expected outcome and reason for every vector, on the published 0.17.0 crates as on the earlier Git revision.
  • Removing the checkpoint binding makes the corpus test fail: four vectors that the plain library accepts are then accepted by the SDK too.
  • 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.
  • Against hosted Dev, an attestation handshake with no sign-in logs release verification observation completed outcome=Verified for the deployed enclave, with its bundle fetched from attestations-dev.maple.ai.
  • A bundle host delayed 500 ms does not delay a session with a 100 ms deadline.
  • The sdk-rust lane passes, including cargo package and the upload validation, and cargo publish --dry-run for maple-sdk succeeds.
  • The pre-commit gates for the touched components: Agent 3,038 tests, Research 93, proxy 41, all passing; the proxy, Research Rust, repo and four dependency-policy lanes pass.
  • In each lockfile, compared with the Git-based version, only maple-sdk's own Sigstore dependencies changed.
  • 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.

Not checked

  • A signed-in hosted Dev session 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

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.
Validate signed source and build fields and expose the repository, commit, workflow run, and Rekor index on successful verification results. Include that audit data in release logs and reject entries whose two log indexes differ.
Apply the shared statement checks in order and accept equivalent JSON number forms for build attempts. Add the shared 48-vector fixture and pin its digest in the Rust test.
w3irdrobot and others added 2 commits November 25, 2026 18:22
Depend on the patched verifier as the registry package
maple-sigstore-verify 0.17.0-maple.1 instead of a Git revision, keeping
the sigstore-verify dependency key so imports do not change. The
unmodified sigstore-types and sigstore-trust-root come from crates.io at
exactly 0.17.0, the release the patched crate pins.

crates.io refuses a crate with a Git dependency, so this makes maple-sdk
publishable again. The SDK compiles against 0.17.0 unchanged, and every
corpus and release statement vector keeps its expected outcome and
reason.

The proxy, Agent and Research desktop lockfiles change only in the
verifier crates and their two new transitive dependencies. Agent's Nix
package no longer needs a hash for the Git source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SDK's dependencies all come from crates.io now, so cargo package
can run for it. Remove the lane's skip for Git-only dependencies and
validate the packaged crate for upload as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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