Skip to content
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

🌱 Add SBOM generation for Cyber Resilience Act compliance #4248

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
goreleaser:
runs-on: ubuntu-latest


steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -25,6 +24,10 @@ jobs:
go-version: '~1.22'
- name: Clean dist directory
run: rm -rf dist || true
- name: Install Syft to generate SBOMs
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b $HOME/bin

Choose a reason for hiding this comment

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

is it worth to consider caching the binary?

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not think so.
We just run this action when we do the release (not so many times per year)

echo "$HOME/bin" >> $GITHUB_PATH
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
9 changes: 9 additions & 0 deletions build/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,12 @@ release:
github:
owner: kubernetes-sigs
name: kubebuilder

# Add the SBOM configuration at the end to generate SBOM files
sboms:
- id: kubebuilder-sbom
artifacts: binary
cmd: syft
args: ["$artifact", "--output", "cyclonedx-json=$document"]
documents:
- "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.cyclonedx.sbom.json"
Loading