|
This is unreleased documentation for SBOM Scanner 0.14-dev. |
Verifying Kubewarden SBOM Scanner
The Kubewarden SBOM Scanner project signs what it publishes, so that you can check that an artifact is the one the project built. For each release, the project publishes:
-
Signed container images, one per component.
-
A signed Software Bill of Materials (SBOM) and a signed provenance attestation for each image and architecture.
-
A signed Helm chart.
The signatures use Sigstore in keyless mode. The
signing certificate names the GitHub Actions workflow that built the
artifact. Each cosign command below passes two values:
-
--certificate-oidc-issuer: alwayshttps://token.actions.githubusercontent.com. -
--certificate-identity-regexp: the workflow file that built the artifact.
SBOM Scanner builds, signs and attests its images with one shared
reusable workflow that lives in the kubewarden/github-actions repository.
The signer identity of every image, SBOM and provenance file is:
https://github.com/kubewarden/github-actions/.github/workflows/container-release.yml@<ref>
The <ref> is the commit of the reusable workflow, not the release tag of
SBOM Scanner. For that reason the commands below match the identity
with --certificate-identity-regexp, anchored to the full path of the
workflow file.
That identity names the builder, not the release. The same builder signs the
artifacts of every Kubewarden component. So each command also pins the caller
repository and the release tag, with --certificate-github-workflow-repository
and --certificate-github-workflow-ref. A signed file from another repository or
another release does not pass. The flags do not bind the component. Every
component of one release shares these certificate values, so a blob and its
bundle from one component verify under another component’s filename. To check
which image a file describes, read the subject field inside the file.
|
Keep the full path of the workflow file in the pattern, as the commands below
do. A pattern such as |
The examples use the release v0.13.0 and the chart version
0.13.0. Replace them with the versions that you verify.
Container images
SBOM Scanner publishes four images, all at ghcr.io/kubewarden/sbomscanner/:
-
controller -
worker -
storage -
mcp
The shared workflow signs each single-architecture image and the multi-architecture index. To verify the controller image, run:
cosign verify \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
--certificate-identity-regexp='^https://github\.com/kubewarden/github-actions/\.github/workflows/container-release\.yml@' \
--certificate-github-workflow-repository=kubewarden/sbomscanner \
--certificate-github-workflow-ref='refs/tags/v0.13.0' \
ghcr.io/kubewarden/sbomscanner/controller:v0.13.0
Verification for ghcr.io/kubewarden/sbomscanner/controller:v0.13.0 --
The following checks were performed on each of these signatures:
- The cosign claims were validated
- Existence of the claims in the transparency log was verified offline
- The code-signing certificate was verified using trusted certificate authority certificates
<snipped json>
The same command, with worker, storage, or mcp in place of
controller, verifies the other images.
Build provenance (SLSA Build L3)
The shared workflow runs actions/attest on the multi-architecture index of
each image. GitHub writes the provenance from the OIDC token of the workflow
job and signs it. No build step can change it. This attestation is what gives
the images SLSA Build L3.
GitHub stores the attestation in the SBOM Scanner repository and next to the image in the registry. Verify it with the GitHub CLI:
gh attestation verify oci://ghcr.io/kubewarden/sbomscanner/controller:v0.13.0 \
--repo kubewarden/sbomscanner \
--signer-workflow kubewarden/github-actions/.github/workflows/container-release.yml
Loaded digest sha256:... for oci://ghcr.io/kubewarden/sbomscanner/controller:v0.13.0
Loaded 1 attestation from GitHub API
âś“ Verification succeeded!
--repo names the repository that stores the attestation. --signer-workflow
names the workflow that signed it. The check fails for an attestation signed by
any other workflow.
SBOM and provenance attestations
For each image and each architecture, the shared workflow extracts an SBOM in SPDX format and a provenance attestation in SLSA format. It signs each file and the release job attaches the files to the GitHub release. The names follow this pattern:
-
SBOMscanner-<component>-attestation-<arch>-provenance.intoto.jsonl -
SBOMscanner-<component>-attestation-<arch>-sbom.json
These files come from the container build. They carry the layer and build-arg
detail that actions/attest does not. The actions/attest attestation above
is the one that carries the SLSA level.
Each file has a Sigstore bundle with the same name and the suffix
.bundle.sigstore. Download the file and its bundle from the
release page, then
verify the provenance:
cosign verify-blob \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
--certificate-identity-regexp='^https://github\.com/kubewarden/github-actions/\.github/workflows/container-release\.yml@' \
--certificate-github-workflow-repository=kubewarden/sbomscanner \
--certificate-github-workflow-ref='refs/tags/v0.13.0' \
--bundle SBOMscanner-controller-attestation-amd64-provenance.intoto.jsonl.bundle.sigstore \
SBOMscanner-controller-attestation-amd64-provenance.intoto.jsonl
Verified OK
And the SBOM:
cosign verify-blob \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
--certificate-identity-regexp='^https://github\.com/kubewarden/github-actions/\.github/workflows/container-release\.yml@' \
--certificate-github-workflow-repository=kubewarden/sbomscanner \
--certificate-github-workflow-ref='refs/tags/v0.13.0' \
--bundle SBOMscanner-controller-attestation-amd64-sbom.json.bundle.sigstore \
SBOMscanner-controller-attestation-amd64-sbom.json
Verified OK
After the check, you can read the files. The SBOM lists the packages in the image. The provenance names the source commit, the builder, and the build parameters.
The same attestations are also attached to each image in the registry, in
the format that Docker uses. The signed copies are the release assets. To
read the registry copy, list the attestation manifest with
crane:
crane manifest ghcr.io/kubewarden/sbomscanner/controller:v0.13.0 \
| jq '.manifests[] | select(.annotations["vnd.docker.reference.type"]=="attestation-manifest")'
Then fetch the manifest by its digest and read each layer with crane blob.
Helm chart
The SBOM Scanner chart is in the Helm repository at
https://charts.kubewarden.io and, as an OCI artifact, at
ghcr.io/kubewarden/charts/sbomscanner. The OCI copy is signed. The
kubewarden/helm-charts repository builds, signs and attests the chart with
its own chart-release.yml reusable workflow. The workflow packages the
chart from the commit that the signature and the attestation name, so no
step outside the workflow can change it.
The chart carries two cosign signature formats. Run the following two commands to verify them:
cosign verify --new-bundle-format=false \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
--certificate-identity-regexp='^https://github\.com/kubewarden/helm-charts/\.github/workflows/chart-release\.yml@' \
--certificate-github-workflow-repository=kubewarden/helm-charts \
--certificate-github-workflow-ref='refs/heads/main' \
ghcr.io/kubewarden/charts/sbomscanner:0.13.0
Verification for ghcr.io/kubewarden/charts/sbomscanner:0.13.0 --
The following checks were performed on each of these signatures:
- The cosign claims were validated
- Existence of the claims in the transparency log was verified offline
- The code-signing certificate was verified using trusted certificate authority certificates
<snipped json>
cosign verify-attestation --new-bundle-format=true \
--type https://sigstore.dev/cosign/sign/v1 \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
--certificate-identity-regexp='^https://github\.com/kubewarden/helm-charts/\.github/workflows/chart-release\.yml@' \
ghcr.io/kubewarden/charts/sbomscanner:0.13.0
The workflow also runs actions/attest on the chart. That attestation gives
the chart SLSA Build L3. GitHub stores it in the kubewarden/helm-charts
repository. The GitHub CLI verifies it:
gh attestation verify oci://ghcr.io/kubewarden/charts/sbomscanner:0.13.0 \
--repo kubewarden/helm-charts \
--signer-workflow kubewarden/helm-charts/.github/workflows/chart-release.yml
The workflow also attests the packaged .tgz file that the GitHub release
carries. Download the file from the
release page, then verify
it:
gh attestation verify sbomscanner-0.13.0.tgz \
--repo kubewarden/helm-charts \
--signer-workflow kubewarden/helm-charts/.github/workflows/chart-release.yml
To list every image that the chart deploys, render it and extract the image fields:
helm template sbomscanner oci://ghcr.io/kubewarden/charts/sbomscanner \
--version 0.13.0 \
| yq '..|.image? | select(.)' \
| sort -u
Verify each SBOM Scanner image in that list as the container images section shows.
Third-party images
The chart also deploys images that the SBOM Scanner project does not build and does not sign:
-
The NATS server and its configuration reloader, from the
natssubchart. -
The PostgreSQL image that the CloudNativePG operator runs, when
storage.postgres.cnpg.enabledistrue.
The worker also pulls the Trivy vulnerability databases from
public.ecr.aws/aquasecurity/ as OCI artifacts. Verify these with the method
that their own projects document.