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
- Signature + identity : a trusted signer and issuer, not "any signer".
- Subject : a
subject[].digestequals the digest you hold. - Type : the
predicateTypeyou expect (provenance, SBOM, VEX). - 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/, sovnd. in-toto+json <len> <body> payloadTypeis signed too. keyidis only a hint, never a security decision.- Then use the verified bytes only. Never re-parse.
- Referrers : Images and Pulls.
3.Predicate types
SBOMs, provenance, scans, VEX : all predicates. cosign v3.1.3 still writes Statement v0.1, actions/attest v1.
| Predicate | predicateType | cosign --type |
|---|---|---|
| SLSA provenance v1 | https:// | slsaprovenance1 |
| SLSA provenance v0.2 | https:// | slsaprovenance and slsaprovenance02 : the trap |
| SPDX | https:// | spdx, spdxjson |
| CycloneDX | https:// | cyclonedx |
| OpenVEX | https:// | openvex |
| cosign custom | https:// | custom : the default |
4.SLSA 1.2 : Build and Source tracks
1.2 adds the Source track. The Build track and the predicate https:// do not change.
| Level | Build track | Source track |
|---|---|---|
| L1 | Provenance exists. "Trivial to bypass or forge" | Version controlled |
| L2 | Hosted platform signs it : stops tampering after the build | History and provenance per revision |
| L3 | Isolated runs, signing secrets out of reach : stops it during | Technical controls on named refs |
| L4 | none (old v0.1 "SLSA 4" is gone) | Two-party review |
| Evidence | Provenance v1, signed by the platform | Source VSA |
5.Provenance v1, field by field
externalParametersare untrusted inputs : check them, reject fields you do not know.runDetails.is meant to decide the Build level on its own.builder. id resolvedDependencies: sources with digests, here the Git commit.materialsorinvocationmean 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; onartifact-metadataonly for storage records,packagesfor GHCR. - Alone : Build L2. Built and attested inside a reusable workflow : L3.
- Private repos : no transparency log, GHE Cloud only.
2.Verifying provenance
gh attestation verify oci://: SLSA v1 + GitHub issuer by default.IMG@sha256:D -R org/repo - A reusable workflow signed it ? Add
--signer-workflow. - No TTY : success prints nothing. Gate on the exit code, keep
--format jsonas evidence. - slsa-github-generator, slsa-verifier : unmaintained since 2026-08-07 (tags predate the notice).
| gh | cosign | slsa-verifier | |
|---|---|---|---|
| Reads | API, OCI, disk | referrers, .att | generator, GCB |
| Default | SLSA v1 | custom | by builder |
| Identity | -R, signer flags | identity + issuer | --source-uri |
| Kept up | yes | yes | no |
3.BuildKit attestations
- Push with
--provenance=mode=max --sbom=true: oneunknown/unknownmanifest 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=maxrecords build-arg values.--loaddrops attestations.
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.3 | SPDX 3.0.1 | CycloneDX 1.7 | |
|---|---|---|---|
| Shape | JSON or tag-value document | JSON-LD graph | JSON, XML, Protobuf |
| Default in | syft, trivy, BuildKit, bom | syft opt-in (spdx-json@3.0) | syft and trivy CycloneDX output |
actions/attest | accepts JSON, not tag-value | rejects | accepts, needs serialNumber |
| grype / trivy | both; cross-tool can read 0 | grype yes, trivy fails | both; cross-tool loses findings |
5.Making and attaching SBOMs
syft scan registry:IMG@sha256:D -o spdx-json=s.json -o cyclonedx-json=c.: two formats, no daemon.json trivy image --format cyclonedxis an SBOM, not a scan, without--scanners vuln.- Signed :
cosign attest --type cyclonedx --predicate c.json IMG@sha256:D. Verify withcosign verify-attestation --type cyclonedx; without--typeit looks forcustom. cosign attest --statementis ignored for images. Onlyattest-blob --statementtakes a full Statement.- Unsigned :
oras attach --artifact-type application/. Fine to share, not evidence.vnd. cyclonedx+json IMG c.json
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.jsonortrivy 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-onexits 2, not 1 (1 = the scan broke).
2.VEX : saying "not affected"
- OpenVEX v0.2.0 :
vulnerability,products(digest PURL best),status.not_affectedneeds ajustificationorimpact_statement. - VEX removes findings, so authenticate it. Trivy's experimental
--vex ocilet 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).
| --vex | Trivy | Grype |
|---|---|---|
| Formats | OpenVEX, CycloneDX, CSAF | OpenVEX, CSAF |
| Suppresses | not_affected, fixed | same, into ignoredMatches |
| Sig check | none on found VEX | local files only |
| Two files | --vex a --vex b or a,b | repeat --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).
scannerReportTTL24h : 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.: SPDX 2.3 tag-value, 812 packages (among them 24 images, 508 Debian packages) plus 100 files. Go modules are ink8s. io/ v1. 37. 1/ release /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-actiontags and all 7setup-trivytags (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-trivytotrivyat 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.