Skip to content

Add workflow code to generate SBOMs and upload them to the release/pre-release#266

Open
jsf9k wants to merge 15 commits intodevelopfrom
feature/add-sbom
Open

Add workflow code to generate SBOMs and upload them to the release/pre-release#266
jsf9k wants to merge 15 commits intodevelopfrom
feature/add-sbom

Conversation

@jsf9k
Copy link
Copy Markdown
Member

@jsf9k jsf9k commented Jan 20, 2026

🗣 Description

This pull request:

  • Adds workflow code to generate SBOMs for the Docker images
  • If we happen to be building a release or pre-release then the SBOMs will be uploaded to the release or pre-release.
  • Adds workflow code to create provenance attestations for the SBOMs and the Docker image artifact
  • Adds workflow code to create SBOM attestations for the Docker images

💭 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

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

✅ Pre-merge checklist

  • Mark SBOM checks as required.

@jsf9k jsf9k self-assigned this Jan 20, 2026
@jsf9k jsf9k moved this to In Progress in Next Kraken Jan 20, 2026
@jsf9k
Copy link
Copy Markdown
Member Author

jsf9k commented Jan 20, 2026

Note that the lint job should pass once SchemaStore/schemastore#5292 is merged and python-jsonschema/check-jsonschema#638 is resolved.

@github-actions github-actions Bot added the github-actions Pull requests that update GitHub Actions code label Jan 20, 2026
@jsf9k jsf9k force-pushed the feature/add-sbom branch 12 times, most recently from 91e4cba to 516e839 Compare January 26, 2026 15:17
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file documentation This issue or pull request improves or adds to documentation version bump This issue or pull request increments the version number labels Jan 26, 2026
@jsf9k jsf9k removed documentation This issue or pull request improves or adds to documentation version bump This issue or pull request increments the version number labels Jan 26, 2026
@jsf9k jsf9k marked this pull request as ready for review January 26, 2026 18:43
@jsf9k jsf9k moved this from In progress to Review in progress in Skeleton Maintenance Jan 26, 2026
@jsf9k jsf9k force-pushed the feature/add-sbom branch 2 times, most recently from 9c2d344 to 3414b32 Compare March 10, 2026 14:30
@jsf9k jsf9k force-pushed the feature/add-sbom branch 3 times, most recently from 7eb4b41 to ccf97fb Compare March 10, 2026 17:41
@jsf9k jsf9k requested a review from Copilot March 10, 2026 18:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread .github/workflows/build.yml Outdated
jsf9k and others added 14 commits April 17, 2026 12:45
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>
@jsf9k jsf9k force-pushed the feature/add-sbom branch from 0432fe7 to 9e38561 Compare April 17, 2026 16:56
The subject path changed upstream, so it has to change here too.
Copy link
Copy Markdown
Collaborator

@felddy felddy left a comment

Choose a reason for hiding this comment

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

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.

@github-project-automation github-project-automation Bot moved this from Review in progress to Reviewer approved in Skeleton Maintenance Apr 17, 2026
@jsf9k jsf9k requested a review from a team April 24, 2026 14:39
#
# 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'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we only care about doing this on release I think this job should only run if the push is for a tag.

Suggested change
if: github.event_name != 'pull_request'
if: startsWith(github.ref, 'refs/tags/')

Comment on lines +628 to +629
# Generate an SBOM for the Docker image and, if there is a
# release, upload it as an asset to the release.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment doesn't seem accurate with what the job is actually doing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

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

Labels

dependencies Pull requests that update a dependency file github-actions Pull requests that update GitHub Actions code

Projects

Status: In Progress
Status: Reviewer approved

Development

Successfully merging this pull request may close these issues.

5 participants