-
Notifications
You must be signed in to change notification settings - Fork 407
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
Start emitting multi-arch SBOMs for SPDX
with ko
#743
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8ce4555
Plumb through multi-arch SBOMs for SPDX.
mattmoor c6e55fa
Move ociRef by SPDX (only consumer), move goRef/bomRef into mod*.go, …
mattmoor 7f8fcdb
Add DownloadLocation to all our packages
mattmoor a9a6ce5
Fix merge conflict
mattmoor bcd0348
Add an e2e test leg to try and validate the SBOM
mattmoor dd00b77
Try just referencing child images as packages.
mattmoor 7ab92b0
Add arch to the purls
mattmoor 13ee953
Drop underscore params
mattmoor 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 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 |
---|---|---|
|
@@ -55,14 +55,14 @@ jobs: | |
- name: Generate and Validate | ||
run: | | ||
img=$(go run ./ build ./) | ||
go run ./ deps $img --sbom=cyclonedx > sbom.json | ||
./cyclonedx-linux-x64 validate --input-file=sbom.json --fail-on-errors | ||
go run ./ deps $img --sbom=cyclonedx > cyclonedx.json | ||
./cyclonedx-linux-x64 validate --input-file=cyclonedx.json --fail-on-errors | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: ${{ always() }} | ||
with: | ||
name: sbom.json | ||
path: sbom.json | ||
name: cyclonedx.json | ||
path: cyclonedx.json | ||
|
||
spdx: | ||
name: Validate SPDX SBOM | ||
|
@@ -90,12 +90,53 @@ jobs: | |
- name: Generate and Validate | ||
run: | | ||
img=$(go run ./ build ./) | ||
go run ./ deps $img --sbom=spdx | tee sbom.json | ||
go run ./ deps $img --sbom=spdx | tee spdx.json | ||
|
||
java -jar ./tools-java-1.0.4-jar-with-dependencies.jar Verify sbom.json | ||
java -jar ./tools-java-1.0.4-jar-with-dependencies.jar Verify spdx.json | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: ${{ always() }} | ||
with: | ||
name: sbom.json | ||
path: sbom.json | ||
name: spdx.json | ||
path: spdx.json | ||
|
||
spdx-multi-arch: | ||
name: Validate SPDX multi-arch SBOM | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
KO_DOCKER_REPO: localhost:1338 | ||
|
||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.17 | ||
check-latest: true | ||
- name: Install cmd/registry | ||
run: | | ||
go install github.com/google/go-containerregistry/cmd/registry@latest | ||
registry & | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install SPDX Tools | ||
run: | | ||
wget https://github.com/spdx/tools-java/releases/download/v1.0.4/tools-java-1.0.4.zip | ||
unzip tools-java-1.0.4.zip | ||
|
||
- name: Install Cosign | ||
uses: sigstore/[email protected] | ||
with: | ||
cosign-release: 'v1.7.2' | ||
|
||
- name: Generate and Validate | ||
run: | | ||
img=$(go run ./ build --platform=linux/amd64,linux/arm64 ./) | ||
cosign download sbom $img | tee spdx-multi-arch.json | ||
|
||
java -jar ./tools-java-1.0.4-jar-with-dependencies.jar Verify spdx-multi-arch.json | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: ${{ always() }} | ||
with: | ||
name: spdx-multi-arch.json | ||
path: spdx-multi-arch.json |
This file contains 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 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 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.
Should these be in some shared file that both 1.18 and pre-1.18 code can reuse?
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.
I had to move them here because I wanted to use the
*debug.Module
type :-/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.
Boooo I guess what you had was fine. I hate this pre-1.18 and count down the days until we don't have to support it.
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.
Yeah, I had no idea until CI blew up on me, and I had to contort things to be able to leverage module types.
Will be good to kill this with 🔥