-
Notifications
You must be signed in to change notification settings - Fork 5
ci: attest provenance/SBOM and Grype-scan the built rock #80
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
Merged
tonyandrewmeyer
merged 5 commits into
canonical:master
from
tonyandrewmeyer:feat/attest-and-scan-rock
Jul 14, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f62925b
ci: attest provenance/SBOM and Grype-scan the built rock
tonyandrewmeyer 5ba895a
Merge branch 'master' into feat/attest-and-scan-rock
tonyandrewmeyer 50dbce9
Merge branch 'master' into feat/attest-and-scan-rock
tonyandrewmeyer a568c35
Merge branch 'master' into feat/attest-and-scan-rock
tonyandrewmeyer b52099c
chore: bump version to 2.1.1
tonyandrewmeyer 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,9 +59,54 @@ jobs: | |
| with: | ||
| oci-archive-name: ${{ matrix.artifact-name }} | ||
|
|
||
| upload-ghcr: | ||
| attest-and-scan: | ||
| needs: [prepare, test] | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: ${{ fromJSON(needs.prepare.outputs.build-matrix) }} | ||
| fail-fast: false | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| attestations: write | ||
| artifact-metadata: write | ||
| steps: | ||
| - name: Download rock artifact | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: ${{ matrix.artifact-name }} | ||
| path: ./rock | ||
|
|
||
| - name: Generate SBOM (Syft) | ||
| uses: anchore/sbom-action@e22c389904149dbc22b58101806040fa8d37a610 # v0.24.0 | ||
| with: | ||
| image: oci-archive:./rock/${{ matrix.artifact-name }} | ||
| format: spdx-json | ||
| output-file: ./sbom.spdx.json | ||
| upload-artifact: false | ||
| upload-release-assets: false | ||
|
|
||
| - name: Attest build provenance | ||
| uses: actions/attest@a1948c3f048ba23858d222213b7c278aabede763 # v4.1.1 | ||
| with: | ||
| subject-path: ./rock/${{ matrix.artifact-name }} | ||
|
|
||
| - name: Attest SBOM | ||
| uses: actions/attest@a1948c3f048ba23858d222213b7c278aabede763 # v4.1.1 | ||
| with: | ||
| subject-path: ./rock/${{ matrix.artifact-name }} | ||
| sbom-path: ./sbom.spdx.json | ||
|
|
||
| - name: Scan rock (Grype) | ||
| uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7.4.0 | ||
| with: | ||
| sbom: ./sbom.spdx.json | ||
| fail-build: true | ||
| severity-cutoff: high | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this cutoff a recommendation of our SSDLC?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes (§Mandatory escalation and §Pre-release blocking). |
||
|
|
||
| upload-ghcr: | ||
| needs: [prepare, attest-and-scan] | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: ${{ fromJSON(needs.prepare.outputs.build-matrix) }} | ||
| fail-fast: false | ||
|
|
||
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.
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.
It seems that Grype can scan OCIs directly (with
image). Presumably we separately need the SBOM, so it makes sense to scan the SBOM here too. Is one approach stronger/weaker than the other?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.
Both work. Scanning the SBOM keeps a single source of truth: the SBOM is the one we attest and publish, so a green Grype run against it means "the artefact whose SBOM we signed has no high+ vulnerabilities". There's no risk of the direct-image scan and the attested SBOM disagreeing.
The theoretical advantage of scanning the image directly is that Grype re-catalogues from scratch, so it might spot something Syft missed (like an unmanaged binary). For this rock that gap doesn't really exist, so I'd stay with the SBOM scan. If we ever add content Syft can't catalogue, it's worth switching to
image:or running both.