-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add attestation to container images and SBOMs
Add in-toto attestation to base image ci workflows, for both SBOMs and images themselves upon build and push. Allow necessary permissions to attest (attestations, packages) on these workflows. Signed-off-by: Arthur Savage <[email protected]>
- Loading branch information
1 parent
8d4b3ae
commit dd90b33
Showing
2 changed files
with
26 additions
and
0 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 |
---|---|---|
|
@@ -21,6 +21,8 @@ jobs: | |
permissions: | ||
contents: read | ||
id-token: write | ||
attestations: write | ||
packages: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -96,6 +98,13 @@ jobs: | |
run: | | ||
cosign sign -y quay.io/sustainable_computing_io/${{matrix.IMAGE_NAME}}:${{matrix.LABEL}}@${{ steps.build-push-image.outputs.digest }} | ||
- name: Generate image attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: quay.io/sustainable_computing_io/${{matrix.IMAGE_NAME}} | ||
subject-digest: ${{ steps.build-push-image.outputs.digest }} | ||
push-to-registry: true | ||
|
||
- name: Generate SBOM | ||
uses: anchore/[email protected] | ||
with: | ||
|
@@ -110,3 +119,11 @@ jobs: | |
name: sbom-${{matrix.IMAGE_NAME}}-${{matrix.LABEL}}.spdx.json | ||
path: ./sbom-${{matrix.IMAGE_NAME}}-${{matrix.LABEL}}.spdx.json | ||
retention-days: 1 | ||
|
||
- name: Generate SBOM attestation | ||
uses: actions/attest-sbom@v1 | ||
with: | ||
subject-name: quay.io/sustainable_computing_io/${{matrix.IMAGE_NAME}} | ||
subject-digest: ${{ steps.build-push-image.outputs.digest }} | ||
sbom-path: ./sbom-${{matrix.IMAGE_NAME}}-${{matrix.LABEL}}.spdx.json | ||
push-to-registry: true |
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