forked from ko-build/ko
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This plumbs through support for building multi-arch SPDX SBOMs largely based on Puerco's outline, but with a few adaptations. I added a few minor refactorings to try to enable consistency across the Image/Index SBOMs. Related: ko-build#655
- Loading branch information
Showing
8 changed files
with
413 additions
and
116 deletions.
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.