Skip to content

Commit

Permalink
ci: add SBOM and cosign for all binaries and docker images (#3910)
Browse files Browse the repository at this point in the history
* ci: add sboms and cosign
  • Loading branch information
ypoplavs committed May 30, 2023
1 parent da396b5 commit 697412c
Show file tree
Hide file tree
Showing 12 changed files with 173 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker-build-api-executors-beta-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ on:
env:
ALPINE_IMAGE: alpine:3.18.0

permissions:
id-token: write # needed for keyless signing with cosign

jobs:
api:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand Down Expand Up @@ -65,6 +71,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand Down Expand Up @@ -109,6 +118,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand Down Expand Up @@ -150,6 +162,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand Down Expand Up @@ -192,6 +207,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand Down Expand Up @@ -294,6 +312,9 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
Expand All @@ -315,12 +336,21 @@ jobs:
docker manifest create kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }} --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-cypress12-amd64 --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-cypress12-arm64v8
docker manifest push -p kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}
- name: Sign images with cosign
run: |
cosign sign kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-cypress12-amd64 --yes
cosign sign kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-cypress12-arm64v8 --yes
cosign sign kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }} --yes
executor_playwright:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand Down
35 changes: 34 additions & 1 deletion .github/workflows/docker-build-api-executors-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ on:
env:
ALPINE_IMAGE: alpine:3.18.0

permissions:
id-token: write # needed for keyless signing with cosign

jobs:
api:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
Expand Down Expand Up @@ -78,12 +84,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Go Cache
uses: actions/cache@v2
Expand Down Expand Up @@ -133,6 +142,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand Down Expand Up @@ -185,6 +197,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand Down Expand Up @@ -238,6 +253,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand Down Expand Up @@ -365,9 +383,13 @@ jobs:

runs-on: ubuntu-latest
steps:

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
Expand All @@ -391,18 +413,26 @@ jobs:
run: |
docker manifest create kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-${{ matrix.version }} --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-${{ matrix.version }}-amd64 --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-${{ matrix.version }}-arm64v8
docker manifest push -p kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-${{ matrix.version }}
cosign sign kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-${{ matrix.version }}-amd64 --yes
cosign sign kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-${{ matrix.version }}-arm64v8 --yes
cosign sign kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-${{ matrix.version }} --yes
docker manifest create kubeshop/testkube-cypress-executor:${{ matrix.version }} --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-${{ matrix.version }}-amd64 --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-${{ matrix.version }}-arm64v8
docker manifest push -p kubeshop/testkube-cypress-executor:${{ matrix.version }}
cosign sign kubeshop/testkube-cypress-executor:${{ matrix.version }} --yes
docker manifest create kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }} --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-cypress12-amd64 --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-cypress12-arm64v8
docker manifest push -p kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}
cosign sign kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }} --yes
docker manifest create kubeshop/testkube-cypress-executor:latest --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-cypress12-amd64 --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-cypress12-arm64v8
docker manifest push -p kubeshop/testkube-cypress-executor:latest
cosign sign kubeshop/testkube-cypress-executor:latest --yes
docker manifest create kubeshop/testkube-cypress-executor:legacy --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-npm-amd64 --amend kubeshop/testkube-cypress-executor:${{ steps.tag.outputs.tag }}-npm-arm64v8
docker manifest push -p kubeshop/testkube-cypress-executor:legacy
cosign sign kubeshop/testkube-cypress-executor:legacy --yes
executor_playwright:
Expand All @@ -411,6 +441,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-*"

permissions:
id-token: write # needed for keyless signing

jobs:
pre_build:
name: Pre-build
Expand Down Expand Up @@ -65,6 +68,8 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2
- name: Download Artifacts for Linux
uses: actions/download-artifact@master
with:
Expand Down Expand Up @@ -147,7 +152,7 @@ jobs:
Copy-Item 'windows\testkube_windows_386\kubectl-testkube.exe' '.\kubectl-testkube.exe'
Copy-Item 'build\installer\windows\testkube.wxs' '.\testkube.wxs'
Copy-Item 'build\installer\windows\tk.bat' '.\tk.bat'
Copy-Item 'build\installer\windows\testkube.bat' '.\testkube.bat'
Copy-Item 'build\installer\windows\testkube.bat' '.\testkube.bat'
& "$env:WIX\bin\candle.exe" *.wxs
& "$env:WIX\bin\light.exe" *.wixobj
& "C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe" sign /f "$env:P12_CERT" /p "$env:P12_PASSWORD" /d "Kubetest by Kubeshop" /tr http://timestamp.digicert.com testkube.msi
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

permissions:
id-token: write # needed for keyless signing
contents: write

env:
TESTKUBE_CHOCO_REPO: https://chocolatey.kubeshop.io/

Expand Down Expand Up @@ -69,6 +73,8 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: sigstore/cosign-installer@v3.0.5
- uses: anchore/sbom-action/download-syft@v0.14.2
- name: Download Artifacts for Linux
uses: actions/download-artifact@master
with:
Expand Down
20 changes: 20 additions & 0 deletions .goreleaser-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@ archives:
amd64: x86_64
checksum:
name_template: "checksums.txt"

source:
enabled: true

sboms:
- artifacts: archive
- id: source
artifacts: source

signs:
- cmd: cosign
certificate: '${artifact}.pem'
args:
- sign-blob
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
- "--yes"
artifacts: all
output: true
changelog:
sort: asc
filters:
Expand Down
20 changes: 20 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@ archives:
checksum:
name_template: "checksums.txt"

source:
enabled: true

sboms:
- artifacts: archive
- id: source
artifacts: source

signs:
- cmd: cosign
certificate: '${artifact}.pem'
args:
- sign-blob
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
- "--yes"
artifacts: all
output: true

changelog:
sort: asc
use: github
Expand Down
11 changes: 10 additions & 1 deletion goreleaser_files/.goreleaser-docker-build-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,13 @@ docker_manifests:
- kubeshop/testkube-api-server:{{ .Version }}-arm64v8

release:
disable: true
disable: true

docker_signs:
- cmd: cosign
artifacts: all
output: true
args:
- 'sign'
- '${artifact}'
- "--yes"
11 changes: 10 additions & 1 deletion goreleaser_files/.goreleaser-docker-build-executor-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,13 @@ docker_manifests:
- kubeshop/testkube-gradle-executor:{{ .Version }}-jdk11-arm64v8

release:
disable: true
disable: true

docker_signs:
- cmd: cosign
artifacts: all
output: true
args:
- 'sign'
- '${artifact}'
- "--yes"
9 changes: 9 additions & 0 deletions goreleaser_files/.goreleaser-docker-build-executor-jmeter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ docker_manifests:

release:
disable: true

docker_signs:
- cmd: cosign
artifacts: all
output: true
args:
- 'sign'
- '${artifact}'
- "--yes"
11 changes: 10 additions & 1 deletion goreleaser_files/.goreleaser-docker-build-executor-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,13 @@ docker_manifests:
- kubeshop/testkube-maven-executor:{{ .Version }}-jdk11-arm64v8

release:
disable: true
disable: true

docker_signs:
- cmd: cosign
artifacts: all
output: true
args:
- 'sign'
- '${artifact}'
- "--yes"
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,13 @@ docker_manifests:
- kubeshop/testkube-playwright-executor:{{ .Version }}-npm-arm64v8

release:
disable: true
disable: true

docker_signs:
- cmd: cosign
artifacts: all
output: true
args:
- 'sign'
- '${artifact}'
- "--yes"

0 comments on commit 697412c

Please sign in to comment.