Skip to content

Sign and publish Dev enclave release statements - #1636

Merged
AnthonyRonning merged 20 commits into
masterfrom
codex-sigdev-maple
Nov 19, 2026
Merged

AnthonyRonning merged 20 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. The Dev signing key, signer role and reviewed public key are filled in, and the pcr-signing-dev environment has its secret and variables. It has not run yet: it can only run from master after this merges.

  • 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.
  • The deployment tooling's EIF fetch accepts a three-entry SHA256SUMS: it checks every listed file (read in its source, not run).

Before the first run

  • Key ARN, role ARN and reviewed public key filled in.
  • pcr-signing-dev has the secret and variables listed in the new doc.
  • The first run needs a fresh Dev build from master made after this merges: earlier builds have a two-entry SHA256SUMS and are refused.

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 <[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]>
@w3irdrobot w3irdrobot added the ci:eif Run the OpenSecret EIF PR candidate build label Nov 18, 2026
w3irdrobot and others added 17 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 <[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]>
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]>
@AnthonyRonning

Copy link
Copy Markdown
Contributor

The Dev signing resources exist now, so I filled in the placeholders in f94dfdc: the key and role ARNs in the workflow, and dev-signing-key.pem (SPKI SHA-256 d5bd5386930a63f926424148b83220a5f44141b7e05571d7468360c531c86c43). Pull before you push again.

Done

  • preflight dev passes with the real values, and the CI-script tests pass (656, 5 skipped).
  • pcr-signing-dev has its secret and five variables, so both "before the first run" items are covered.
  • The Dev publisher credential is scoped to maple-attestations-dev. A test upload using this script's put-object flags read back from attestations-dev.maple.ai with the expected content type, cache policy and CORS header, and was then deleted. Other buckets refused the credential.
  • Three-entry SHA256SUMS and the deployment tooling: its EIF fetch script is the only reader there. It downloads the whole artifact and checks every listed file, so three entries pass. Read on its current master, not run.

Back with you

  • CI on f94dfdc, including the ARM64 EIF lane.
  • Mark it ready when you are done and I will review and merge. I approve the first run.

Notes, none blocking

  1. Once merged, this workflow is the only CI route for Dev approvals, and it cannot run before the merge. It also refuses builds made before this PR, because their SHA256SUMS has two entries. So the first run needs a fresh Dev build from master straight after the merge.
  2. The approval screen shows no build run ID, commit or PCR0. A run-name built from inputs.build_run_id would show which build is being approved.
  3. Signing an older build from newer master copies that build's pcr.json over pcrDev.json (ci_sign_pcr.sh:37) and pushes a review branch that sets the snapshot back. Read in the source, not run.
  4. For the reason in 1, the EIFs running today cannot get statements from this workflow.
  5. release-statements.md says the signer role trusts only the environment subject. The role also pins ref and job_workflow_ref.

… 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]>
@w3irdrobot
w3irdrobot marked this pull request as ready for review November 19, 2026 03:43
@w3irdrobot

Copy link
Copy Markdown
Contributor Author

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 master ref and this workflow file. I updated the checklist in the description too.

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 master right after you merge and send you the run ID.

@AnthonyRonning AnthonyRonning left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@AnthonyRonning
AnthonyRonning merged commit bcf6e84 into master Nov 19, 2026
22 checks passed
@AnthonyRonning
AnthonyRonning deleted the codex-sigdev-maple branch November 19, 2026 22:47
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.

2 participants