From dc8851ce122fc145ebf7935f44949163753fa8b1 Mon Sep 17 00:00:00 2001 From: Matthew Busel Date: Sat, 21 Nov 2026 14:08:46 -0500 Subject: [PATCH] release: generate and audit one SBOM per native target with sbom-attest --- .github/workflows/native-publish.yml | 25 ++++++++++++++----------- docs/security.md | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/native-publish.yml b/.github/workflows/native-publish.yml index c2815de9..f5229fca 100644 --- a/.github/workflows/native-publish.yml +++ b/.github/workflows/native-publish.yml @@ -166,26 +166,29 @@ jobs: GH_TOKEN: ${{ github.token }} RELEASE_TAG: ${{ github.event.release.tag_name }} run: gh release upload "$RELEASE_TAG" dist/SHA256SUMS --repo "$GITHUB_REPOSITORY" --clobber - - name: Generate CycloneDX SBOM - uses: anchore/sbom-action@v0 - with: - path: rust - format: cyclonedx-json - output-file: dist/asdecided-${{ github.event.release.tag_name }}-sbom.cdx.json - upload-artifact: false - - name: Attach CycloneDX SBOM + - name: Generate and audit CycloneDX SBOMs + env: + RELEASE_TAG: ${{ github.event.release.tag_name }} + run: | + cargo install sbom-attest --version 0.4.2 --locked + for target in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu aarch64-apple-darwin x86_64-apple-darwin x86_64-pc-windows-msvc; do + sbom="dist/asdecided-${RELEASE_TAG}-${target}-sbom.cdx.json" + (cd rust && sbom-attest generate --locked -p decided,decided-mcp --target "$target" --name asdecided --product-version "$RELEASE_TAG" --cdx "../$sbom") + (cd rust && sbom-attest audit "../$sbom" --target "$target" --summary "$GITHUB_STEP_SUMMARY") + done + - name: Attach CycloneDX SBOMs env: GH_TOKEN: ${{ github.token }} RELEASE_TAG: ${{ github.event.release.tag_name }} - run: gh release upload "$RELEASE_TAG" "dist/asdecided-${RELEASE_TAG}-sbom.cdx.json" --repo "$GITHUB_REPOSITORY" --clobber + run: gh release upload "$RELEASE_TAG" dist/asdecided-"${RELEASE_TAG}"-*-sbom.cdx.json --repo "$GITHUB_REPOSITORY" --clobber - name: Attest SHA256SUMS uses: actions/attest-build-provenance@v4 with: subject-path: dist/SHA256SUMS - - name: Attest CycloneDX SBOM + - name: Attest CycloneDX SBOMs uses: actions/attest-build-provenance@v4 with: - subject-path: dist/asdecided-${{ github.event.release.tag_name }}-sbom.cdx.json + subject-path: dist/asdecided-${{ github.event.release.tag_name }}-*-sbom.cdx.json image: needs: [verification, changelog, metadata] diff --git a/docs/security.md b/docs/security.md index f2ecb26e..6b7e4e13 100644 --- a/docs/security.md +++ b/docs/security.md @@ -70,7 +70,7 @@ gh attestation verify asdecided-x86_64-unknown-linux-gnu.tar.gz \ --repo asdecided/core ``` -The SBOM is the `asdecided--sbom.cdx.json` release asset. Verify a GHCR +Each archive's SBOM is the `asdecided---sbom.cdx.json` release asset. Verify a GHCR image's keyless signature with the GitHub Actions OIDC issuer and the exact release workflow identity: