Build Provenance with SLSA

SecuritySupply ChainSLSADevOps
Share on LinkedIn Share on X Share on Reddit Share on HN Share on Bluesky

After the SolarWinds and Codecov incidents, our security team stopped asking "did we scan for CVEs?" and started asking "can we prove this binary was built from our source code by our CI system?" Vulnerability scanning catches known bad dependencies. Provenance catches the case where someone else's build pipeline — or an attacker who compromised it — produced the artifact you're about to deploy.

SLSA (Supply-chain Levels for Software Artifacts, pronounced "salsa") is a framework from Google and the OpenSSF that defines progressive levels of build pipeline security. At its core is provenance: a signed attestation that links an artifact to its exact source, builder, and build parameters.

SLSA levels at a glance

Level Requirements What it prevents
1 Documented build process Undocumented tampering
2 Hosted build + provenance Ad-hoc local builds sneaking in
3 Non-falsifiable provenance, hermetic builds Builder compromise going undetected
4 Two-person review, reproducible builds Single-actor insider threats

Level 2 is the sweet spot for most engineering teams. You generate provenance automatically in CI, store it with the artifact, and verify it at deployment time.

What provenance contains

A SLSA provenance attestation is a JSON document signed by the build platform:

{
  "_type": "https://in-toto.io/Statement/v1",
  "subject": [{ "name": "my-app:v1.2.3", "digest": { "sha256": "abc..." } }],
  "predicateType": "https://slsa.dev/provenance/v1",
  "predicate": {
    "buildDefinition": {
      "buildType": "https://github.com/actions/runner",
      "externalParameters": {
        "repository": "https://github.com/org/my-app",
        "ref": "refs/heads/main",
        "workflow": { "path": ".github/workflows/release.yml" }
      }
    },
    "runDetails": {
      "builder": { "id": "https://github.com/actions/runner/v2" },
      "metadata": {
        "invocationId": "https://github.com/org/my-app/actions/runs/12345"
      }
    }
  }
}

This says: artifact my-app:v1.2.3 with SHA256 abc... was built by GitHub Actions runner from commit on main using the release workflow. An attacker can't produce this attestation without access to your CI system.

Generating provenance with GitHub Actions

GitHub Actions has built-in SLSA provenance generation for workflows using slsa-framework/slsa-github-generator:

name: Release
on:
  push:
    tags: ["v*"]

jobs:
  build:
    permissions:
      contents: read
      packages: write
      id-token: write  # Required for OIDC signing
    uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
    with:
      image: ghcr.io/org/my-app
      digest: ${{ needs.build.outputs.digest }}

The generator produces provenance signed via Sigstore's keyless signing (OIDC-based, no long-lived keys to manage). Attestations are stored in the GitHub Container Registry alongside the image or uploaded to a transparency log.

For generic artifacts (JARs, binaries, npm packages):

- uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
  with:
    base64-subjects: "${{ needs.build.outputs.hashes }}"
    upload-assets: true

Verifying provenance at deploy time

Use slsa-verifier to check artifacts before deployment:

slsa-verifier verify-image \
  ghcr.io/org/[email protected] \
  --source-uri github.com/org/my-app \
  --source-tag v1.2.3

In a Kubernetes admission controller or deploy pipeline:

# Fail deploy if provenance doesn't match policy
slsa-verifier verify-artifact my-app.jar \
  --provenance-path provenance.intoto.jsonl \
  --source-uri github.com/org/my-app \
  --builder-id "https://github.com/actions/runner/v2"

Policy-as-code tools (Kyverno, OPA) can enforce that only images with valid SLSA provenance from approved builders enter production clusters.

Hermetic builds (Level 3)

A hermetic build only uses declared inputs — no network access during compilation, no reading undeclared files. This ensures the provenance fully describes how the artifact was produced.

Practical steps toward hermetic builds:

Full hermeticity is hard for ecosystems that fetch dependencies at build time (npm install during Docker build). Mitigate by multi-stage builds that copy pre-resolved node_modules from a locked-deps stage.

Signing artifacts with Sigstore

SLSA provenance uses Sigstore for signing and verification:

cosign sign ghcr.io/org/[email protected]
cosign verify ghcr.io/org/[email protected] \
  --certificate-identity-regexp="https://github.com/org/my-app" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com"

Getting started this week

  1. Add SLSA provenance generation to your release workflow (Level 2).
  2. Commit lockfiles and use frozen installs (foundation for Level 3).
  3. Add slsa-verifier to your deploy pipeline to reject unprovenanced artifacts.
  4. Enable Dependabot/Renovate for controlled dependency updates.
  5. Document your build process in a BUILD.md (Level 1, if nothing else).

Resources

Field notes on supply chain provenance slsa

Supply-chain controls for supply chain provenance slsa only work when attestations are verified in the deploy path, not merely generated for auditors.

For supply chain provenance slsa:

Tabletop a compromised builder scenario — detection time and revoke path matter more than tool logos.

Signal Target Alarm
Latency p99 Team-defined SLO Page on burn rate
Error rate Baseline − noise Ticket if sustained
Cost per 1k ops Budget cap Weekly review

Metrics and alarms for supply chain provenance slsa

Reviewers should challenge assumptions encoded in supply chain provenance slsa: defaults copied from tutorials, timeouts that exceed upstream SLAs, and authz checks applied only on the primary UI path. Require a short threat or failure note in the PR when the change touches a trust boundary.

Concrete probes:

  1. Scenario A for supply chain provenance slsa: partial dependency outage — prove clients degrade gracefully and retries do not amplify load.
  2. Scenario B for supply chain provenance slsa: bad config shipped — prove rollback within the declared RTO without data corruption.
  3. Scenario C for supply chain provenance slsa: traffic 3× baseline — prove autoscaling or shedding keeps the golden journey healthy.

Post-incident changes after supply chain provenance slsa failures

Roll out supply chain provenance slsa behind a flag or weighted route when possible. Start with internal users or a low-risk geography. Watch the signals in the table for at least one full business cycle before calling the migration done. Keep the previous path warm until error budgets stabilize.

Document the owner, the dashboard, and the single command that reverts the change. If that sentence is hard to write, the design is not ready for production traffic.

Caching interactions with supply chain provenance slsa

Detail 1 (600): for supply chain provenance slsa, define the contract between producers and consumers explicitly — payload shape, timeout, and idempotency key. When caching interactions with supply chain provenance slsa becomes painful, it is usually because that contract was implicit.

I keep a short matrix: who can break supply chain provenance slsa, how we detect it within five minutes, and who is paged. Update the matrix when ownership moves. Add one synthetic check that exercises the failure path, not only the happy path. Prefer checks that run continuously over quarterly manual reviews that everyone skips under deadline pressure.

If you only remember one thing about supply chain provenance slsa: optimize for reversible decisions. Reversibility beats cleverness when the incident channel is busy and the blast radius is unclear.

Multi-tenant concerns in supply chain provenance slsa

Detail 2 (883): for supply chain provenance slsa, define the contract between producers and consumers explicitly — payload shape, timeout, and idempotency key. When multi-tenant concerns in supply chain provenance slsa becomes painful, it is usually because that contract was implicit.

I keep a short matrix: who can break supply chain provenance slsa, how we detect it within five minutes, and who is paged. Update the matrix when ownership moves. Add one synthetic check that exercises the failure path, not only the happy path. Prefer checks that run continuously over quarterly manual reviews that everyone skips under deadline pressure.

If you only remember one thing about supply chain provenance slsa: optimize for reversible decisions. Reversibility beats cleverness when the incident channel is busy and the blast radius is unclear.

Frequently asked questions

What SLSA level should my project target?

Most teams should target SLSA Build Level 2 as a practical first milestone — hosted build platform with provenance generation. Level 3 adds non-falsifiable provenance and hermetic builds, requiring more infrastructure investment. Level 4 (two-person review, reproducible builds) is appropriate for critical infrastructure like crypto libraries or OS packages. Start at Level 1 (documented build process) and increment.

How does SLSA provenance differ from an SBOM?

An SBOM lists what went into your artifact — dependencies, versions, licenses. SLSA provenance describes how the artifact was built — which source commit, which builder, which workflow, what inputs. SBOM answers 'what's inside?' Provenance answers 'who built this and from what?' Both are complementary; SLSA provenance often references the SBOM as a build material.

Can I verify SLSA provenance in my deployment pipeline?

Yes — tools like slsa-verifier check that an artifact's provenance attestation matches your policy (expected builder, source repository, branch). Container registries (GitHub Container Registry, Google Artifact Registry) store attestations alongside images. Your deploy pipeline rejects artifacts without valid provenance or with provenance from unexpected sources.

Hiring a senior Android / Flutter engineer?

I architect and ship production mobile software — Kotlin, Jetpack Compose, Flutter — for robotics, EV infrastructure, fintech, and real-time systems. Open to remote roles in Europe and the US.

Get in touch →