Repository navigation
SDK: verify enclave release statements in TypeScript sessions, report-only - #1668
Open
w3irdrobot wants to merge 9 commits into
Open
w3irdrobot wants to merge 9 commits into
w3irdrobot wants to merge 9 commits into
Conversation
Add the verifier side of release-approval checking, not yet used by any session. A release bundle is accepted only when it fits under a byte cap, names no JSON member twice, passes the pinned Sigstore browser verifier's strict managed-key profile with a given approval key and trusted root (DSSE signature, one Rekor v2 entry with its inclusion proof and checkpoint, one RFC 3161 timestamp), and carries an in-toto release statement for the expected environment and all three PCRs. Repository and commit are returned as audit data only. The reported log index is the one the inclusion proof covers. The repeated-member check lets JSON.parse validate the text, then walks string and bracket tokens with one stack instead of parsing JSON by hand. Sigstore's production trusted root is embedded and loaded apart from the policy code. Tests run the shared managed-key corpus byte for byte and the published Dev release bundle, kept as served with its SHA-256 beside it and out of the formatter. The SDK lane stages the reviewed Dev signing key and trusted root next to the SDK so the tests compare against them, and changes to either now select that lane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the existing Nitro and PCR checks accept a remote enclave, start a release-approval observation without waiting for it. It finds the bundle for the authenticated PCRs in a verified in-memory cache, in the bundles shipped with the SDK, or by a bounded fetch from the environment's fixed host, verifies it with that environment's approval key, and logs a pass or a failure category with public release identity only. It never changes, delays or fails a session, and its errors are dropped. Loopback development servers, whose documents are not authenticated, are not observed. Only the Dev approval key ships; Production reports approval-key-not-configured and never falls back to it. The published Dev release bundle is embedded as served and verified as text. Failures, 404s and timeouts are never cached. The packed-package check confirms that the ESM and UMD builds carry each published bundle with its pinned SHA-256 and that no WebAssembly ships. The Research desktop app may connect to the two bundle hosts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Maple development preview: https://0f28f2af.maple-ca8.pages.dev Commit: Uses development API, billing, flags and PCR configuration. Cloudflare Access applies. |
Release approvals are always DSSE envelopes, so no session ever verifies a bundle that signs an artifact directly. The verifier module carried that path, and the digest-verification helper it pulled in, only so the shared corpus could run its artifact-signing vectors. Move that path into the corpus test, where it calls the pinned verifier with the same strict profile. The module now holds only what a session runs, and the helper import goes away. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A release statement also signs the workflow run that built the release. Require its shape alongside the repository and commit, and add it to the line logged when an approval verifies, so the log points at the exact build. Like the repository and commit it is audit data: it is never compared with a pinned value. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A transparency log entry names its index on the entry and again in its inclusion proof, and verifiers differ in which one they prove inclusion at. A bundle whose two values differ was therefore accepted by one client and rejected by another. Reject it before verification as tlog-index-mismatch, so every client answers the same way and the index that is logged is the one that was proven. Also report text that is not JSON as json-syntax-error for both the bundle and the signed statement, the name the Rust SDK uses. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The TypeScript and Rust SDKs must give the same answer for the same statement, including one that is wrong in several ways at once. Add 48 vectors, edits of the published Development statement with the expected outcome and failure category, and document the order of the checks beside them. The Rust SDK runs a byte-identical copy; both pin its SHA-256. A build attempt is now judged by its value and must be a whole number that every JSON reader holds exactly, so 1, 1.0 and 1e0 are treated alike in both SDKs. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The statement decoder dropped a leading byte order mark, so a payload that starts with one was read as JSON here and refused by the Rust SDK. Keep the mark so JSON parsing refuses it in both. Add that case and a repeated member in text that is cut short to the shared vectors, 50 in all, and spell out in their README that the whole text is checked as JSON before repeated members are looked for. List the three forms the Rust SDK refuses and this SDK reads, none of which the release pipeline writes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A bundle whose payload is not JSON and whose signature does not verify is rejected by both SDKs, with different categories, because the Rust verifier reads the payload before it can check the signature. Record it beside the shared vectors. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The TypeScript and Rust SDKs must accept the same release evidence. For input both reject, the failure category may differ, because the two verifier libraries read a bundle in a different order. Rewrite the known differences beside the shared vectors to say so, and keep apart the three forms only one SDK accepts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch was successfully deployed
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 this adds
The TypeScript SDK now checks an enclave's signed release statement during 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.
After the existing Nitro and PCR checks accept a remote enclave, the SDK starts a background check that:
attestations-dev.maple.aiorattestations.maple.ai);sigstore-browserfork's strict managed-key profile: DSSE signature, one Rekor v2 entry with its inclusion proof and checkpoint, one RFC 3161 timestamp;release evidence: passwith the signed repository, commit, build run and Rekor log index, orrelease evidence: failwith a failure category.How to read it
Five commits. The first two are the feature; the last three are small changes from review:
sdk/src/lib/releaseEvidence/verification.ts, the repeated-JSON-member check, the embedded trusted root and the tests. 100 of its 114 files are a copied test corpus undersdk/test/fixtures/managed-key/.sdk/src/lib/transportV2/client.ts, the packed-package check, the Research desktop CSP and CI lane routing. About 1,100 lines, and all of the session risk.To see the behavior without the test data, read
transportV2/client.ts(the hook), thenreleaseEvidence/observe.ts,verification.tsandfetchBundle.ts. Hidingsdk/test/fixturesin the file filter takes the list from about 125 files to 25.Things worth knowing
approval-key-not-configured, makes no request and never falls back to the Dev key.tlog-index-mismatch, so this SDK and the Rust SDK answer the same way. The Rust SDK change (SDK: verify enclave release statements in Rust sessions, report-only #1672) uses the same failure category names.@freedomofpress/sigstore-browserfrom theMaplePrivacyLabs/sigstore-browserfork, pinned by commit to a branch with committed build output and no install scripts.Checked
just lane sdk-tsandjust lane repopassed on the first two commits; CI runs them on the head.scripts/ci/opensecret-release/in the SDK lane, and a change to either selects that lane.Not checked
🤖 Generated with Claude Code