Software Supply Chain Security in Practice: SBOMs, SLSA, and Sigstore
Derar SattoufUpdated Security

Most teams now run dependency scanners and call it a day. But the attacks that make headlines rarely exploit a known CVE in a library you already scanned. They compromise a maintainer account, poison a build pipeline, publish a typosquatted package, or tamper with an artifact between build and deploy.
Defending against that requires answering three questions with evidence:
- What is inside this artifact? (SBOM)
- Where and how was it built? (provenance, SLSA)
- Is this the artifact my pipeline actually produced? (signatures, Sigstore)
You can implement all three in a typical container-based pipeline using GitHub Actions, and enforce the result at deploy time. The focus here is the build and release side, which complements the npm-focused npm supply chain defense. For the runtime half, see container security hardening.
An SBOM (Software Bill of Materials) lists the components in an artifact (formats: SPDX, CycloneDX), which makes "are we affected?" a query instead of a fire drill. SLSA (Supply-chain Levels for Software Artifacts) is a maturity framework whose core idea is verifiable provenance produced by a hardened, isolated build platform. Sigstore provides keyless signing: short-lived certificates tied to your CI's OIDC identity, with signatures recorded in a public transparency log, so there are no long-lived signing keys to leak.
A signature that nobody verifies is theater, so enforce verification in the cluster (admission policy) or deploy tooling. A sensible order of effort: pin actions and base images, kill long-lived CI secrets, generate SBOMs, sign and attest, then enforce at admission. Each step pays off on its own. Tool flags and action versions change between releases, so treat the commands here as the shape of the solution and verify exact options in each project's current docs.
Threat model: where supply chains break
source ──> dependencies ──> build ──> artifact registry ──> deploy ──> runtime
│ │ │ │ │
stolen malicious poisoned tampered / unverified
creds / or typo- build env / overwritten image pulled
bad commit squatted secrets leak tagPractical defenses map to stages:
| Stage | Control |
|---|---|
| Source | Branch protection, required reviews, signed commits, 2FA/passkeys |
| Dependencies | Lockfiles, pinned versions, SCA, private registry/proxy, provenance checks |
| Build | Ephemeral isolated runners, least-privilege tokens, pinned actions |
| Artifact | SBOM, signature, provenance attestation, immutable digests |
| Deploy | Admission policy verifying signature + provenance |
| Runtime | Vulnerability re-scan against SBOM, runtime monitoring |
SBOMs: know what you ship
An SBOM is an inventory of packages, versions, licenses, and relationships. Two dominant formats:
- SPDX (Linux Foundation, ISO standard): strong on licensing and compliance.
- CycloneDX (OWASP): security-oriented, supports vulnerability and VEX data natively.
Either is acceptable; choose one that your scanners and customers accept.
Generate an SBOM for a container image
# Syft: broad ecosystem support
syft scan ghcr.io/acme/api:1.4.2 -o spdx-json=sbom.spdx.json
syft scan ghcr.io/acme/api:1.4.2 -o cyclonedx-json=sbom.cdx.json
# Scan the SBOM (not the image) with Grype
grype sbom:./sbom.spdx.json --fail-on highWhy SBOMs help in a real incident
When a critical library vulnerability is announced, you do not want to grep 200 repositories. Store SBOMs per released artifact in a searchable system (Dependency-Track is a common open-source choice) and the question "which production services contain this library at this version?" becomes a single query.
# Quick local check
jq -r '.packages[] | select(.name=="log4j-core") | "\(.name) \(.versionInfo)"' sbom.spdx.jsonSBOM caveats
- A scanner-generated SBOM is a best-effort inventory. Statically linked binaries, vendored code, and runtime downloads can be missed. Prefer build-time generation from the package manager's own data when possible.
- Presence is not exploitability. Use VEX (Vulnerability Exploitability eXchange) statements to say "this CVE exists in the package but is not reachable" so consumers aren't buried in noise.
A VEX statement in practice
A VEX document tells consumers whether a vulnerability in an included component actually affects the product. A minimal OpenVEX example:
{
"@context": "https://openvex.dev/ns/v0.2.0",
"@id": "https://example.com/vex/2026-001",
"author": "Acme Security",
"timestamp": "2026-11-01T10:00:00Z",
"version": 1,
"statements": [
{
"vulnerability": { "name": "CVE-2026-0000" },
"products": [{ "@id": "pkg:oci/api@sha256:3f1c" }],
"status": "not_affected",
"justification": "vulnerable_code_not_in_execute_path"
}
]
}The CVE id above is a placeholder. Grype and other scanners can consume VEX to suppress findings you have triaged, which keeps the signal high.
SLSA: provenance you can verify
SLSA defines levels of build integrity. At a practical level, the useful target for most teams is: a hosted, isolated build platform generates signed provenance that the build steps themselves cannot forge.
Provenance is a signed statement (in-toto attestation format) stating:
- which artifact (digest) was built,
- from which source repo, commit, and workflow,
- on which builder, with what parameters.
A consumer can then check: "this image digest was built by this exact workflow from this repository's main branch" and reject everything else.
What the SLSA Build levels mean
SLSA v1.x defines a Build track with levels (check the current spec at slsa.dev for exact wording):
| Level | Plain-language meaning | Typical way to get there |
|---|---|---|
| Build L0 | No guarantees | Builds on a laptop |
| Build L1 | Provenance exists, but it can be forged or incomplete | Any CI that emits provenance |
| Build L2 | Provenance is generated and signed by the hosted build platform | Hosted CI with signed attestations |
| Build L3 | Builds are isolated from each other and the signing material is not accessible to your build steps | Hardened platform, such as reusable workflows with isolated provenance generation |
The practical lesson: provenance generated inside your own build script is only as trustworthy as that script. Provenance generated by the platform or a reusable workflow outside your control is what raises the level, because a compromised build step cannot rewrite it.
Generating provenance in GitHub Actions
The reference approach is the SLSA GitHub generator, or GitHub's built-in artifact attestations. A built-in attestation workflow looks like this:
name: release
on:
push:
tags: ["v*"]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write # OIDC token for keyless signing
attestations: write # store provenance attestation
steps:
- uses: actions/checkout@<full-commit-sha> # pin by SHA, not tag
- uses: docker/setup-buildx-action@<full-commit-sha>
- uses: docker/login-action@<full-commit-sha>
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: build
uses: docker/build-push-action@<full-commit-sha>
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
provenance: mode=max
sbom: true
- uses: actions/attest-build-provenance@<full-commit-sha>
with:
subject-name: ghcr.io/${{ github.repository }}
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: trueAction inputs and defaults change between major versions (for example, the attest actions were consolidated in late 2025), so check each action's README before copying. Replace <full-commit-sha> with the 40-character commit SHA of the action release you have reviewed. Pinning by SHA matters because tags are mutable; the 2025 compromise of a popular GitHub Action showed attackers rewriting tags to run malicious code in downstream pipelines.
Workflow hardening that SLSA assumes
# Top of every workflow: default to read-only token
permissions: {}
# Avoid pull_request_target with untrusted code checkout
# Never interpolate untrusted input directly into run scripts:
# BAD: run: echo "${{ github.event.pull_request.title }}"
# GOOD: pass via env and quote it
- run: echo "$TITLE"
env:
TITLE: ${{ github.event.pull_request.title }}Other essentials: ephemeral runners (no state persisting between jobs), no long-lived cloud credentials (use OIDC federation to your cloud), and environment protection rules with required reviewers for production deploy jobs.
Sigstore: keyless signing
Traditional signing requires managing a private key, which becomes a high-value target and an operational burden. Sigstore replaces long-lived keys with:
- Fulcio: a certificate authority that issues a short-lived (about ten minutes) certificate bound to an OIDC identity (for example, your GitHub Actions workflow).
- Rekor: a public, append-only transparency log that records the signature so it can be audited later.
- cosign: the CLI that signs and verifies.
Sign an image
# In CI with id-token: write, no key needed
cosign sign --yes ghcr.io/acme/api@sha256:3f1c...e9
# Attach the SBOM as a signed attestation
cosign attest --yes --predicate sbom.spdx.json --type spdxjson \
ghcr.io/acme/api@sha256:3f1c...e9Always sign digests, not tags. A tag can be moved to a different image after signing; a digest is immutable.
Verify a signature
Verification must pin the identity that is allowed to sign, not just "any valid signature":
cosign verify ghcr.io/acme/api@sha256:3f1c...e9 \
--certificate-identity "https://github.com/acme/api/.github/workflows/release.yml@refs/tags/v1.4.2" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com"Using a regular expression for flexibility is common:
cosign verify "$IMAGE" \
--certificate-identity-regexp '^https://github.com/acme/api/\.github/workflows/release\.yml@refs/tags/v.*$' \
--certificate-oidc-issuer https://token.actions.githubusercontent.comKeep the regexp tight. A loose pattern such as .*acme.* defeats the purpose.
Verify provenance and SBOM attestations
With GitHub's built-in attestations you can verify from the command line, and with cosign you can verify and read attached attestations:
# GitHub CLI: verify provenance for an image or file, pinning the repo
gh attestation verify oci://ghcr.io/acme/api@sha256:3f1c...e9 --repo acme/api
# cosign: verify the SBOM attestation and print its predicate
cosign verify-attestation --type spdxjson "$IMAGE" \
--certificate-identity-regexp '^https://github.com/acme/api/\.github/workflows/release\.yml@refs/tags/v.*$' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
| jq -r '.payload | @base64d | fromjson | .predicate.name'Recent cosign releases changed some defaults (new bundle formats and verification flags). If a command from an older tutorial fails, read the release notes of your cosign version rather than copying workarounds.
What a signature does and does not prove
A valid signature from your release workflow proves who built it and from what workflow identity. It does not prove the code is free of vulnerabilities or backdoors. If an attacker merges a malicious commit to a protected branch and your release workflow builds it, the artifact is correctly signed. That is why branch protection, reviews and dependency controls remain necessary.
Private deployments and the public log
Keyless signing writes to the public Rekor log, which leaks repository and workflow names. For private repositories you may prefer a private Sigstore deployment or key-based signing with a KMS-held key. Weigh the privacy concern against the operational cost.
Enforce at deploy time
Signing and attesting are only valuable if something refuses to run unsigned images.
Kubernetes admission with Kyverno
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: require-signed-images
spec:
validationFailureAction: Enforce
webhookTimeoutSeconds: 30
rules:
- name: verify-cosign-signature
match:
any:
- resources:
kinds: [Pod]
verifyImages:
- imageReferences:
- "ghcr.io/acme/*"
attestors:
- entries:
- keyless:
issuer: "https://token.actions.githubusercontent.com"
subject: "https://github.com/acme/*/.github/workflows/release.yml@refs/tags/*"
rekor:
url: https://rekor.sigstore.devAlternatives include the Sigstore policy-controller and Ratify/Gatekeeper setups. Whichever you pick, roll it out in audit mode first, fix violations, then enforce.
Also require images to be referenced by digest in manifests (Kustomize or Helm can pin digests), so what you verified is what runs.
Dependencies: the upstream half
- Lockfiles and
--frozen-lockfile/npm ci/cargo --locked/go mod verifyin CI so builds are reproducible. - Cooldown periods for new package versions (for example, do not auto-adopt versions younger than 3-7 days). Most malicious releases are detected and pulled within days.
- Private registry proxy (Artifactory, Nexus, Verdaccio, GitHub Packages) with allowlists and scanning.
- Dependency review in PRs (GitHub dependency-review-action, Renovate with grouped updates and review).
- Check package provenance where registries support it (npm provenance, PyPI trusted publishing/attestations, crates.io trusted publishing).
- Minimize dependencies. Every package is a trust relationship. The cheapest vulnerable dependency is the one you never added.
# Examples of reproducibility gates in CI
npm ci --ignore-scripts # install exactly the lockfile, no install scripts
go mod verify # verify module hashes against go.sum
cargo build --locked && cargo deny check advisories licenses bans
pip install --require-hashes -r requirements.txtReproducible, minimal artifacts
- Use minimal base images (distroless, Chainguard, scratch) to shrink the attack surface and SBOM noise.
- Pin base images by digest and update them with a bot.
- Aim for reproducible builds where feasible: the same source yields bit-identical output, letting independent parties verify your artifact. Start by removing timestamps and non-deterministic ordering.
FROM gcr.io/distroless/static-debian12@sha256:<digest>
COPY --chown=nonroot:nonroot server /server
USER nonroot
ENTRYPOINT ["/server"]Putting it together: a pipeline blueprint
PR opened
├─ dependency-review, SAST, secret scan
└─ tests (no secrets, forked PRs get read-only token)
merge to main (protected, reviews required)
└─ build job (ephemeral runner, pinned actions, OIDC)
├─ build image by digest
├─ generate SBOM (syft) ─> cosign attest
├─ provenance attestation (SLSA)
├─ cosign sign (keyless)
└─ scan SBOM (grype) ─> fail on critical
deploy (environment approval)
└─ cluster admission verifies signature + provenance identity
runtime
└─ nightly re-scan stored SBOMs against fresh vulnerability dataMetrics that show you are improving
- Percentage of production images signed and verified at admission.
- Percentage of GitHub Actions pinned to SHAs.
- Median time to answer "which services contain package X?" (target: minutes).
- Number of long-lived credentials in CI (target: zero).
- Mean time to patch critical dependency vulnerabilities.
Measuring repository hygiene with OpenSSF Scorecard
OpenSSF Scorecard runs automated checks (pinned dependencies, token permissions, branch protection, dangerous workflows, signed releases) and gives you a concrete to-do list.
# Run against a repo (needs a GitHub token in GITHUB_AUTH_TOKEN)
scorecard --repo=github.com/acme/api --format=json | jq '.checks[] | {name, score}'Use it as a trend, not a trophy: a score of 10 does not mean you are safe, and some checks do not apply to every project.
When a dependency or action is compromised
Prepare the runbook before you need it:
- Identify exposure. Query stored SBOMs for the affected package and version. Search workflow files for the compromised action.
- Contain. Disable affected workflows, pin to a known-good SHA, block the version in your registry proxy.
- Rotate. Assume any secret exposed to the compromised step is burned. Prefer short-lived OIDC credentials so there is less to rotate.
- Rebuild and redeploy from a clean state, then verify signatures and provenance on the new artifacts.
- Look back. Check CI logs for the exposure window and audit outbound network calls from runners.
- Learn. Add the missing control (pinning, egress filtering, cooldown) and record the timeline.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
cosign verify says no matching signatures | Signed a tag that moved, or verifying the wrong digest | Sign and verify by digest |
| Identity mismatch on verify | Certificate identity includes the ref (tag or branch) | Use a tight regexp that matches your ref pattern |
| Signing fails with an OIDC error in Actions | Missing id-token: write permission | Add it to the job, not the whole workflow |
| Admission webhook blocks all pods | Policy too broad, or registry unreachable | Start in audit mode, scope imageReferences, check network access |
| SBOM missing libraries | Scanner could not detect vendored or static code | Generate from the package manager at build time |
| Provenance not found for multi-arch image | Attested a platform digest, not the index digest | Attest the digest the registry reports for the tag you deploy |
| Rekor lookup timeouts in CI | Public service latency | Retry with backoff; consider caching bundles |
Where this usually goes wrong
- Signing images but never verifying them.
- Verifying with "any valid signature" instead of a pinned identity.
- Pinning actions by tag and assuming that is safe.
- Giving workflows
write-alltoken permissions by default. - Using
pull_request_targetwith a checkout of untrusted code. - Producing SBOMs and then never storing or querying them.
- Treating a clean vulnerability scan as proof of integrity. Scanning checks for known CVEs, not tampering.
When this is overkill
- A solo hobby project with no deployments: pin dependencies, enable 2FA and Dependabot, skip the rest.
- Internal tools with a single trusted deployer and no regulatory obligations: start with SBOM generation and pinned actions; add signing when you have a verifier.
- Do not adopt admission enforcement before you can answer "who owns the exceptions process?"
Checklist
- 2FA or passkeys and branch protection with required reviews on all repos.
- Workflows default to
permissions: {}; jobs request only what they need. - Actions and base images pinned by digest and updated by a bot.
- No long-lived cloud credentials in CI; OIDC federation instead.
- SBOM generated per release and stored in a queryable system.
- Images signed keyless by digest; provenance attested.
- Admission policy verifies identity in audit mode, then enforce.
- Incident runbook tested once with a tabletop exercise.
A few questions
Do I need both an SBOM and provenance? They answer different questions: contents versus origin. Provenance without an SBOM tells you where it was built but not what is inside, and vice versa.
Is Sigstore only for containers? No. Cosign signs blobs and other OCI artifacts, and ecosystems such as npm, PyPI and Maven Central integrate Sigstore-based attestations or trusted publishing.
SPDX or CycloneDX? Pick what your tools and customers consume. Many tools convert between them.
Does SLSA require GitHub? No. It is a specification; GitHub, GitLab, Google Cloud Build and others provide ways to produce provenance.
Can an attacker abuse keyless signing? Only by running a workflow that matches your allowed identity, which is why pinning the identity and protecting the workflow files and branches matters.