-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sbom to releases and attach to containers (#160)
- Loading branch information
Itxaka
authored
Sep 12, 2022
1 parent
57d36d8
commit 846c610
Showing
3 changed files
with
56 additions
and
2 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 |
---|---|---|
|
@@ -82,11 +82,26 @@ jobs: | |
TAG=${{ steps.export_tag.outputs.operator_tag }} | ||
COMMITDATE=${{ steps.export_tag.outputs.commit_date }} | ||
COMMIT=${{ github.sha }} | ||
- name: Install the bom command | ||
shell: bash | ||
run: go install sigs.k8s.io/bom/cmd/[email protected] | ||
- name: Create SBOM file | ||
shell: bash | ||
run: | | ||
bom generate -o elemental-operator.spdx . | ||
- name: Attach SBOM file in the container image | ||
shell: bash | ||
run: | | ||
set -e | ||
cosign attach sbom --sbom elemental-operator.spdx "${{ env.OPERATOR_REPO }}:${{ steps.export_tag.outputs.operator_tag }}-${GITHUB_SHA::7}" | ||
cosign attach sbom --sbom elemental-operator.spdx "${{ env.OPERATOR_REPO }}:latest" | ||
- name: Sign images | ||
env: | ||
COSIGN_EXPERIMENTAL: 1 | ||
run: | | ||
cosign sign ${{ env.OPERATOR_REPO }}:${{ steps.export_tag.outputs.operator_tag }}-${GITHUB_SHA::7} | ||
cosign sign ${{ env.OPERATOR_REPO }}:${{ steps.export_tag.outputs.operator_tag }}-${GITHUB_SHA::7}.sbom | ||
cosign sign ${{ env.OPERATOR_REPO }}:latest | ||
cosign sign ${{ env.OPERATOR_REPO }}:latest.sbom | ||
cosign sign ${{ env.REGISTER_REPO }}:${{ steps.export_tag.outputs.operator_tag }}-${GITHUB_SHA::7} | ||
cosign sign ${{ env.REGISTER_REPO }}:latest |
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 |
---|---|---|
|
@@ -80,11 +80,26 @@ jobs: | |
TAG=${{ steps.export_tag.outputs.operator_tag }} | ||
COMMITDATE=${{ steps.export_tag.outputs.commit_date }} | ||
COMMIT=${{ github.sha }} | ||
- name: Sign image | ||
- name: Install the bom command | ||
shell: bash | ||
run: go install sigs.k8s.io/bom/cmd/[email protected] | ||
- name: Create SBOM file | ||
shell: bash | ||
run: | | ||
bom generate -o elemental-operator.spdx . | ||
- name: Attach SBOM file in the container image | ||
shell: bash | ||
run: | | ||
set -e | ||
cosign attach sbom --sbom elemental-operator.spdx "${{ env.OPERATOR_REPO }}:${{ steps.export_tag.outputs.operator_tag }}" | ||
cosign attach sbom --sbom elemental-operator.spdx "${{ env.OPERATOR_REPO }}:latest" | ||
- name: Sign images and sbom | ||
env: | ||
COSIGN_EXPERIMENTAL: 1 | ||
run: | | ||
cosign sign ${{ env.OPERATOR_REPO }}:${{ steps.export_tag.outputs.operator_tag }} | ||
cosign sign ${{ env.OPERATOR_REPO }}:${{ steps.export_tag.outputs.operator_tag }}.sbom | ||
cosign sign ${{ env.OPERATOR_REPO }}:latest | ||
cosign sign ${{ env.OPERATOR_REPO }}:latest.sbom | ||
cosign sign ${{ env.REGISTER_REPO }}:${{ steps.export_tag.outputs.operator_tag }} | ||
cosign sign ${{ env.REGISTER_REPO }}:latest |
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 |
---|---|---|
|
@@ -8,6 +8,9 @@ on: | |
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
@@ -31,4 +34,25 @@ jobs: | |
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install the bom command | ||
shell: bash | ||
run: go install sigs.k8s.io/bom/cmd/[email protected] | ||
- name: Create SBOM file | ||
shell: bash | ||
run: | | ||
mkdir signatures | ||
bom generate -o /signatures/elemental-operator.spdx . | ||
- name: Sign BOM file | ||
env: | ||
COSIGN_EXPERIMENTAL: 1 | ||
run: | | ||
cosign sign-blob --output-certificate signatures/elemental-operator.spdx.cert \ | ||
--output-signature signatures/elemental-operator.spdx.sig \ | ||
signatures/elemental-operator.spdx | ||
- name: Release sbom | ||
uses: fnkr/github-action-ghr@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GHR_PATH: signatures/ | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |