Repository navigation
Sign and publish Dev enclave release statements - #1636
Conversation
Add opensecret-release-statement-dev.yml: one reviewer-gated job in the pcr-signing-dev environment that takes a build run ID, verifies the selected OpenSecret EIF release build (master dispatch, success, commit in master history, the run's own artifact, GitHub build provenance covering image.eif, pcr.json and handoff.json, and a dev handoff that matches the EIF and measurements), then signs both approvals for that artifact under the same review: the legacy PCR0 signature with the existing key and an in-toto release statement with the Dev KMS key through pinned Cosign v3.1.4 and an explicit Rekor v2 plus timestamp signing configuration. The bundle must meet the release evidence profile (v0.3, one Rekor v2 hashedrekord entry with inclusion proof and checkpoint, one RFC 3161 timestamp, no integrated time, inclusion promise or v1 entry) and pass Cosign verification against the reviewed public key before it is retained with the EIF, uploaded to maple-attestations-dev as <PCR0>.json and read back from attestations-dev.maple.ai. AWS access is the job's OIDC token exchanged for the Dev signer role, confined to the Cosign process. The key ARN, role ARN and reviewed public key are placeholders until the signing resources exist; the job refuses to start, and the signing code refuses to call Cosign, until they are filled in. The build script now includes handoff.json in SHA256SUMS so its build mode and source are attested. The release workflow signs only prod, so Dev is never signed twice. The approval branch script accepts an earlier build commit approved from a newer master checkout. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…file The PR EIF rootfs check compared SHA256SUMS with the old two-file format, so every candidate built with the attested handoff would fail it. It now requires the build script's exact three-file output and the handoff's exact fields. Its tests, the release statement tests and the approval branch tests now take their artifacts from the real build script rather than hand-built copies, and the legacy signer's checksum command is run against that output. The release bundle profile now requires integratedTime to be absent rather than accepting a present zero, and requires every log entry, inclusion proof, checkpoint, envelope, signature and timestamp object to carry exactly the fields Cosign writes. The Dev workflow uses one environment-scoped BWS token, OPENSECRET_PCR_SIGNING_BWS_ACCESS_TOKEN, for both the legacy key and the Dev publisher credential. The docs list every secret, variable and committed value the workflow needs, and say the 90-day workflow artifact is not durable rollback retention. Co-Authored-By: Claude Opus 5.5 <[email protected]>
check_bundle_profile ran five separate contracts in one function. It now reads as the profile's outline and calls one helper per section: the DSSE envelope, the log entry, its inclusion proof and checkpoint, the logged hashedrekord body and the RFC 3161 timestamp. Every check keeps its message and its place in the order, so the first failing check is the same for any bundle. The unused services argument is gone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
prepare, sign and publish each did several jobs inline. The artifact download, the KMS signing step (OIDC token file, signer-only environment, key comparison, attest-blob) and the public readback retry are now named helpers, called at the same points. Size limits carry a _BYTES unit and the bare 97, 4096 and 4 have names; the Cosign URL uses COSIGN_VERSION. target() becomes target_for() so the looked-up target can be called target, and publish loses its sleep argument, which only duplicated the READBACK_DELAY seam the tests already patch. Outputs, receipts, summaries, tool calls and every error message are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each bundle mutation now sits under its name, grouped by the profile section it breaks, instead of 38 underscore functions and a dense table. make_bundle names its fake signature, checkpoint and timestamp bytes and lays the bundle out one level per line; the bundles it builds are byte-identical to before. The workspace fixture is a context manager whose patches end with it, so a table case gets a fresh workspace without stacking patches on the previous one. Its fakes are plain scripts with their paths injected. The build script's real output and a forged artifact are separate helpers: a positive case no longer falls back to a hand-made artifact when the build script fails. Tests that checked several scenarios in sequence are split, so 28 tests become 44. No assertion or case is dropped; the real Cosign bundle is now also checked against the other-signer-key mutation, which it rejects. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The rootfs consumer test ran four scenarios in one method, resetting files between them with local closures. It is now four tests: the build script's output passes, a handoff changed after the build fails the checksums, a re-hashed wrong handoff fails its content checks (one subtest per change, as before) and the old two-entry SHA256SUMS fails. release_build_candidate takes its mode, source commit, image and PCR bytes by keyword, so call sites say which is which, and writes its fake uname and nix one statement per line like the neighboring fixtures. The scripts it writes are byte-identical. Co-Authored-By: Claude Opus 5.5 <[email protected]>
One method checked the dispatch surface and fixed target, the order of the job's steps, and which step each credential reaches. These are now three contract tests, and the step lookups are named one per line instead of unpacked from a generator. The assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Say up front that only Dev statements exist so far, label the JSON example as the predicate rather than the whole statement, and state the client checks as requirements instead of describing them as shipped behavior. The already-approved-measurements case, the profile's failure sentence and the retention note each appeared twice; they now appear once, under publication and reruns. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reviewed-key check said the key must be committed, but it only checked that the resolved path was a file inside the repository, and resolving first let a repository-local symlink through. It now requires that the checked-out commit tracks a file at the configured path, that the working tree holds exactly that content, and that no component of the path is a symlink. The containment and P-384 checks are unchanged, and the check still runs in preflight, sign and publish before any credential is requested. A missing key, the workflow's placeholder case, is refused with the same message as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Several checks read nested values with .get before knowing they were objects, so a boolean log entry, a list where a provenance statement or logged hashedrekord part belongs, or a non-object artifact page stopped the job with an AttributeError traceback instead of the script's error line. json_object now checks each such value where it is first read and refuses anything that is neither an object nor empty, keeping the old reading of absent and empty values. Artifact pages, listed artifacts and artifact sizes get the same treatment. Every input that was accepted, or refused with an evidence error, gets the same result and message as before; only inputs that used to crash now fail with an evidence error. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The handoff check compares against the selected build commit, which can be older than the checkout, so its error now says so. Approving from a newer checkout adds the checkout commit to the branch name, so the header, the push comment and the step summary now say the branch is shared by approvals of the same build from the same checkout. Wording only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The committed-key check ran git with the job's environment, so an inherited GIT_DIR, GIT_WORK_TREE or GIT_COMMON_DIR could make another repository's HEAD vouch for an untracked or edited key. Git now runs without any inherited GIT_* variable and must report ROOT itself as the top of the repository it found, which still holds for a linked worktree. A missing git binary, a directory without its own checkout, an unborn HEAD and an unreadable blob are refused with an evidence error before any credential is requested. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A SLSA statement whose subject list was true or a number, or whose subject name or SHA-256 digest was a list or object, still stopped the job with a TypeError. These now fail with an evidence error naming the part. Shapes that never crashed keep their old reading: a string or object in place of the list, entries without a digest object, and non-string scalar names cover nothing and the result is skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The OIDC token response was read with .get before checking its type, so a list, string, number or boolean stopped the job with an AttributeError. It is now read through json_object: an empty value still means no token, and any other non-object is refused with an evidence error. Tests serve each shape from a local token endpoint. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The inherited-variable tests covered only GIT_DIR, GIT_WORK_TREE and GIT_COMMON_DIR, so scrubbing just those three passed. They now also set GIT_OBJECT_DIRECTORY to another repository's objects and pass unparseable GIT_CONFIG_COUNT and GIT_CONFIG_PARAMETERS values, any of which would make git fail if it reached it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
json_object reads an absent or empty value as an empty object, so a
provenance result holding 0, false, "", [] or {} where an object belongs
is skipped and a valid result beside it still counts. No test held that
for values other than null, and a stricter check would have rejected
inputs that have always been accepted.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
No test failed without the size check on the reviewed key file. The new test commits a key file over the limit that is still one valid PEM key, so only that check can refuse it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Dev signing resources now exist in the dedicated signing account (signing-ops, applied 2026-11-18), so the placeholders can go. - SIGNING_KEY_ARN and SIGNER_ROLE_ARN are the applied Dev key and role. - dev-signing-key.pem is that key's public half as exported from KMS, SPKI DER SHA-256 d5bd5386930a63f926424148b83220a5f44141b7e05571d7468360c531c86c43. The pcr-signing-dev environment now holds its secret and five variables. Co-Authored-By: Claude <[email protected]>
|
The Dev signing resources exist now, so I filled in the placeholders in f94dfdc: the key and role ARNs in the workflow, and Done
Back with you
Notes, none blocking
|
… role trust note Show the build run ID in the run name so the reviewer approving the signing job can see which build it is for. The setup doc said the signer role trusts only the environment subject; it also pins the master ref and this workflow file. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Thanks for filling in the values and checking the fetch script. Marked ready. Pushed one small commit for your notes 2 and 5: the run name now shows the build run ID, and the setup doc says the role also pins the Notes 1, 3 and 4 I've taken as follow-up work for signing the builds that are already running, not for this PR. For the first run I'll kick off a fresh Dev build from |
AnthonyRonning
left a comment
There was a problem hiding this comment.
Reviewed through 427c374. The Dev key, signer role and public key match what is applied in the signing account, and the merged result passes the CI-script tests and the signing preflight on current master.
What this adds
A dedicated, reviewer-gated workflow that signs a Dev enclave release statement with a KMS key through Cosign and publishes the resulting Sigstore bundle. The Dev signing key, signer role and reviewed public key are filled in, and the
pcr-signing-devenvironment has its secret and variables. It has not run yet: it can only run frommasterafter this merges.opensecret-release-statement-dev.yml: one job in thepcr-signing-devenvironment, started with a build run ID as its only input. The environment, key, bucket and hostname are fixed in the workflow.master, successful, with its commit inmasterhistory; the artifact belongs to that run; GitHub's build attestation coversimage.eif,pcr.jsonandhandoff.json; and the handoff saysdevand agrees with the EIF digest and measurements.https://maple.ai/attestations/enclave-release/v1, with the EIF SHA-256 as subject and the environment, source, PCR0/1/2 and build run in the predicate.<PCR0>.json, then re-fetch through the public hostname, compare bytes and verify again.services/opensecret/docs/release-statements.mddocuments the mechanism and the environment configuration it needs.A change to existing builds
build_opensecret_eif.shnow includeshandoff.jsoninSHA256SUMS, so the build attestation covers the build mode.verify_opensecret_eif_rootfs.pyis updated to expect three entries, and a test runs the real build script's output through every reader of that file in this repository, for Dev and Production.Before merge
SHA256SUMS: it checks every listed file (read in its source, not run).Before the first run
pcr-signing-devhas the secret and variables listed in the new doc.mastermade after this merges: earlier builds have a two-entrySHA256SUMSand are refused.Tested
just lane repoand the CI script tests pass (606 tests).🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.