Attach and verify a cosign attestation for an SBOM linked to a container image

domain: docs.sigstore.dev · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Generate the SBOM (e.g. with Syft) as sbom.json, then attach it as an attestation: `cosign attest --predicate sbom.json --type spdxjson <IMAGE>` (use `--type cyclonedx` for a CycloneDX SBOM), signing with `--key cosign.key` for a static key or omitting --key for keyless signing via Fulcio + Rekor.
  2. For keyless signing in CI, grant the workflow `permissions: id-token: write` so cosign can obtain an ambient OIDC token (cosign auto-detects the github-actions provider), or pass one explicitly with --identity-token.
  3. Verify the attestation against the transparency log: `cosign verify-attestation --type spdxjson --certificate-identity <EXPECTED_IDENTITY_OR_REGEXP> --certificate-oidc-issuer https://token.actions.githubusercontent.com <IMAGE>` for keyless, or `cosign verify-attestation --type spdxjson --key cosign.pub <IMAGE>` for key-based verification.
  4. Inspect the verified predicate contents with `cosign verify-attestation ... <IMAGE> | jq -r .payload | base64 -d | jq .predicate`.
  5. Optionally enforce policy on the predicate with `--policy <FILE>.rego` or `--policy <FILE>.cue` passed to verify-attestation.

Known gotchas

Related routes

Attach a signed SBOM as a cosign attestation to an OCI image and verify the attestation in a downstream deployment step
security/compliance · 5 steps · unrated
Attach a signed SBOM attestation to an OCI image using cosign attest
docs.sigstore.dev · 6 steps · unrated
Verify a cosign attestation on a container image with cosign verify-attestation
slsa.dev · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans