Skip to content

ci: add build provenance attestations for release artifacts#10316

Open
knqyf263 wants to merge 1 commit intoaquasecurity:mainfrom
knqyf263:ci/build-provenance
Open

ci: add build provenance attestations for release artifacts#10316
knqyf263 wants to merge 1 commit intoaquasecurity:mainfrom
knqyf263:ci/build-provenance

Conversation

@knqyf263
Copy link
Collaborator

@knqyf263 knqyf263 commented Mar 3, 2026

Description

Add SLSA build provenance attestations to the release workflow using
actions/attest. While cosign keyless
signing already provides signature verification, attestations offer a
standardized SLSA format and simple verification via gh attestation verify.

Changes:

  • Add attestations: write permission to reusable-release.yaml
  • Add actions/[email protected] step after GoReleaser to generate attestations
    from dist/checksums.txt
  • Add checksum.name_template: checksums.txt to goreleaser.yml for a
    predictable filename

Tested on aquasecurity/trivy-test with a full release workflow run.

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

Add SLSA build provenance attestations using actions/attest to the
release workflow. This allows users to verify the origin of release
artifacts with `gh attestation verify`.

Changes:
- Add attestations:write permission to reusable-release workflow
- Add actions/attest step after GoReleaser (skipped for canary builds)
- Set fixed checksums filename in goreleaser.yml for predictable path
@knqyf263 knqyf263 added the kind/security Categorizes issue or PR as related to Trivy's own security or internal vulnerabilities. label Mar 3, 2026
@knqyf263 knqyf263 self-assigned this Mar 3, 2026
@knqyf263 knqyf263 requested a review from DmitriyLewen March 3, 2026 18:12
@knqyf263 knqyf263 marked this pull request as ready for review March 4, 2026 06:59
if: ${{ inputs.goreleaser_config != 'goreleaser-canary.yml' }}
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0
with:
subject-checksums: dist/checksums.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue with the install script. It currently expects a versioned filename:

trivy/contrib/install.sh

Lines 393 to 394 in 75c4dc0

CHECKSUM=${PROJECT_NAME}_${VERSION}_checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/${TAG}/${CHECKSUM}

Because of this, http_download will fail when trying to fetch trivy_X.Y.Z_checksums.txt (instead of checksums.txt).

We either need to update the install script, or, alternatively, we can just specify the correct filename right here:

Suggested change
subject-checksums: dist/checksums.txt
subject-checksums: dist/trivy_${{ github.ref_name }}_checksums.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/security Categorizes issue or PR as related to Trivy's own security or internal vulnerabilities.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add build provenance attestations for release artifacts

2 participants