SecurityVol. 10 · Part X
0 / 0

Shelves / Security

SE·112

Software Supply Chain Security

Defending everything between a developer's keyboard and production: the anatomy of supply-chain attacks (SolarWinds, Codecov, xz-utils, event-stream, dependency confusion, typosquatting, compromised maintainers and CI), dependency hygiene with lockfiles, pinning and transitive risk across npm, pip, Maven, Go modules, Cargo and Zig, vulnerability scanning, SBOMs (SPDX, CycloneDX), provenance and SLSA levels, signing with Sigstore and cosign, hardened CI/CD and trusted builds, reproducible builds, and package registry integrity.

29 topics · ~18 min read · 30-question quiz
Updated Suggest a correction

Start here: trusting code you didn't write

Most of the code in your product was written by strangers: libraries, their dependencies, base images, build tools, CI actions. The software supply chain is everything between someone writing code and it running in your production, and attackers increasingly target it because one compromised package reaches thousands of victims at once. The defences answer four questions: what am I running, is any of it known to be vulnerable, is it exactly what I meant to download, and was it built by who I think, from the source I think?

What am I running? An SBOM

Syft listed the contents of two images as a software bill of materials:

Text
alpine:3.22  → SPDX-2.3, 17 packages: busybox 1.37.0-r20, libcrypto3 3.5.9-r0, libssl3 3.5.9-r0,
               musl 1.2.5-r13, zlib 1.3.2-r1, ca-certificates-bundle 20261020-r0, …
tiffin:2.2   → CycloneDX 1.6, 3 components: stdlib go1.24.7, tiffin (a static Go binary), /tiffin

The scratch-based tiffin image contains one binary, so the only third-party code in it is the Go standard library it was compiled with. When the next OpenSSL or Go advisory lands, an SBOM answers "are we affected, and where?" in minutes instead of days.

Is any of it known to be vulnerable? Scanning

pip-audit checked a three-line, five-year-old requirements.txt against published advisories:

Text
requests   2.25.0    4 advisories   fixed by 2.33.0
urllib3    1.26.4   11 advisories   fixed by 2.8.0
jinja2     2.11.2    5 advisories   fixed by 3.1.6
idna       2.10      2 advisories   fixed by 3.15
after upgrading all four: No known vulnerabilities found

22 known issues hid in three pins, most of them pulled in transitively (urllib3 and idna came via requests). Even the "current" requests 2.32.5 was flagged once, fixed in 2.33.0: scanning is continuous, not a one-off.

Is it exactly what I meant? Hash pinning

A lockfile entry with the wheel's SHA-256 (--require-hashes). With one hex digit changed:

Text
THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. …
someone may have tampered with them.
  Expected sha256 f48adeaf8c2d788c40fee287673ccaa74c24ffd8dcf09ffa555a2fbb59f10ac8
       Got        048adeaf8c2d788c40fee287673ccaa74c24ffd8dcf09ffa555a2fbb59f10ac8

A version number says what you asked for; a hash says what you must get. If a registry, mirror or proxy serves different bytes under the same version, the install stops. package-lock.json, go.sum, Cargo.lock and Gradle's verification metadata do the same.

Who built it? Signatures and reproducible builds

The tiffin binary signed with a cosign key pair:

Text
verify genuine:              Verified OK
verify tampered (1 byte):    invalid signature when validating ASN.1 encoded signature
verify with a different key: invalid signature when validating ASN.1 encoded signature

And the same source built twice in two different directories:

Text
default build:           /src/a → 6cd8077f…   /work/b → c2a682e4…   (different)
-trimpath, no build id:  /src/a → faa240f0…   /work/b → faa240f0…   (identical)

A signature proves who released an artefact and that it hasn't changed since. A reproducible build lets anyone rebuild from source and get the identical bytes, which proves the binary really came from that source; the default build embedded the directory path, so it wasn't reproducible until -trimpath removed it.

How deep to go in software supply chain security

Volume 17 defines six mastery levels. For this chapter they look like this; the chapter aims at L3 everywhere, and its lab at L4.

Level What you can do
L1 Explain the supply chain and the classic attacks (typosquatting, dependency confusion, compromised maintainer or CI)
L2 Use lockfiles with hashes, scan dependencies in CI, generate SBOMs and pin CI actions by commit
L3 Explain signing (Sigstore), provenance and SLSA levels, reproducible builds and registry trust
L4 Audit a project's dependency tree and build pipeline and verify artefacts' signatures and provenance
L5 Design an organisation's trusted build and release pipeline with admission-time verification
L6 Set supply-chain policy (approved sources, SBOM and provenance requirements, vendor assurance) across an organisation

Why the supply chain is a target

Modern software is mostly other people's code: a typical service has hundreds to thousands of transitive dependencies, base images, build tools, CI actions, and SaaS integrations. Attackers target the supply chain because compromising one widely used component or build system gives access to many downstream victims. OWASP added A03:2025 Software Supply Chain Failures to the Top 10 for this reason.

source dependencies build artifact deploy A accounttakeover B typosquatconfusion C hijackedCI/actions D tamperedartifact E unverifieddeploy defences: protected branches · lockfiles + review · isolated builds + provenancesignatures (Sigstore) · SBOM · verify at admission
Attack points in the software supply chain. Every stage from source code through dependencies, the build system, artifact storage and distribution to deployment is a place an attacker can insert or substitute malicious code. Defences map to each stage: protected source, vetted pinned dependencies, hardened isolated builds with provenance, signed artifacts, and verification at deploy time.

Notable attacks

Attack Year What happened Lesson
event-stream (npm) 2018 A new maintainer added a dependency that stole cryptocurrency wallets from a specific app Maintainer handover risk; monitor new transitive deps
SolarWinds Orion 2020 Attackers compromised the build system, injecting a backdoor into signed updates shipped to ~18,000 customers Signing proves who built it, not that the build was clean: secure builds and provenance
Dependency confusion 2021 Researcher published public packages with the names of companies' internal packages at higher versions; package managers preferred them Scope/namespace internal packages, configure registries explicitly
Codecov 2021 Modified bash uploader script exfiltrated CI environment variables (secrets) from thousands of pipelines Pin and verify scripts; minimise CI secrets
ua-parser-js, colors/faker 2021–22 Hijacked or sabotaged popular npm packages Lockfiles and delayed adoption of new versions
3CX 2023 A supply-chain compromise (itself via another compromised app) led to trojanised desktop clients Cascading supply chains
xz-utils backdoor 2024 A multi-year social-engineering campaign gained maintainer trust and hid a backdoor (targeting SSH via liblzma) in release tarballs, not in the Git repository Build from source repos, reproducible builds, maintainer sustainability
tj-actions/changed-files 2025 A popular GitHub Action was compromised; mutable tags were repointed to code that dumped CI secrets into logs Pin actions by commit SHA; least-privilege tokens
npm self-replicating worm ("Shai-Hulud") 2025 Malware in hijacked packages stole npm and cloud tokens and used them to publish infected versions of the victims' other packages Phishing-resistant MFA for maintainers, trusted publishing, short-lived tokens

Dependencies

Direct and transitive

You choose direct dependencies; they bring transitive ones you never reviewed. Most vulnerabilities and malicious packages arrive transitively. Practices:

  • Minimise dependencies: each one is code you run with full privileges. Prefer the standard library and well-maintained, widely used packages. For trivial functions, copy or write them.
  • Evaluate before adding: maintenance activity, number of maintainers, security policy, OpenSSF Scorecard, download counts versus name similarity (typosquats), install scripts.
  • Review dependency changes in pull requests: lockfile diffs, new transitive packages (GitHub dependency review action, Socket).
  • Wait before adopting brand-new versions (a cooldown of a few days catches many hijacked releases, which are usually detected and pulled quickly): Renovate's minimumReleaseAge, Dependabot cooldown settings, pnpm's minimumReleaseAge.

Lockfiles and pinning

A lockfile records the exact resolved version and integrity hash of every dependency, direct and transitive, so every build installs the same bytes:

Ecosystem Manifest → lockfile Integrity Notes
npm/pnpm/Yarn/Bun package.json → package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lock SHA-512 integrity Use npm ci (fails if lock and manifest disagree); disable install scripts where possible (ignore-scripts, pnpm blocks dependency lifecycle scripts by default since v10)
Python pyproject.toml → uv.lock, poetry.lock, requirements.txt with --require-hashes; standard pylock.toml (PEP 751) SHA-256 hashes pip install --require-hashes; prefer wheels over sdists (no build-time code execution)
Java (Maven/Gradle) pom.xml/build.gradle Gradle dependency verification (verification-metadata.xml), Gradle lockfiles Maven has no native lockfile: pin versions, use dependencyManagement/BOMs, enforce with Enforcer
Go go.mod → go.sum SHA-256 hashes, checked against the public checksum database (sum.golang.org) Minimal version selection; GOFLAGS=-mod=readonly; GOPRIVATE for internal modules
Rust Cargo.toml → Cargo.lock SHA-256 checksums Commit Cargo.lock for binaries (and now commonly libraries); cargo build --locked; build.rs and proc macros run code at build time
Zig build.zig.zon Each dependency carries a content hash (multihash) that must match Fetching by URL + hash; no central registry
C/C++ vcpkg manifests + baseline, Conan lockfiles Hashes in ports/recipes Vendoring and system packages are common

Pinning goes beyond application dependencies:

  • Container base images: by digest.
  • CI actions/plugins: GitHub Actions by full commit SHA (uses: actions/checkout@<commit-sha> # v5), not by mutable tags; Renovate/Dependabot update the SHAs.
  • Tools installed in CI (curl | sh installers): pinned versions with checksum verification.
  • Infrastructure providers and modules: Terraform .terraform.lock.hcl.

Dependency confusion and typosquatting

  • Dependency confusion: if an internal package name (acme-auth) could also be published publicly, a misconfigured resolver might fetch the attacker's public version. Fixes: scoped/namespaced packages (@acme/auth with the scope bound to your registry), a single internal proxy registry (Artifactory, Nexus, AWS CodeArtifact, GitHub Packages) configured as the only source with explicit upstream rules, and reserving your names on public registries.
  • Typosquatting (reqeusts, crossenv) and slopsquatting (packages registered under names that AI coding assistants hallucinate): verify names, use allow-lists for new dependencies, and tools (Socket, Phylum, Aikido, OSV malicious package feeds) that detect malicious behaviour (install scripts, network access, obfuscation).

Vulnerability scanning (SCA)

Software composition analysis matches your resolved dependencies against vulnerability databases: Dependabot/GitHub, Renovate with OSV, npm audit, pip-audit, cargo audit (RustSec), govulncheck (Go: reachability-aware, reports only vulnerabilities in functions your code actually calls), OWASP Dependency-Check, OSV-Scanner, Snyk, Trivy. Feed results into the same risk-based prioritisation as image vulnerabilities (chapter 111).

Shell
govulncheck ./...                       # Go: call-graph aware
cargo audit && cargo deny check         # Rust: advisories + licenses/bans/sources policy
pip-audit -r requirements.txt           # Python
npm audit --omit=dev                    # Node (noisy; combine with reachability tools)
osv-scanner scan source -r .            # multi-ecosystem via OSV.dev

SBOMs

A Software Bill of Materials lists the components (name, version, supplier, identifiers like purl and CPE, hashes, licences, dependency relationships) in a piece of software. It answers "are we affected?" in minutes when the next Log4Shell lands, and is increasingly required: US federal procurement (secure software attestation), the EU Cyber Resilience Act (vulnerability handling and SBOM obligations phasing in through 2027).

Format Steward Notes
SPDX (2.3, 3.0) Linux Foundation; ISO/IEC 5962 Strong on licensing; 3.0 adds security profiles
CycloneDX (1.6+) OWASP; ECMA-424 Security-focused; also VEX, services, ML models (ML-BOM), cryptography (CBOM)

Generate SBOMs at build time from the actual build inputs (Syft, Trivy, cdxgen, cyclonedx-maven-plugin, cargo-cyclonedx, cyclonedx-gomod, BuildKit --sbom), attach them to the artifact as signed attestations, store them centrally (Dependency-Track, GUAC), and pair them with VEX statements about exploitability.

Provenance and SLSA

Provenance

Provenance is verifiable metadata about how an artifact was built: which source repository and commit, which build platform and workflow, which inputs, when. Signed provenance lets consumers check that an artifact came from the expected repository via the expected trusted build, not from a developer's laptop or a tampered pipeline. The standard format is an in-toto attestation with a SLSA provenance predicate.

SLSA

SLSA (Supply-chain Levels for Software Artifacts, "salsa", OpenSSF) defines incremental levels. The Build track (v1.0/1.1):

Level Requirement Protects against
Build L0 Nothing —
Build L1 Provenance exists, describing how the artifact was built Mistakes; enables inventory
Build L2 Builds run on a hosted build platform that signs the provenance Tampering after the build; builds from developer machines
Build L3 Hardened build platform: builds isolated from each other, signing keys inaccessible to the build's user-defined steps Compromised build steps forging provenance; cross-build contamination

Newer SLSA versions add a Source track (protected branches, reviewed changes, verified history). GitHub artifact attestations (actions/attest-build-provenance), the SLSA GitHub generator, Google Cloud Build and GitLab provide L2–L3 provenance.

Signing with Sigstore

Traditional code signing requires managing long-lived private keys (which get stolen or leaked). Sigstore (OpenSSF) makes signing keyless and transparent:

CI jobOIDC tokenrepo · workflow Fulcio CAshort-lived certfor ephemeral key Rekortransparency logappend-only ① token ② cert ③ cosign signs image digest; key discardedsignature + cert stored with the image (OCI) ④ log entry ⑤ verify: signature · identity = expected repo/workflow · Rekor inclusion
Keyless signing with Sigstore. The CI job obtains an OIDC identity token, Fulcio issues a short-lived certificate binding an ephemeral key to that identity, cosign signs the artifact digest, and the signature is recorded in the public Rekor transparency log. Verifiers check the certificate identity (which repository and workflow signed it) and the log entry; no long-lived signing key exists to steal.
Shell
# Sign in CI (GitHub Actions with id-token: write permission) — keyless
cosign sign --yes registry.example.com/payments/api@sha256:3b1f…

# Attach SLSA provenance and an SBOM as signed attestations
cosign attest --yes --type slsaprovenance --predicate provenance.json registry.example.com/payments/api@sha256:3b1f…
cosign attest --yes --type cyclonedx --predicate sbom.cdx.json registry.example.com/payments/api@sha256:3b1f…

# Verify: signer must be this repository's release workflow on main
cosign verify registry.example.com/payments/api@sha256:3b1f… \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  --certificate-identity-regexp '^https://github.com/acme/payments/\.github/workflows/release\.yml@refs/heads/main$'

Verification must check identity, not just "a valid signature exists" (anyone can get a Sigstore certificate for their own identity). Enforce it at deployment with admission policies (chapter 111).

Ecosystem adoption: npm provenance and trusted publishing, PyPI trusted publishing (OIDC from CI instead of API tokens) and PEP 740 attestations, Maven Central Sigstore signatures, crates.io trusted publishing, Homebrew and Kubernetes release artifacts signed with Sigstore, and Git commit signing with SSH keys or gitsign.

Securing the build: CI/CD as production

The build system holds the keys to production (deploy credentials, signing identity, registry write access), so it deserves production-grade security (Vol. 8 ch. 93):

  • Source protection: branch protection/rulesets, required reviews (two-person rule for sensitive repos), required status checks, no force-push to main, CODEOWNERS for CI configuration and dependency files, MFA/SSO for all developers.
  • Least-privilege tokens: GitHub Actions permissions: contents: read by default, elevate per job; short-lived OIDC credentials to clouds and registries instead of stored secrets.
  • Untrusted code: workflows triggered by forks (pull_request_target, workflow_run) must never check out and execute PR code with secrets; treat PR titles/branch names as untrusted input in scripts (script injection via ${{ github.event.pull_request.title }}).
  • Ephemeral, isolated runners: fresh VM/container per job; self-hosted runners never shared with public repositories.
  • Pin everything (actions by SHA, tool versions with checksums) and restrict allowed actions to an approved list.
  • Separate build from release: the release job that signs and publishes runs in a protected environment with approvals.
  • Audit CI configuration changes and secret access; scan for leaked secrets.
  • Tools: OpenSSF Scorecard (automated checks of these practices), zizmor and actionlint for GitHub Actions security linting, StepSecurity Harden-Runner for egress monitoring.
YAML
# GitHub Actions: hardened release job
name: release
on:
  push:
    tags: ["v*"]
permissions: {}                       # nothing by default
jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write                 # OIDC for keyless signing and cloud auth
      packages: write
      attestations: write
    environment: production           # protected environment with required reviewers
    steps:
      - uses: actions/checkout@<commit-sha>        # v5, pinned by SHA
        with: { persist-credentials: false }
      - uses: docker/build-push-action@<commit-sha> # v6
        id: push
        with: { push: true, tags: "ghcr.io/acme/api:${{ github.ref_name }}", sbom: true, provenance: mode=max }
      - uses: actions/attest-build-provenance@<commit-sha>
        with: { subject-name: ghcr.io/acme/api, subject-digest: "${{ steps.push.outputs.digest }}", push-to-registry: true }

Reproducible builds

A build is reproducible if the same source, build environment and instructions produce bit-for-bit identical output. Independent parties can then rebuild and compare hashes, detecting a compromised build system (the SolarWinds scenario). Obstacles: timestamps, file ordering, absolute paths, randomness, locale, embedded build IDs. Remedies: SOURCE_DATE_EPOCH, sorted inputs, -trimpath (Go builds are largely reproducible by default; the Go toolchain itself is reproducibly built), Bazel/Nix/Guix hermetic builds, Debian and Arch reproducible-builds efforts. The xz backdoor lived in release tarballs that differed from the Git source, so building from the canonical source repository (or checking tarballs match it) is part of this.

Package integrity and registries

  • Registry-side: mandatory MFA for maintainers of popular packages (npm, PyPI, RubyGems, crates.io), trusted publishing without long-lived tokens, malware detection and fast takedown, namespace protections, provenance display.
  • Consumer-side: an internal proxy registry that caches approved packages (and can block known-malicious or too-new ones), integrity hashes in lockfiles, verifying provenance/signatures where available (npm audit signatures), checksum databases (Go's sum.golang.org, a transparency log), and vendoring critical dependencies when you need full control.
  • Licences: SCA tools also check licence compatibility (cargo deny, FOSSA, ORT).

A practical maturity path

  1. Inventory: generate SBOMs for everything you ship; know your dependencies and base images.
  2. Hygiene: lockfiles everywhere, ci/--locked installs, automated updates with cooldowns, SCA in CI, secret scanning.
  3. Harden CI: least-privilege tokens, OIDC instead of stored secrets, actions pinned by SHA, protected branches and release environments.
  4. Sign and attest: keyless signing, SLSA Build L2+ provenance, SBOM attestations.
  5. Verify: admission policies requiring signatures from your identities and provenance from your builders.
  6. Advanced: reproducible/hermetic builds, internal registry with policies, maintainer-risk monitoring, contribution back to critical open-source dependencies.

Lab: SBOMs, scanning, pinning, signing and reproducibility

pip-audit 2.10.1 (PyPI advisory source), pip 24.0 hash checking, Syft 1.33.0, cosign 2.5.3 and Go 1.24 in the golang:1.24-alpine container, on the lab machine. One honest limitation: Grype could not download its vulnerability database through the lab's network allowlist, so container-image scanning is not shown; pip-audit stands in for dependency scanning, and Syft's SBOMs are what Grype or Trivy would scan.

Experiment 1: SBOMs in two formats

Shell
syft docker:alpine:3.22 -o spdx-json     > alpine.spdx.json     # SPDX-2.3, 17 packages
syft docker:tiffin:2.2  -o cyclonedx-json > tiffin.cdx.json     # CycloneDX 1.6, 3 components
Text
alpine-baselayout 3.7.0-r0  apk-tools 2.14.12-r0  busybox 1.37.0-r20  libcrypto3 3.5.9-r0
libssl3 3.5.9-r0  musl 1.2.5-r13  zlib 1.3.2-r1  ca-certificates-bundle 20261020-r0  …
tiffin: stdlib go1.24.7 (pkg:golang/stdlib@1.24.7), tiffin (pkg:golang/tiffin), /tiffin

Each component carries a purl (package URL, e.g. pkg:golang/stdlib@1.24.7), the identifier scanners match against advisory databases. SPDX (an ISO standard, strong on licensing) and CycloneDX (OWASP, strong on security use cases and VEX) are both widely accepted; pick the one your consumers ask for and generate it in the same pipeline step that builds the artefact, so it describes exactly what shipped.

Experiment 2: dependency scanning, before and after

Text
requests   2.25.0    4 advisories   newest fix 2.33.0
urllib3    1.26.4   11 advisories   newest fix 2.8.0
jinja2     2.11.2    5 advisories   newest fix 3.1.6
idna       2.10      2 advisories   newest fix 3.15
chardet, certifi, markupsafe: 0
requests 2.32.5 → PYSEC-2026-2275 (fixed 2.33.0); with requests 2.33.0: No known vulnerabilities found

Two operating lessons. Advisory counts include duplicates and issues that may not be reachable from your code, so triage by exploitability (is the vulnerable function used? is it reachable from input?), and record decisions as VEX statements rather than re-triaging every run. And automate the upgrades: Dependabot or Renovate opening small, frequent update pull requests keeps you a few versions behind, never five years.

Experiment 3: hash-pinned installs

Text
lock-ok.txt  (real sha256 048adeaf…)       → Would install idna-3.15
lock-bad.txt (one digit changed, f48adeaf…) → THESE PACKAGES DO NOT MATCH THE HASHES …
                                               Expected sha256 f48adeaf… Got 048adeaf…

Generate hash-pinned lockfiles with a tool (pip-compile --generate-hashes, uv pip compile --generate-hashes, poetry lock) rather than by hand. Hashes protect integrity, not judgement: a malicious version you pin with its correct hash installs happily, which is why review of dependency changes (what got added, who maintains it, how old it is) matters as much as the lock.

Experiment 4: signing and verifying with cosign

Shell
cosign generate-key-pair
cosign sign-blob --key cosign.key --tlog-upload=false --bundle tiffin.bundle tiffin-bin
cosign verify-blob --key cosign.pub --bundle tiffin.bundle --insecure-ignore-tlog=true tiffin-bin
Text
genuine binary:           Verified OK
one byte changed at 1000: invalid signature when validating ASN.1 encoded signature
verified with other.pub:  invalid signature when validating ASN.1 encoded signature

The lab used a local key and skipped the Rekor transparency log because the lab can't reach Sigstore's public services. In production, keyless signing is the norm: CI gets a short-lived certificate from Fulcio bound to its OIDC identity (for example "the release workflow of repo X on tag v1.2"), signs, and the signature is recorded in Rekor; verifiers check the identity and issuer rather than managing long-lived keys. Kubernetes admission policies (Kyverno, Sigstore policy-controller) can then refuse any image that isn't signed by your pipeline.

Experiment 5: reproducible builds

Text
                     /src/a             /work/b
go build (default)   6cd8077f4c431eb0   c2a682e4e7e3fec0
-trimpath -buildvcs=false -ldflags='-s -w -buildid='
                     faa240f0264154b1   faa240f0264154b1

The only difference between the two default builds was the directory, and it changed the hash. Common sources of non-reproducibility: paths, timestamps (SOURCE_DATE_EPOCH fixes most), build IDs, VCS metadata, file ordering in archives, and unpinned toolchains or base images. Reproducibility is what lets an independent rebuilder catch a compromised build server, the attack that hit SolarWinds.

Try it yourself

  1. Generate an SBOM of one of your own images and count how many components you didn't know were there.
  2. Add pip-audit (or npm audit, govulncheck, cargo audit) to a CI pipeline that fails only on high-severity, fixable findings.
  3. Build a Docker image twice with SOURCE_DATE_EPOCH set and compare digests; then without it.
  4. Write a SLSA provenance statement (in-toto format) by hand for the tiffin build: builder, source commit, parameters. Which fields could a compromised build server lie about?

Revision sheet: software supply chain security

Key ideas

  • Attack types: compromised build (SolarWinds), compromised CI secret (Codecov), long-con maintainer takeover (xz-utils, 2024), hijacked package (event-stream), typosquatting, dependency confusion, malicious CI actions.
  • Know what you run: SBOMs (SPDX, CycloneDX) generated at build time, with purls.
  • Know what's vulnerable: continuous scanning (pip-audit, npm audit, govulncheck, Grype, Trivy, OSV-Scanner), triage by reachability, VEX for decisions, automated upgrades.
  • Get exactly what you meant: lockfiles with hashes; scoped/private registries to stop dependency confusion; pin CI actions by commit SHA.
  • Know who built it: signatures (Sigstore keyless: Fulcio, Rekor, cosign), provenance attestations (in-toto), SLSA build levels, admission-time verification.
  • Trust the build: hardened, ephemeral, isolated builders; least-privilege CI tokens; reproducible builds for independent verification.

Numbers to remember

  • Lab: 3 old pins → 22 advisories across 4 packages; all fixed by upgrading.
  • Lab: one changed hex digit stopped the install; one changed byte failed signature verification.
  • SLSA v1.0 build track levels: L1 provenance exists, L2 signed provenance from a hosted builder, L3 hardened, isolated builder.

Pitfalls

  • Version pins without hashes; floating tags (latest, v1) for images and actions.
  • Scanning once and never again; ignoring transitive dependencies.
  • Treating a signature as proof of safety rather than of origin.
  • Long-lived signing keys and publish tokens on developer laptops.
  • Internal package names that also resolve on public registries.
  • Builds that can't be reproduced, so a tampered builder goes unnoticed.

Glossary

  • purl: package URL identifying a component across ecosystems.
  • VEX: statement of whether a product is actually affected by a vulnerability.
  • Provenance: a signed record of how, where and from what an artefact was built.
  • SLSA: Supply-chain Levels for Software Artifacts.
  • Transparency log: append-only public log of signatures (Rekor).
  • Dependency confusion: a public package shadowing a private one with the same name.