Repository navigation
feat(release): ship SBOM, build provenance and digests, and pin every action to a commit SHA - #838
Conversation
… action to a commit SHA Every release now carries sbom.cdx.json (CycloneDX), build-info.json (source commit, workflow run, runner, Python, exact build-tool versions, package digests) and SHA256SUMS next to the wheel and sdist, with GitHub build-provenance attestations for every file and an SBOM attestation for each package. A verify job gates publishing: scripts/release_evidence.py fails on a missing, unlisted or mismatched file, an SBOM that does not describe the built version, or build info for another commit, and gh attestation verify fails on a missing or foreign attestation. The release files are attached to the GitHub release. The release build installs a hashed lock (.github/release/requirements.txt) and builds with --no-isolation, so the lock is the complete set of build inputs; Dependabot watches it. workflow_dispatch gives a dry run that builds, attests and verifies without publishing. PyPI trusted publishing stays OIDC-only. Every uses: is pinned to a full commit SHA with a version comment, enforced by a pytest lint; Dependabot's existing github-actions entry moves both. actionlint runs as a pinned pre-commit hook with a lint.yml mirror. SECURITY.md documents the consumer verification commands. Closes #518
…alls unhashed deps - Drop --output-reproducible so cyclonedx-py emits the serialNumber that actions/attest requires; the gate now rejects an SBOM without a urn:uuid serialNumber, and the fixture is a fresh real capture carrying one. - Move both attestations into an attest job holding the signing permissions; the build job, which installs the wheel's dependencies from PyPI for the SBOM, keeps contents: read only. - Upload one release-files artifact; publish takes the verified wheel and sdist from it. Drop the unused artifact-metadata permission. - SECURITY.md: pin --source-ref to the release tag, attestation subjects are the files SHA256SUMS lists, the SBOM is one Linux/CPython 3.13 resolution. - release_evidence.py: null nested sections give a named error, not a traceback. - Tests: pin-lint reject cases carry a valid version comment and the other-package case keeps the real version, so each fails on the rule it names.
…n only after the gate The build job now builds from the hashed lock, records build-info.json (the package digests) and uploads a packages artifact without ever installing anything unhashed. A separate sbom job with contents: read installs the wheel into a throwaway venv and uploads only sbom.cdx.json. The attest job assembles the build job's packages with the SBOM, writes SHA256SUMS (new `sums` subcommand, split out of `record`), runs release_evidence.py verify before either attestation is signed, then uploads release-files; the verify job keeps gh attestation verify before publish. The SBOM serialNumber check is now a presence check (non-empty string), matching actions/attest. SECURITY.md's SBOM verify command gains --signer-workflow and --deny-self-hosted-runners.
…nly the SBOM from the sbom job The build job publishes the SHA-256 of build-info.json as a job output and the attest job checks the downloaded file against it before writing the sums, so a re-uploaded packages artifact cannot bring its own build-info. The sbom artifact is downloaded into its own directory and only sbom.cdx.json is copied into dist/. verify rejects any file outside the fixed release set. SECURITY.md states that the SBOM comes from an unhashed install and is not a tamper-proof inventory.
…before publishing The attest job publishes the SHA-256 of SHA256SUMS as a job output; publish and release-assets check SHA256SUMS against it, check every file against SHA256SUMS and fail on any file it does not list, so a release-files artifact replaced after attest never reaches PyPI or the release. Digest outputs are computed into a variable under pipefail and fail the step when empty.
The SBOM job installed the wheel's dependencies from PyPI without hashes. It now checks build-info.json against the build job's digest, installs .github/release/runtime-requirements.txt (uv pip compile of pyproject.toml, Linux / CPython 3.13) and the wheel with --require-hashes --no-deps, runs pip check, then cyclonedx-py. tests/test_release_runtime_lock.py fails when a pyproject.toml dependency is no longer satisfied by its pin in the lock.
…untime lock in CI Install both hashed release locks with --only-binary :all:, so a pin without a Linux cp313 wheel fails instead of building an sdist with an unhashed build backend. A lint.yml job installs the runtime lock and the built wheel with --no-deps on the release platform and runs pip check, catching a broken transitive constraint before a tag. SECURITY.md notes the SBOM is an inventory of the locked set, not a malware check.
…lease check it flags The actionlint hook env had no shellcheck, so local runs skipped the shellcheck integration that CI (ubuntu-latest) applies, and SC2015 in release-please.yml passed locally but failed CI. The hook now carries the same shellcheck-py pin as the shellcheck hook, and the release PR number check is an explicit if/then. Also replace the SECURITY.md verification example's VERSION=0.73.0, which predates the release evidence files, with a placeholder.
Merge-readiness evidence, head
|
| # | behaviour | observed | met |
|---|---|---|---|
| 1 | every action pinned to a full SHA with a version comment | 58 uses: lines, 8 action@tag pairs, each SHA equals its tag (annotated tag peeled); checker flags 41 unpinned lines on main |
yes |
| 2 | Dependabot updates the pins | github-actions at / plus pip at /.github/release |
yes (regeneration of the runtime lock only observable after merge) |
| 3 | validated SBOM for wheel+sdist from hashed locks | release.yml step scripts run verbatim: hashed build, hashed SBOM install, pip check clean, CycloneDX 1.6 with serialNumber, 29 components = the runtime lock for Linux/CPython 3.13, schema VALID; tampered wheel fails the hash install |
yes |
| 4 | evidence identifies commit, workflow, runner, Python, build tools, digests | build-info.json: source commit/ref, workflow, runner, Python 3.13.13, 40 build packages, both digests; SHA256SUMS agrees | yes |
| 5 | verification fails on missing/mismatched evidence | verify gate rejects tampered wheel, extra file, missing SBOM, no serialNumber, wrong commit, edited build-info; publish/release-assets checks reject tampered wheel, re-summed SHA256SUMS, extra/hidden files, missing SBOM | yes |
| 6 | PyPI publishing OIDC-only, gated on verify | needs: [attest, verify], tag push only, id-token: write only, no password/token input |
yes |
| 7 | SECURITY.md commands run as written | sha256sum --check, shasum -a 256 --check, release_evidence.py verify pass on a release-shaped set and fail on a tampered wheel; gh attestation verify needs a real attested release |
yes (attestation step: row 9) |
| 8 | existing release, install-smoke, dependency-audit workflows green | CI on this head: install-smoke, pip-audit, tests all green | yes (release workflow: row 9) |
| 9 | live release run (attest, gh attestation verify, PyPI publish, release upload) |
not runnable before merge: main's release.yml has no workflow_dispatch |
deferred to a dry run after merge (your call) |
Platform caveat: the step scripts ran on macOS with a GNU-sha256sum shim; every pin's Linux cp313 wheel was proven with pip download --only-binary ':all:'.
Acceptance criteria (#518): 1-7 met. 8: install-smoke and dependency-audit green; the release workflow itself is proven only by the first dry run after merge.
Your call: the new actionlint and runtime-lock jobs are not required checks in the Protect-main ruleset.
Review threads: 0.
🤖 I have created a release *beep* *boop* --- ## [0.74.0](v0.73.1...v0.74.0) (2026-10-04) ### Features * **installer:** save the MCP tool profile once for every launch path ([#836](#836)) ([b9215a8](b9215a8)) * **release:** ship SBOM, build provenance and digests, and pin every action to a commit SHA ([#838](#838)) ([df310e6](df310e6)) ### Miscellaneous Chores * **evals:** grade a judge reply only when its verdict is unambiguous, retry once, and keep the reply ([#839](#839)) ([237ea59](237ea59)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <release-please[bot]@users.noreply.github.com>
Summary
Every release can now be traced to reviewed source, immutable workflow dependencies, declared build inputs, an SBOM, artifact digests and signed build provenance, and publishing is gated on all of it. Every GitHub Action in every workflow is pinned to a full commit SHA with a version comment.
Related issue
Closes #518
Changes
uses:is@<40-hex SHA> # vX.Y.Z, each SHA verified against its tag and in the same major as before.tests/test_workflow_expression_lint.py::test_actions_pinned_to_commit_sharejects tags, branches and short SHAs. Dependabot's existinggithub-actionsentry moves SHA and comment together.actionlintas a pinned pre-commit hook (actionlint-py, with the pinnedshellcheck-pybundled in the hook env so local and CI run the same shellcheck) plus alint.ymljob running the same hook.release-please.yml's release-PR number check is rewritten as an explicitif(SC2015)..github/workflows/release.yml), job by job:build(contents: read): installs build tools from the hashed lock.github/release/requirements.txt(--require-hashes --only-binary ':all:'), builds wheel and sdist with--no-isolation, recordsbuild-info.json(source commit/ref, workflow run, runner, Python, every build-tool version, package digests) and exposes its SHA-256 as a job output.sbom(contents: read): checks the packages against that output, installs the wheel by its recorded digest plus the committed hashed runtime lock.github/release/runtime-requirements.txt(--require-hashes --no-deps --only-binary ':all:'), runspip check, generates a CycloneDX SBOM, and uploads onlysbom.cdx.json.attest(id-token, attestations: write): re-checksbuild-info.jsonagainst the build job's output, takes onlysbom.cdx.jsonfrom the sbom artifact, writesSHA256SUMS, runsscripts/release_evidence.py verify --commit(exact allowed file set, digests, SBOM, build info), and only then attests build provenance for every listed file and the SBOM; exposes the SHA-256 ofSHA256SUMS.verify(attestations: read):gh attestation verifyon every file, pinned to this signer workflow, source digest and ref, self-hosted runners denied.publish(OIDC trusted publishing only, no token) andrelease-assets: tag push only; each re-checks the downloaded files against the attest job'sSHA256SUMSdigest before uploading.workflow_dispatchdry run builds, attests and verifies without publishing.scripts/release_evidence.py:record/sums/verify; tests intests/test_release_evidence.pyuse a real cyclonedx-py capture and cover missing, extra, tampered and malformed evidence..github/release/runtime-requirements.txt(generated by the command in its header);tests/test_release_runtime_lock.pyfails if a directpyproject.tomlrequirement is no longer satisfied by its pin; a newruntime-lockjob inlint.ymlinstalls the lock plus the built wheel and runspip checkon every PR (catches transitive breaks)..github/SECURITY.md"Verifying a release" (download,sha256sum --check,release_evidence.py verify,gh attestation verifypinned to the release tag, signer workflow and GitHub-hosted runners) anddocs/DEVELOPMENT.md"Release supply chain".Drift from the issue text (recorded on #518): Dependabot already covered
github-actions, so the AC is met by the pins themselves; PyPI already receives PEP 740 attestations frompypa/gh-action-pypi-publish, so the gap was GitHub-side provenance + SBOM + a pre-publish gate; first-partyactions/*are pinned too; the wheel reproduces byte for byte locally, the sdist does not.How it was verified
e831505a): all 30 checks green, including actionlint (now with pinned shellcheck), the runtime-lock job, install-smoke, pip-audit and the pytest matrix; mutation gate run 37202314459 green (0 survivors).test_workflow_expression_lint.py,test_release_evidence.py,test_release_runtime_lock.pygreen; pre-push full suite green at 100% coverage.pip checkclean, 29 components, passes actions/attest'sbomFormat && serialNumber && specVersionrule), record, sums, verify. Attack simulations, each rejected: a tampered wheel in the SBOM job's packages (hash mismatch), a poisoned sbom artifact carrying a replacement wheel and matchingbuild-info.jsonplus an extra file (ignored; signed bytes are the build job's), a re-uploadedpackagesartifact (build-info anchor mismatch), extra/hidden/nested files and a rewrittenSHA256SUMSat publish (rejected). The newruntime-lockjob's commands fail on a lock missing a transitive dependency.pip download --only-binary ':all:' --platform manylinux2014_x86_64 --python-version 3.13succeeds for every pin in both locks./code-reviewhigh on the whole diff, then on each fix delta (7 rounds). Fixed along the way: an SBOM attest would have rejected (missingserialNumber, release-blocking), branch dry runs passing documented verification (now pinned to the release tag), unhashed installs and unverified artifacts on the signing path, verify running after signing, publish uploading unverified bytes, an actionlint hook that depended on whatever shellcheck was on PATH, and doc overclaims.Only a real run can confirm (first
workflow_dispatchdry run after merge, or the next tag): the attest steps andgh attestation verifyagainst real attestations, PyPI trusted publishing withneeds: verify,gh release uploadonto the release-please release, and the hashed installs on the ubuntu runner. Main'srelease.ymlhas noworkflow_dispatch, so the branch version cannot be dry-run before merge. A dry run mints real attestations for a non-tag build; the documented verify commands reject them because they pin the tag ref.Your call before relying on it: the new
runtime-lockandactionlintjobs are not required checks in the Protect-main ruleset, so a red run would not block a merge.Not changed, noted for later: the publish and release-assets digest check is duplicated bash rather than a shared
release_evidence.pysubcommand; a removed dependency would leave stale pins in the runtime lock until it is regenerated; whether Dependabot regenerates the runtime lock or bumps pins individually is unproven (theruntime-lockjob catches a bad bump).Checklist
pytest) and lint/type checks are green (pre-commit run --all-files,python -m mypy)