Repository navigation
ci: require a DCO sign-off, scope Pages grants, keep the crates.io token off argv - #732
Merged
Merged
Conversation
scripts/check_dco.sh reads the non-merge commits in BASE..HEAD and fails any that lacks a Signed-off-by trailer, as git parses trailers, whose address matches the commit author's. Dependabot authors as its noreply address and signs off as support@github.com; the script accepts that one pairing. A range it cannot resolve, or one holding nothing but merges, is refused rather than passed. On failure it prints the fetch-by-URL and `git rebase --signoff` commands, which work from a fork whatever its remotes are called. The new `dco` job in ci.yml runs it over each pull request with full history; the main ruleset will require it once this lands. tests/release/dco.test.sh builds throwaway repositories for each case, and eight mutants of the script (tip-only, regex instead of the trailer parser, case-sensitive match, no empty-range guard, the bot address for anyone, merges counted, unsigned exiting 0, no ref guard) each fail it. CONTRIBUTING.md, docs/contributing/CONTRIBUTING.md, the developer guide and the PR template now say a sign-off is required. The developer guide also names the seven required checks instead of an out-of-date count. docs.yml grants pages: write and id-token: write to the deploy job only, the minimum actions/deploy-pages documents; the build job keeps contents: read. Signed-off-by: Vladimir Rotariu <sysknife-development@protonmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
release.yml ran `cargo publish --token "$CARGO_REGISTRY_TOKEN"`, which put
the token in the process's argv, readable through /proc by every process
on the runner. cargo reads CARGO_REGISTRY_TOKEN from the environment, and
the step already exports it, so the flag goes.
tests/release/secret-argv.test.sh parses each workflow, collects the env
variables whose value names `secrets.` at workflow, job and step level,
and fails when a `run:` script expands one outside a `test -n` presence
check, or writes `${{ secrets.* }}` into the script itself. It failed on
the old release.yml. Five mutants of the scanner each fail its fixtures;
a sixth showed an unreachable empty-directory guard, which is removed.
Signed-off-by: Vladimir Rotariu <sysknife-development@protonmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 29, 2026
Open
This was referenced Oct 29, 2026
Open
This was referenced Oct 29, 2026
Open
Open
Open
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.
Summary
Three CI changes from the OpenSSF review, in two commits.
A required DCO sign-off (#713).
scripts/check_dco.sh BASE HEADreads the non-merge commits in the range and fails any without aSigned-off-bytrailer, as git parses trailers, whose address matches the commit author's. It accepts Dependabot's one pairing (it authors as its noreply address and signs off assupport@github.com) and no other. An empty, unresolvable or merge-only range gets refused with "nothing was checked". On failure it prints the commands that sign off pushed commits; they fetchmainby URL, so they work from a fork whatever its remotes are called. A newdcojob runs it on every pull request with full history.CONTRIBUTING.md,docs/contributing/CONTRIBUTING.md, the developer guide and the PR template now say a sign-off is required. The developer guide also names the seven required checks in place of a stale "five".Pages and OIDC grants scoped to the deploy job (#714).
docs.ymlgrantedpages: writeandid-token: writeto the whole workflow. The build job now holdscontents: read;deploygets the two grants theactions/deploy-pagesREADME lists as its minimum.The crates.io token off the command line (#715).
release.ymlrancargo publish --token "$CARGO_REGISTRY_TOKEN". cargo reads that variable from the environment, so the flag only put the token in argv.tests/release/secret-argv.test.shnow fails any workflow that expands a secret-fed variable outside atest -n "${NAME:-}"check, or pastes${{ secrets.* }}into a script.Related Issue
Closes #713, closes #714, closes #715. Part of #731.
Validation
Tests added or updated
Documentation updated if behavior changed
Security impact considered
Trust boundary preserved (daemon remains the only privileged executor)
CI passes
Every commit is signed off (
git commit -s, see CONTRIBUTING.md)tests/release/dco.test.shbuilds throwaway repositories for each case. I ran it against a stub that passes everything first (11 cases failed), then against eight mutants of the script, and each one failed it: tip-only, a regex in place of git's trailer parser, case-sensitive matching, no empty-range guard, the bot address accepted for anyone, merges counted, unsigned exiting 0, no ref guard.tests/release/secret-argv.test.shfailed on the oldrelease.yml. Five mutants of its scanner each fail the fixtures. A sixth showed the empty-directory branch could not be reached, so I removed it.scripts/check_dco.shagainst real ranges: this branch passes (2 commits), build: honour DESTDIR in make install and ship LICENSE in every package #710 passes, and five of the six open contributor pull requests (test(e2e): smoke-test multiple VM daemons over SSH tunnels #709, fix: reject wrong-typed optional action params #701, fix(release): gate tags on main CI #700, fix: preserve active swap files when swapoff fails #698, fix(brain): align AptAutoremove prose with daemon risk #695) fail on unsigned commits.check_test_reachability.shfails when the newdco.test.shstep is removed fromci.yml, so the gate sees it.Pre-commit gate (fmt, clippy
--all-targets, doc, nextest against the baseline) andscripts/ci-local.sh --fastpass.Notes for Reviewers
Once this merges I add
dcoto the main ruleset's required checks and tell the five authors above how to sign off their commits. Thedocs.ymlchange gets its real test on the first docs deploy frommain, which this merge triggers because the workflow file is in its ownpathsfilter.🤖 Generated with Claude Code