Supply chain security

SBOMs, Provenance and Attestations

1.Signed is not the same as true

An attestation is a signed claim about one artifact digest. The signature tells you who said it, never that it is right. Signing itself is in Image Signing; this chapter is about what gets signed.

Every verify does four checks
  1. Signature + identity : a trusted signer and issuer, not "any signer".
  2. Subject : a subject[].digest equals the digest you hold.
  3. Type : the predicateType you expect (provenance, SBOM, VEX).
  4. Policy on the predicate : builder, source repo, workflow, ref.
Skip one and the claim is decoration. gh's own help says whoever controls the workflow can fake the predicate; only the cert and timestamps are unforgeable.

2.One claim, four layers

  • Statement v1 : _type, subject[] (name + digest), predicateType, predicate.
  • DSSE signs the PAE string, DSSEv1 28 application/vnd.in-toto+json <len> <body>, so payloadType is signed too.
  • keyid is only a hint, never a security decision.
  • Then use the verified bytes only. Never re-parse.
  • Referrers : Images and Pulls.
OCI referrer subject = image digest Sigstore bundle cert + tlog entry DSSE envelope payloadType, payload, sigs Statement subject, predicateType, predicate exactly one signature subject image @sha256:D

3.Predicate types

SBOMs, provenance, scans, VEX : all predicates. cosign v3.1.3 still writes Statement v0.1, actions/attest v1.

PredicatepredicateTypecosign --type
SLSA provenance v1https://slsa.dev/provenance/v1slsaprovenance1
SLSA provenance v0.2https://slsa.dev/provenance/v0.2slsaprovenance and slsaprovenance02 : the trap
SPDXhttps://spdx.dev/Documentspdx, spdxjson
CycloneDXhttps://cyclonedx.org/bomcyclonedx
OpenVEXhttps://openvex.dev/nsopenvex
cosign customhttps://cosign.sigstore.dev/attestation/v1custom : the default

4.SLSA 1.2 : Build and Source tracks

1.2 adds the Source track. The Build track and the predicate https://slsa.dev/provenance/v1 do not change.

LevelBuild trackSource track
L1Provenance exists. "Trivial to bypass or forge"Version controlled
L2Hosted platform signs it : stops tampering after the buildHistory and provenance per revision
L3Isolated runs, signing secrets out of reach : stops it duringTechnical controls on named refs
L4none (old v0.1 "SLSA 4" is gone)Two-party review
EvidenceProvenance v1, signed by the platformSource VSA

5.Provenance v1, field by field

  • externalParameters are untrusted inputs : check them, reject fields you do not know.
  • runDetails.builder.id is meant to decide the Build level on its own.
  • resolvedDependencies : sources with digests, here the Git commit.
  • materials or invocation mean v0.2 from an older generator, not a bad signature.

GitHub provenance v1, trimmed :

"buildType": ".../buildtypes/workflow/v1",
"externalParameters": {"workflow": {
  "ref": "refs/tags/v1.4.0",
  "path": ".github/workflows/release.yml"}},
"resolvedDependencies": [{"uri": "git+...",
  "digest": {"gitCommit": "<sha>"}}],
"builder": {"id": "https://github.com/acme/
  build-templates/.../oci-release.yml@..."}
In short : An attestation is a Statement about a digest, signed through DSSE, shipped in a bundle. Provenance says how it was built. Check signer, subject, type and content every time.

1.GitHub artifact attestations

  • actions/attest@v4 : one action for provenance, SBOM and custom. The older two are wrappers.
  • Write on id-token + attestations; on artifact-metadata only for storage records, packages for GHCR.
  • Alone : Build L2. Built and attested inside a reusable workflow : L3.
  • Private repos : no transparency log, GHE Cloud only.
build job actions/attest OIDC token id-token: write Fulcio cert short-lived bundle signed Statement attestations API push-to-registry registry referrer gh attestation verify reads

2.Verifying provenance

  • gh attestation verify oci://IMG@sha256:D -R org/repo : SLSA v1 + GitHub issuer by default.
  • A reusable workflow signed it ? Add --signer-workflow.
  • No TTY : success prints nothing. Gate on the exit code, keep --format json as evidence.
  • slsa-github-generator, slsa-verifier : unmaintained since 2026-08-07 (tags predate the notice).
ghcosignslsa-verifier
ReadsAPI, OCI, diskreferrers, .attgenerator, GCB
DefaultSLSA v1customby builder
Identity-R, signer flagsidentity + issuer--source-uri
Kept upyesyesno

3.BuildKit attestations

  • Push with --provenance=mode=max --sbom=true : one unknown/unknown manifest per platform.
  • SLSA v1 by default since v0.28.0 (Docker's docs say v0.2).
  • Layers are bare, unsigned Statements : sign the predicate yourself.
  • Read : docker buildx imagetools inspect IMG --format '{{ json .Provenance.SLSA }}'
  • mode=max records build-arg values. --load drops attestations.
image index : moby/buildkit:v0.33.1 6 platforms, each followed by its attestation linux/amd64 image manifest unknown/unknown attestation manifest subject layers : SPDX, SPDX, SLSA provenance v1 unsigned : bare Statements

4.What an SBOM lists

  • SPDX 2.3 is still the tools' default. SPDX 3.0.1 is JSON-LD and not field-compatible with it.
  • syft's SPDX and Kubernetes' SBOM miss the CISA 2026 minimum elements. The signature goes outside, in an attestation.
SPDX 2.3SPDX 3.0.1CycloneDX 1.7
ShapeJSON or tag-value documentJSON-LD graphJSON, XML, Protobuf
Default insyft, trivy, BuildKit, bomsyft opt-in (spdx-json@3.0)syft and trivy CycloneDX output
actions/attestaccepts JSON, not tag-valuerejectsaccepts, needs serialNumber
grype / trivyboth; cross-tool can read 0grype yes, trivy failsboth; cross-tool loses findings

5.Making and attaching SBOMs

  • syft scan registry:IMG@sha256:D -o spdx-json=s.json -o cyclonedx-json=c.json : two formats, no daemon.
  • trivy image --format cyclonedx is an SBOM, not a scan, without --scanners vuln.
  • Signed : cosign attest --type cyclonedx --predicate c.json IMG@sha256:D. Verify with cosign verify-attestation --type cyclonedx ; without --type it looks for custom.
  • cosign attest --statement is ignored for images. Only attest-blob --statement takes a full Statement.
  • Unsigned : oras attach --artifact-type application/vnd.cyclonedx+json IMG c.json. Fine to share, not evidence.
In short : GitHub and BuildKit make provenance and SBOMs, but only signed ones are evidence. Verify with signer and type pinned, then enforce it (Image Policy).

1.Rescan the SBOM, not the image

  • grype sbom:./x.json or trivy sbom x.json : stored SBOM vs today's DB. No pull, no rebuild.
  • Cross-tool rescans fail silently : Trivy found 0 in syft's SPDX, grype 0 in Trivy's SBOMs, against 48 to 52 direct. All exit 0 (2026-10-07).
  • Check for a detected OS and a sane package count.
  • grype --fail-on exits 2, not 1 (1 = the scan broke).
build SBOM attest registry months later verify + extract scanner + today's DB findings fix, or VEX VEX filters the next scan

2.VEX : saying "not affected"

  • OpenVEX v0.2.0 : vulnerability, products (digest PURL best), status. not_affected needs a justification or impact_statement.
  • VEX removes findings, so authenticate it. Trivy's experimental --vex oci let a VEX signed by a throwaway key drop a CVE (48 to 45).
  • Same with --sbom-sources oci : an unverified attached SBOM gave 9 findings, not 48. Who can push a referrer picks what is scanned (RBAC).
--vexTrivyGrype
FormatsOpenVEX, CycloneDX, CSAFOpenVEX, CSAF
Suppressesnot_affected, fixedsame, into ignoredMatches
Sig checknone on found VEXlocal files only
Two files--vex a --vex b or a,brepeat --vex only
$ vexctl create --product=pkg:oci/app@sha256:... \
   --vuln=CVE-... --status=not_affected \
   --justification=... --file=app.vex.json

3.Continuous scanning in the cluster

  • Trivy Operator v0.35.0 runs scan Jobs and writes a VulnerabilityReport and SbomReport per container, owned by the workload (GC).
  • scannerReportTTL 24h : reports are recreated daily against a fresh DB.
  • Standalone (default) : each Job downloads the DB. ClientServer : one shared server.
  • Its scanner image is pinned by tag (trivy:0.75.0) : mirror a verified digest.
$ kubectl get vulns -A -o wide
$ kubectl get clustervuln,clustersbom

4.Worked example : Kubernetes itself

  • sbom.k8s.io/v1.37.1/release : SPDX 2.3 tag-value, 812 packages (among them 24 images, 508 Debian packages) plus 100 files. Go modules are in /source.
  • Signed like the binaries (krel-staging, .sig + .cert) : verify as in Image Signing.
  • provenance.json : Statement v0.1, SLSA v0.2, unsigned, 404 for every 2026-09-23 patch. Only level claim : "Level 1" (v1.23).
  • Rescan 2026-10-07 : grype 1306 matches (155 CVEs, all Debian); Trivy 0 (os family none).
$ U=https://dl.k8s.io/release/v1.37.1
$ curl -sI $U/provenance.json    # 404
$ curl -Ls $U/kubernetes-release.spdx -o k.spdx
$ grype sbom:./k.spdx

5.Case study : the Trivy compromise (March 2026)

  • Stolen credentials published trivy v0.69.4 through the real release pipeline, and force-pushed 76 of 77 trivy-action tags and all 7 setup-trivy tags (CVE-2026-33634, in CISA KEV).
  • Pin actions by full SHA, transitively (trivy-action <= 0.30.0 called setup-trivy by tag). Pin the tool too : setup-trivy defaults to latest.
  • Verify the binary with a tight identity. The signer moved from private-trivy to trivy at v0.69.3.
late Febtoken stolen
03-01disclosed, rotation not atomic
03-19 ~17:43action tags force-pushed
03-19 18:22v0.69.4 released
03-22Docker Hub 0.69.5, 0.69.6
03-26in CISA KEV

Digest pins and full-SHA pins held, but only where every layer pinned.

In short : Rescan stored SBOMs with the same tool family, trust VEX and attached SBOMs only from a verified signer, and treat your scanner and its CI actions as supply chain too.