Skip to content

Sign and publish Dev enclave release statements - #1636

Draft
w3irdrobot wants to merge 8 commits into
masterfrom
codex-sigdev-maple
Draft

w3irdrobot wants to merge 8 commits into
masterfrom
codex-sigdev-maple

Conversation

@w3irdrobot

@w3irdrobot w3irdrobot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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. It is not runnable yet: the signing key and role do not exist, so their identifiers are placeholders that stop the job before any credential is requested. Draft until the items under "Before merge" are done.

  • opensecret-release-statement-dev.yml: one job in the pcr-signing-dev environment, started with a build run ID as its only input. The environment, key, bucket and hostname are fixed in the workflow.
  • Build-run checks before signing: the run is the EIF release workflow, dispatched on master, successful, with its commit in master history; the artifact belongs to that run; GitHub's build attestation covers image.eif, pcr.json and handoff.json; and the handoff says dev and agrees with the EIF digest and measurements.
  • Statement: in-toto, predicate type 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.
  • Evidence gate before publishing: a v0.3 bundle with exactly one Rekor v2 entry (inclusion proof and checkpoint), exactly one RFC 3161 timestamp, and no integration time or inclusion promise. Cosign is pinned to v3.1.4 with an explicit signing configuration; earlier releases cannot verify P-384 signatures.
  • Publication: upload to the Dev bucket as <PCR0>.json, then re-fetch through the public hostname, compare bytes and verify again.
  • Legacy signature: the same job produces the existing Dev PCR0 signature, so one approval covers both. The existing release workflow keeps signing Production and no longer signs Dev.

services/opensecret/docs/release-statements.md documents the mechanism and the environment configuration it needs.

A change to existing builds

build_opensecret_eif.sh now includes handoff.json in SHA256SUMS, so the build attestation covers the build mode. verify_opensecret_eif_rootfs.py is 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

  • The ARM64 EIF candidate lane passes on this PR. It cannot run locally.
  • Confirm the deployment tooling's EIF fetch accepts a three-entry SHA256SUMS. It lives outside this repository and has not been checked.

Before the first run

  • Replace the key ARN, role ARN and reviewed public key placeholders once the signing resources exist.
  • Create the pcr-signing-dev environment with the secret and variables listed in the new doc.

Tested

  • just lane repo and the CI script tests pass (606 tests).
  • The bundle profile gate was run against a real Cosign v3.1.4 Rekor v2 bundle and against mutated copies, and the pinned Cosign verifies that bundle.
  • Not tested: anything against a real key, bucket or GitHub environment. The workflow artifact that keeps the original bundle with the EIF is retained for 90 days, which is not long-term rollback retention.

🤖 Generated with Claude Code


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

w3irdrobot and others added 2 commits November 17, 2026 22:33
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 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
@w3irdrobot w3irdrobot added the ci:eif Run the OpenSecret EIF PR candidate build label Nov 18, 2026
w3irdrobot and others added 6 commits November 18, 2026 15:27
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <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

ci:eif Run the OpenSecret EIF PR candidate build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant