Skip to content
Blog

SLSA Levels for Container Supply Chains in Practice

What SLSA build levels 0-3 actually require for a container image build, how to generate provenance with slsa-github-generator, Tekton Chains, or GitHub attestations, and how to verify it in CI.

Published on • November 15, 2026

AI Assistant

SLSA (“salsa”) is the closest thing the industry has to a shared vocabulary for supply-chain integrity: a framework of compliance levels that say, concretely, how much you can trust the claim “this artifact was built from this source, this way.” For container images specifically, SLSA answers a narrow question — can you prove how your image was built, and can an attacker easily fake that proof? This post maps SLSA’s build levels onto real container pipelines, shows how to generate signed provenance with the tools teams actually use, and covers the verification half that most write-ups skip.

From SLSA 1–4 to Tracks and Build Levels

SLSA started in 2021 as a single scale from 1 to 4. Version 1.0 restructured it into tracks — each measuring one aspect of supply-chain security so progress in one doesn’t block on another — and made the build track the centerpiece, with source requirements folded out (a source track may come later). The current spec on slsa.dev is v1.2; the v1.0 build-track model remains the reference most documentation and tools cite, and it looks like this:

LevelRequirementThreat addressed
Build L0None — the absence of SLSAAnything goes; think docker build on a laptop
Build L1Provenance exists showing build platform, process, and top-level inputsMistakes (e.g., building from a commit that isn’t upstream)
Build L2Signed provenance generated by a hosted build platform; consumers verify the signatureTampering after the build; casual forgery
Build L3Hardened build platform: runs isolated from each other, and the provenance signing key is inaccessible to build stepsTampering during the build (compromised credentials, malicious build scripts, co-tenant attackers)

Two clarifications that prevent most level-confusion:

  • L1 provenance can be unsigned and even incomplete. It exists to make builds reproducible and debuggable, not to stop adversaries — the spec calls it “trivial to bypass or forge.”
  • L2’s signature is what changes the game. Because a trusted platform signs it, forging provenance now requires compromising the build service itself — an “explicit attack,” even if still feasible.
  • L3 is about the platform, not your YAML. Strong isolation between runs (even within one project) and keeping signing secrets out of the reach of user-defined build steps are properties of the build infrastructure. You can’t bolt L3 onto a self-hosted runner fleet by editing a workflow file.

Provenance content is specified separately: the SLSA Provenance predicate (v1 uses https://slsa.dev/provenance/v1; v0.2 was https://slsa.dev/provenance/v0.2) defines fields like the build platform’s URI, the build configuration (repo, commit, workflow), resolved dependencies (with digests), and run details. The levels say how trustworthy the provenance’s origin is; the predicate says what it must contain.

What Each Level Means for a Container Image

Walking the ladder with a concrete image, ghcr.io/acme/ledger-service:

  • L0: docker build -t ledger-service . on a developer’s laptop, pushed by hand. No record of what source produced it. This is where most images actually live.
  • L1: Your CI runs docker buildx build --provenance=mode=max, and BuildKit writes a provenance statement recording the context, frontend, and build steps. The provenance travels with the image — but it’s self-asserted; anyone could have produced it.
  • L2: GitHub Actions runs actions/attest-build-provenance, or slsa-framework/slsa-github-generator’s reusable container workflow, producing provenance signed by GitHub’s OIDC-backed identity and stored with the image via the attestations API. Now an attacker must compromise GitHub’s infrastructure (or your workflow’s OIDC subject) to forge a claim — and consumers verify the signature before trusting it.
  • L3: The build runs on GitHub’s hardened, ephemeral, isolated runner infrastructure (for slsa-github-generator’s L3 generators) or an equivalently hardened platform — Tekton with isolated, ephemeral workers and signing keys held in KMS inaccessible to the task’s build steps. A malicious RUN step in your Dockerfile can’t reach the key that signs the provenance, and can’t influence another project’s build.

Notice L1→L2→L3 is largely a migration of where you build, not what you build: the same Dockerfile, on progressively more trustworthy platforms.

Generating Provenance in Practice

Three paths cover most teams:

1. GitHub Actions attestations (simplest L2).

permissions:
  id-token: write        # OIDC token for signing identity
  attestations: write    # write attestations
  contents: read

steps:
  - uses: actions/checkout@v4
  - id: build
    run: |
      docker build -t ghcr.io/acme/ledger-service:${{ github.sha }} .
      docker push ghcr.io/acme/ledger-service:${{ github.sha }}
      echo "digest=$(docker inspect --format='{{.Digest}}' ghcr.io/acme/ledger-service:${{ github.sha }})" >> "$GITHUB_OUTPUT"
  - uses: actions/attest-build-provenance@v2
    with:
      subject-name: ghcr.io/acme/ledger-service
      subject-digest: ${{ steps.build.outputs.digest }}
      push-to-registry: true

2. slsa-github-generator (L3-grade provenance). The generator_container_slsa3.yml reusable workflow builds (or receives) your image and emits provenance signed by the generator, bound to the tagged source, following GitHub’s L3-oriented design. It’s the standard answer for “we need SLSA Build L3 provenance from GitHub Actions without building our own platform.” Note the constraint inherent in L3: the workflow must run on the supported, pinned, hardened infrastructure — you can’t run it on your own runner and claim the same level.

3. Tekton Chains (Kubernetes-native). On a Tekton cluster, Chains observes every TaskRun, generates in-toto/SLSA provenance from the task’s results (inputs, outputs, git commit), and signs it — with your choice of key (KMS, Kosli, or cosign key pair). Isolate the Tekton controller and workers and keep the signing key in KMS to aim at L3.

BuildKit deserves a mention as the floor: docker buildx build --provenance=mode=max --sbom=true attaches both a provenance predicate and an SBOM to any image, from any CI — but it’s L1 until someone trusted signs it. Cosign can sign BuildKit’s output after the fact, which converts self-asserted provenance into platform-signed provenance — the L1→L2 jump.

Verifying Provenance

Provenance that nobody verifies is decoration. With cosign:

cosign verify-attestation \
  --type https://slsa.dev/provenance/v1 \
  --certificate-identity-regexp 'https://github.com/acme/ledger-service/.*' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  ghcr.io/acme/ledger-service@sha256:9b4d...c7f1

Then check the predicate content itself — the signature only proves it came from your workflow, not that it says what you need:

cosign verify-attestation \
  --type https://slsa.dev/provenance/v1 \
  ghcr.io/acme/ledger-service@sha256:9b4d...c7f1 | jq -r '.predicate | {
    builder: .runDetails.builder.id,
    source:  .buildDefinition.externalParameters.workflow.repository,
    commit:  .buildDefinition.resolvedDependencies[0].digest.gitCommit
  }'

The slsa-verifier CLI is the purpose-built alternative for checking provenance from the SLSA generators against the expected source repository and tag. What you verify at minimum: the attestation type, the signing identity (workflow/repo), the source URI and commit, and — for containers — that the subject digest matches the image you’re about to deploy (always pin digests, never tags).

Mapping SLSA to Everyday CI

Your CIPath to L1Path to L2Path to L3
GitHub ActionsBuildKit --provenanceactions/attest-build-provenanceslsa-github-generator
Tekton / Argo on K8sBuildKit or Chains unsigned outputChains + cosign key/KMS signingChains on isolated runners, KMS-held key
GitLab / Jenkins / otherBuildKit --provenanceSign BuildKit output with cosign (platform key)Hardened ephemeral build infra + KMS
Cloud build (Cloud Build, CodeBuild)Built-in provenance flagsPlatform OIDC signing (e.g., Cloud Build attestations)Platform’s hardened pool + managed key

Whatever the toolchain, the same operational habits apply: pin third-party actions and base images by digest, scope OIDC permissions tightly, keep signing keys out of user-controlled build steps (that’s literally the L3 requirement), distribute provenance where consumers expect it (OCI referrers or the registry’s attestation API), and fail deploys on verification failure.

Practical Pitfalls

  • L1 is a documentation exercise, not a security control. Teams often stop there because the badge looks good; make sure someone owns the L2 migration.
  • Unsigned or self-signed provenance verifies against nothing. If your “verification” step is jq on a locally generated file, you have an audit artifact, not a control.
  • Tag-based subject matching is forgeable. Provenance binds to a digest; a mutable tag can be retargeted between build and deploy. Pin digests in your admission policy.
  • SLSA ≠ vulnerability-free. It proves how the image was built, not that the code is safe. Pair provenance with SBOMs and scanning — different questions, different attestations.
  • Levels are about your whole platform. One workflow at “L3” doesn’t make the pipeline L3 if the same runners publish production releases with weaker controls.

Start by getting provenance generated and verified end-to-end for one critical image — L2 on a hosted platform is the highest-leverage step most teams can take this quarter — then invest in the platform hardening that L3 requires.

References