Repository navigation
trust: signed ci tags, a release gate for who may cut, signed release cuts (#4031) - #4059
Merged
Merged
Conversation
… signed release cuts (#4031) A ci tag on a commit committed at or after ci.green.signedSince counts only when its annotation carries an in-toto statement in a DSSE envelope, signed by a runner key .chant/trust.json lists under runners for a principal holding the runner role. An older commit's tag counts unsigned, and without signedSince every tag counts as before. ci tick signs what it makes from --key or CHANT_RUNNER_KEY and refuses a key the policy does not list; ci tick, ci list, ci last-green and release cut ignore and report a tag without a valid statement. ci last-green gains --from, which release-preflight.sh uses once signedSince is set. ci workflow --runner-key-secret passes the key from a repository secret. identity.gates.release says who may cut: release cut then needs --sign by an actor in its class. A cut's signature is an ssh signature in the chant-release namespace over the digest, label, actor and time; release list and workspace status verify it on every read (signatureCheck, releaseCuts).
A commit's committer time is set by whoever makes it, so a backdated commit with a hand-pushed unsigned tag passed the time cutover. signedSince is now the full sha of the first commit whose tags must be signed: a tag counts unsigned only on a strict first-parent ancestor of it, and any other tag needs a runner statement. A sha that names no commit in the clone is refused with declaration-invalid by ci list, ci last-green, ci tick and release cut. The time form is dropped; nothing shipped it.
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.
Closes #4031
Green and revoked tags can be required to carry a statement signed by a runner key, who may cut a release is a gate in the declaration, and release cuts are signed and verified on every read. All of it is opt-in: a workspace that sets nothing keeps today's behaviour. chant's own
chant.workspace.json,.chant/and workflows are unchanged here; turning it on for chant is #4040 (steps posted there).ci.green.signedSincenames the full sha of the first commit on the branch whose tags must be signed. A tag on a strict first-parent ancestor of it counts unsigned, so existing tags keep working. Every other tag, including one on thesignedSincecommit, needs a statement. Position in history decides rather than a date, because whoever makes a commit or tag sets its time; a backdated commit outside the ancestry gains nothing (tested). A sha that names no commit isdeclaration-invalid. A chant older than 0.124.28 refuses a declaration withsignedSince, so the docs say to setminReaderwith it.https://intentius.io/chant/ci-tag/v1), reusing the ws-069/ws-090 envelope. It counts only when signed by a key underrunnersin.chant/trust.jsonat base, whose principal holds therunnerrole, and when its subject, record, branch and kind match the tag and the annotation equals what was signed. Otherwise the tag is ignored asunsigned,invalid,untrustedormismatch, and reported.ci tick,ci list,ci last-green(which gains--from <rev>) andrelease cutignore and report bad tags. The tick signs the tags it makes with--keyorCHANT_RUNNER_KEY, refuses a key or principal not trusted as a runner, and names a hand-pushed tag that blocks it, since chant never deletes tags.chant ci workflow --runner-key-secret <NAME>passes the repository secret to the tick asCHANT_RUNNER_KEY; the docs say the key's principal needs therunnerrole.identity.gates.releaseentry makesrelease cutrequire--sign [<key file>]and an actor in the gate's class (release-unsigned,release-signer-refused). The cut line'ssignatureis an ssh signature in thechant-releasenamespace over the release digest, label, actor and time, checked against.chant/allowed_signersat base.release listandworkspace statusverify it on every read (signatureCheck: verified, unsigned or unverified). The cut readssignedSinceand the release gate from the branch tip, so a local edit can't switch them off.Level-0 output changes
On the exceptions page and #2525: help text for
ci last-green,ci tick,ci workflowandrelease cut; new flags--runner-key-secret,--key,--from,--sign;ci list --jsoncommits gainignoredandsigner;ci last-green --jsongainsignored;release list --jsoncuts gainsignatureCheck;workspace status --jsonmembers gainreleaseCuts;lsshowssignedSincewhen set;ci ticktext addsignored,did not makeandsigned aslines when they apply. No golden moved.Acceptance
ci-green-signed.test.ts"a hand-pushed green tag is ignored and reported by ci tick, ci list and ci last-green").ci.green.signedSinceis accepted unsigned, with a test (ancestry-based: a tag on a strict ancestor counts unsigned; one onsignedSinceitself and on a backdated later commit is ignored).scripts/release-preflight.shkeeps working on chant's own repo: run in a temporary clone with a temporary bare origin and a throwaway runner key. WithoutsignedSince(chant today) the existing check passes unchanged. With it: an old unsigned tag on an ancestor passes, a signed tag passes, a hand-pushed tag is reported and refused, and with no commit named it falls back to the newest signed commit. Nothing was pushed to the real repo.releasegate's class is refused, with a test (release-cut-signed.test.ts).workspace statusverifies ("a cut by a releaser carries a signature that release list and workspace status verify").Checks
npx tsx scripts/typecheck.ts: no regressions (26 baselined)npx tsx scripts/check-lexicons.ts: no untracked tier-1 failuresGITHUB_SHA,GITHUB_RUN_IDandCIset, after rebasing on mainop/factory.e2e.test.tsfailureslint-docs-sentences(no regressions),lint-prompts,check-docs-diataxis,./scripts/build-docs.sh: pass