Add workflow code to generate SBOMs and upload them to the release/pre-release#266
Add workflow code to generate SBOMs and upload them to the release/pre-release#266
Conversation
|
Note that the |
91e4cba to
516e839
Compare
481f4af to
9452d9a
Compare
9c2d344 to
3414b32
Compare
7eb4b41 to
ccf97fb
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Thus our SBOMs are named, e.g., cisagov-skeleton-docker.amd64.spdx-json rather than sbom.amd64.spdx-json.
Co-authored-by: dav3r <david.redmin@trio.dhs.gov>
The if statement is present to to keep the push and pull_request events from both causing the job to be run. Co-authored-by: dav3r <david.redmin@gwe.cisa.dhs.gov> Co-authored-by: Nick M <50747025+mcdonnnj@users.noreply.github.com>
This was happening automatically before, but this makes it explicit. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This reduces the chance that Docker Hub rate limits our request.
In this case we want to pull the image from Docker Hub.
Note that actions/attest-build-provenance has changed its name to actions/attest, partly because it now supports different types of attestations. One such type is an SBOM attestation, which we are now using here.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The subject path changed upstream, so it has to change here too.
felddy
left a comment
There was a problem hiding this comment.
Looks good... a step in the right direction.
This should scale well to us testing all the containers per architecture, and uploading attested SBOMs specific to each architecture.
| # | ||
| # This if statement is present to keep the push and pull_request | ||
| # events from both causing the job to be run. | ||
| if: github.event_name != 'pull_request' |
There was a problem hiding this comment.
If we only care about doing this on release I think this job should only run if the push is for a tag.
| if: github.event_name != 'pull_request' | |
| if: startsWith(github.ref, 'refs/tags/') |
| # Generate an SBOM for the Docker image and, if there is a | ||
| # release, upload it as an asset to the release. |
There was a problem hiding this comment.
This comment doesn't seem accurate with what the job is actually doing.
There was a problem hiding this comment.
We should add provenance: mode=max or sbom: true to the docker/build-push-action configuration in the build-push-all job to leverage built-in functionality while building the image.
🗣 Description
This pull request:
💭 Motivation and context
CISA advocates for the use of SBOMs, so we should be generating them for our software products.
🧪 Testing
All automated tests pass.
✅ Pre-approval checklist
✅ Pre-merge checklist