Repository navigation
Publish attested release binaries with provenance and SBOMs #1435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
+9,093
−57
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
b772cd3
Phase the reviewed binary attestation contract
prk-Jr be81ca8
Map binary attestation phases to review boundaries
prk-Jr ca06217
Build and attest phased release binaries
prk-Jr 4dd2171
Document binary verification and release deployment
prk-Jr 3c41de5
Align Phase 1 signing and publication with the reviewed contract
prk-Jr cb82e4b
Allow the exact GitHub Actions build type reference host
prk-Jr 41896cb
Document Phase 1 compatibility and verification boundaries
prk-Jr ca902b6
Avoid stale API connections during release verification
prk-Jr f3a8696
Clarify rehearsed release status and CLI verification
prk-Jr 922c221
Retry transient post-publication verification reads
prk-Jr ff9f9c4
Document offline verification and completed release rehearsal
prk-Jr 7c7f4b0
Add production Axum assets and release startup checks
prk-Jr b818b59
Disable rustup self-updates in temporary build homes
prk-Jr 16d6690
Expose pinned compiler binaries in the GNU builder
prk-Jr 937214a
Supply runtime trust data to Axum startup checks
prk-Jr 6824226
Record the seven-binary release rehearsal
prk-Jr e907e26
Derive immutable release build facts
prk-Jr 72b7e1e
Allow runtime Axum bind address overrides
prk-Jr 81a5a72
Harden release eligibility and artifact validation
prk-Jr 39a769c
Align release documentation and reference-host policy
prk-Jr e22d700
Reduce startup logging and align runtime port aliases
prk-Jr 2cc39ec
Harden release verification and preflight boundaries
prk-Jr 7a05940
Record rehearsal failure and release recovery checks
prk-Jr f84ab21
Record the successful binary attestation rehearsal
prk-Jr 149754d
Handle attestation availability and verify published bytes
prk-Jr f66da48
Record the successful ninth attestation rehearsal
prk-Jr a501d1b
Clarify final release verification notes (docs-only)
prk-Jr afdc928
Merge current main and clarify bind diagnostics
prk-Jr 34e7e9e
Address self-review findings in release attestations
prk-Jr ab6e549
Strengthen release build-fact and gate tests
prk-Jr 68eef90
Merge remote-tracking branch 'origin/main' into feature/binary-attest…
prk-Jr 2015231
Record the main-merge Phase 1 rehearsal
prk-Jr c9a6117
Record two independent Phase 1 spec review rounds
prk-Jr 4940928
Merge branch 'main' into feature/binary-attestations-phase1
prk-Jr 79b1188
Address attested release review feedback
prk-Jr 990509b
Merge branch 'main' into feature/binary-attestations-phase1
prk-Jr c827eb2
Address maintainer review of Phase 1 attested releases
prk-Jr 5f0139b
Merge main into feature/binary-attestations-phase1
prk-Jr 890acd2
Record Phase 1 fork rehearsal .22 at the current head
prk-Jr 029f204
Merge main into feature/binary-attestations-phase1
prk-Jr 69b74e2
Bound release-attestation availability checks by their deadline
prk-Jr ba54b27
Merge main into feature/binary-attestations-phase1
prk-Jr 54d10bb
Address second maintainer review of Phase 1 attested releases
prk-Jr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,194 @@ | ||
| name: Release build and signing | ||
| on: | ||
| workflow_call: | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| checks: | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Read pinned Node version | ||
| id: tools | ||
| run: echo "node=$(awk '$1 == "nodejs" { print $2 }' .tool-versions)" >> "$GITHUB_OUTPUT" | ||
| - uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: ${{ steps.tools.outputs.node }} | ||
| - run: node --test scripts/release/phase1.test.mjs | ||
| # Refuse a tag the publisher would reject before building and signing. | ||
| - name: Refuse non-SemVer release tags | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| env: | ||
| RELEASE_TAG: ${{ github.ref_name }} | ||
| run: | | ||
| node --input-type=module -e " | ||
| import { isReleaseTag } from './scripts/release/publish.mjs' | ||
| if (!isReleaseTag(process.env.RELEASE_TAG)) throw Error('Release tags must be vMAJOR.MINOR.PATCH[-PRERELEASE]') | ||
| " | ||
| # The publisher requires a lightweight tag at the built commit. Refuse an | ||
| # annotated tag here, before signing writes public attestations for it. | ||
| - name: Refuse annotated release tags | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| RELEASE_TAG: ${{ github.ref_name }} | ||
| run: test "$(gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$RELEASE_TAG" --jq '.object.type + " " + .object.sha')" = "commit $GITHUB_SHA" | ||
| build: | ||
| needs: checks | ||
| name: Build ${{ matrix.asset }} | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 90 | ||
| permissions: | ||
| contents: read | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-24.04 | ||
| package: trusted-server-adapter-fastly | ||
| target: wasm32-wasip1 | ||
| asset: trusted-server-fastly.wasm | ||
| - os: ubuntu-24.04 | ||
| package: trusted-server-cli | ||
| target: x86_64-unknown-linux-gnu | ||
| asset: ts-x86_64-unknown-linux-gnu | ||
| - os: macos-15 | ||
| package: trusted-server-cli | ||
| target: aarch64-apple-darwin | ||
| asset: ts-aarch64-apple-darwin | ||
| - os: macos-15-intel | ||
| package: trusted-server-cli | ||
| target: x86_64-apple-darwin | ||
| asset: ts-x86_64-apple-darwin | ||
| - os: ubuntu-24.04 | ||
| package: trusted-server-adapter-axum | ||
| target: x86_64-unknown-linux-gnu | ||
| asset: trusted-server-axum-x86_64-unknown-linux-gnu | ||
| - os: ubuntu-24.04 | ||
| package: trusted-server-adapter-axum | ||
| target: x86_64-unknown-linux-musl | ||
| asset: trusted-server-axum-x86_64-unknown-linux-musl | ||
| - os: ubuntu-24.04-arm | ||
| package: trusted-server-adapter-axum | ||
| target: aarch64-unknown-linux-gnu | ||
| asset: trusted-server-axum-aarch64-unknown-linux-gnu | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Read pinned toolchains | ||
| id: tools | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| echo "node=$(awk '$1 == "nodejs" { print $2 }' .tool-versions)" >> "$GITHUB_OUTPUT" | ||
| echo "rust=$(sed -n 's/^channel = "\([^"]*\)"/\1/p' rust-toolchain.toml)" >> "$GITHUB_OUTPUT" | ||
| - uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: ${{ steps.tools.outputs.node }} | ||
| - name: Install the pinned Rust toolchain without build caches | ||
| env: | ||
| RUST_VERSION: ${{ steps.tools.outputs.rust }} | ||
| BUILD_TARGET: ${{ matrix.target }} | ||
| run: rustup toolchain install "$RUST_VERSION" --profile minimal --target "$BUILD_TARGET" | ||
| - name: Build and generate the build inventory in a clean environment | ||
| shell: bash | ||
| env: | ||
| BUILD_PACKAGE: ${{ matrix.package }} | ||
| BUILD_TARGET: ${{ matrix.target }} | ||
| RELEASE_ASSET: ${{ matrix.asset }} | ||
| SOURCE_COMMIT: ${{ github.sha }} | ||
| RELEASE_VERSION: ${{ github.ref_name }} | ||
| run: | | ||
| set -euo pipefail | ||
| env -i PATH="$PATH" HOME="$HOME" \ | ||
| CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" \ | ||
| RUSTUP_HOME="${RUSTUP_HOME:-$HOME/.rustup}" \ | ||
| TMPDIR="${TMPDIR:-/tmp}" RUNNER_TEMP="$RUNNER_TEMP" \ | ||
| SOURCE_COMMIT="$SOURCE_COMMIT" RELEASE_VERSION="$RELEASE_VERSION" \ | ||
| bash scripts/release/phase1-build.sh "$BUILD_PACKAGE" "$BUILD_TARGET" "$RELEASE_ASSET" | ||
| # Only the tag-triggered signing job reads these; a main push is a build | ||
| # and smoke check. | ||
| - uses: actions/upload-artifact@v6 | ||
|
prk-Jr marked this conversation as resolved.
Resolved
|
||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| with: | ||
| name: release-${{ matrix.asset }} | ||
| path: release-assets/* | ||
| if-no-files-found: error | ||
| retention-days: 7 | ||
|
|
||
| sign: | ||
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && vars.RELEASE_PUBLICATION_ENABLED == 'true' | ||
| needs: build | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 15 | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| attestations: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| asset: | ||
| [ | ||
| trusted-server-axum-x86_64-unknown-linux-gnu, | ||
| trusted-server-axum-x86_64-unknown-linux-musl, | ||
| trusted-server-axum-aarch64-unknown-linux-gnu, | ||
| trusted-server-fastly.wasm, | ||
| ts-aarch64-apple-darwin, | ||
| ts-x86_64-apple-darwin, | ||
| ts-x86_64-unknown-linux-gnu, | ||
| ] | ||
| steps: | ||
| # Only fixed inline checks execute here; never checkout or execute build inputs. | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: release-${{ matrix.asset }} | ||
| path: release-assets | ||
| - name: Validate signing inputs and retain their digests | ||
| env: | ||
| ASSET: ${{ matrix.asset }} | ||
| run: | | ||
| set -euo pipefail | ||
| cd release-assets | ||
| test "$(find . -mindepth 1 -maxdepth 1 | wc -l)" -eq 2 | ||
| for file in "$ASSET" "$ASSET.spdx.json"; do test -f "$file" && test ! -L "$file" && test -s "$file" || exit 1; done | ||
| sha256sum "$ASSET" "$ASSET.spdx.json" > ../inputs.sha256 | ||
| - name: Attest SLSA build provenance | ||
| id: provenance | ||
| uses: actions/attest@v4 | ||
| with: | ||
| subject-path: | | ||
| release-assets/${{ matrix.asset }} | ||
| release-assets/${{ matrix.asset }}.spdx.json | ||
| - name: Attest the binary's SPDX SBOM | ||
| id: sbom | ||
| uses: actions/attest@v4 | ||
| with: | ||
| subject-path: release-assets/${{ matrix.asset }} | ||
| sbom-path: release-assets/${{ matrix.asset }}.spdx.json | ||
| - name: Retain only this run's real bundles and signed-input digests | ||
| env: | ||
| ASSET: ${{ matrix.asset }} | ||
| PROVENANCE: ${{ steps.provenance.outputs.bundle-path }} | ||
| SBOM: ${{ steps.sbom.outputs.bundle-path }} | ||
| run: | | ||
| set -euo pipefail | ||
| (cd release-assets && sha256sum --check ../inputs.sha256) | ||
| test -s "$PROVENANCE" | ||
| test -s "$SBOM" | ||
| mkdir signed-assets | ||
| cp "$PROVENANCE" "signed-assets/$ASSET.provenance.sigstore.json" | ||
| cp "$SBOM" "signed-assets/$ASSET.sbom.sigstore.json" | ||
| cp inputs.sha256 signed-assets/SHA256SUMS | ||
| (cd signed-assets && sha256sum "$ASSET.provenance.sigstore.json" "$ASSET.sbom.sigstore.json" >> SHA256SUMS) | ||
| - uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: signed-${{ matrix.asset }} | ||
| path: signed-assets/* | ||
| if-no-files-found: error | ||
| retention-days: 7 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| name: Binary attestations | ||
| # Pull requests run the release Node suite in format.yml. The release builds | ||
| # run on every push to main, so they need no input path list, and on tags. | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| tags: ['v*'] | ||
| permissions: | ||
| contents: read | ||
| concurrency: | ||
| group: binary-attestations-${{ github.ref }} | ||
| cancel-in-progress: false | ||
| jobs: | ||
| build: | ||
| uses: ./.github/workflows/release-build.yml | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| attestations: write | ||
| release: | ||
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && vars.RELEASE_PUBLICATION_ENABLED == 'true' | ||
| needs: build | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 15 | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: release-trusted-server-fastly.wasm | ||
| path: build/trusted-server-fastly.wasm | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: signed-trusted-server-fastly.wasm | ||
| path: signed/trusted-server-fastly.wasm | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: release-ts-aarch64-apple-darwin | ||
| path: build/ts-aarch64-apple-darwin | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: signed-ts-aarch64-apple-darwin | ||
| path: signed/ts-aarch64-apple-darwin | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: release-ts-x86_64-apple-darwin | ||
| path: build/ts-x86_64-apple-darwin | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: signed-ts-x86_64-apple-darwin | ||
| path: signed/ts-x86_64-apple-darwin | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: release-ts-x86_64-unknown-linux-gnu | ||
| path: build/ts-x86_64-unknown-linux-gnu | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: signed-ts-x86_64-unknown-linux-gnu | ||
| path: signed/ts-x86_64-unknown-linux-gnu | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: release-trusted-server-axum-x86_64-unknown-linux-gnu | ||
| path: build/trusted-server-axum-x86_64-unknown-linux-gnu | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: signed-trusted-server-axum-x86_64-unknown-linux-gnu | ||
| path: signed/trusted-server-axum-x86_64-unknown-linux-gnu | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: release-trusted-server-axum-x86_64-unknown-linux-musl | ||
| path: build/trusted-server-axum-x86_64-unknown-linux-musl | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: signed-trusted-server-axum-x86_64-unknown-linux-musl | ||
| path: signed/trusted-server-axum-x86_64-unknown-linux-musl | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: release-trusted-server-axum-aarch64-unknown-linux-gnu | ||
| path: build/trusted-server-axum-aarch64-unknown-linux-gnu | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: signed-trusted-server-axum-aarch64-unknown-linux-gnu | ||
| path: signed/trusted-server-axum-aarch64-unknown-linux-gnu | ||
| # Run only the publisher and its notes template from the tagged commit; | ||
| # never check out build inputs here. | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| path: publisher | ||
| persist-credentials: false | ||
| sparse-checkout: | | ||
| .tool-versions | ||
| scripts/release/publish.mjs | ||
| scripts/release/release-notes.md | ||
| sparse-checkout-cone-mode: false | ||
| - name: Read pinned Node version | ||
| id: tools | ||
| run: echo "node=$(awk '$1 == "nodejs" { print $2 }' publisher/.tool-versions)" >> "$GITHUB_OUTPUT" | ||
| - uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: ${{ steps.tools.outputs.node }} | ||
| - name: Install the pinned GitHub CLI | ||
| env: | ||
| GH_VERSION: 2.102.0 | ||
| GH_SHA256: bb766f710eef8ede859c18578c72c327597cd4c8a85b06001b1f3843c6019386 | ||
| run: | | ||
| set -euo pipefail | ||
| archive="gh_${GH_VERSION}_linux_amd64.tar.gz" | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://github.com/cli/cli/releases/download/v${GH_VERSION}/${archive}" \ | ||
| --output "$RUNNER_TEMP/$archive" | ||
| printf '%s %s\n' "$GH_SHA256" "$RUNNER_TEMP/$archive" | sha256sum --check | ||
| tar -xzf "$RUNNER_TEMP/$archive" -C "$RUNNER_TEMP" | ||
| echo "$RUNNER_TEMP/gh_${GH_VERSION}_linux_amd64/bin" >> "$GITHUB_PATH" | ||
| - name: Verify handoff, create once, publish by release ID and verify | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| GH_REPO: ${{ github.repository }} | ||
| RELEASE_TAG: ${{ github.ref_name }} | ||
| SOURCE_COMMIT: ${{ github.sha }} | ||
| RELEASE_PUBLICATION_ENABLED: ${{ vars.RELEASE_PUBLICATION_ENABLED }} | ||
| run: | | ||
| set -euo pipefail | ||
| test "$(gh --version | head -1 | cut -d' ' -f3)" = 2.102.0 | ||
| node --version | ||
| node publisher/scripts/release/publish.mjs |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 thinking: Two kinds of bad tag are refused only after the seven builds and signing:
checksruns onlyisReleaseTag. The lightweight-tag check lives in the publisher (publish.mjs:273-275), and the draft-create 403 from rehearsals.11and.22also happens there. By thensignhas already written provenance and SBOM attestations for the tag's binaries to the public Sigstore log. A tag that never publishes still leaves public attestations behind. The same ref check incheckscosts one API read:Checking here that
GITHUB_SHAis reachable frommainwould also turn the 403 into an early, clear failure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partly applied in
54d10bb01. Thechecksjob now runs your ref check, so an annotated tag (or one whose ref doesn't point atGITHUB_SHA) fails before any build or signing.I did not add the "reachable from
main" check. It would makemainthe only eligible source branch, and Phase 1 leaves source eligibility to the maintainer (R-SOURCE; ancestry and ruleset validation is slice 2.9). Instead, the guide's checklist now says to push the commit to a branch before its tag, explains the 403, and gives the safe rerun. I've left this thread open in case you want the branch check in Phase 1 anyway.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the trade-off concrete: a
main-only check would block releases tagged from rc branches. The guide currently leaves that to maintainers ("Whether to authorize tags from rc branches is a maintainer decision"). If rc-branch releases don't need to be supported, I'm happy to add themainreachability check in this PR. Alternatively, a branch-agnostic check (the commit must be on some branch) would catch the 403 case without deciding the rc question.