PRACTITIONERCHAPTER 12

Software supply chain security

Most of what you ship is other people's code, assembled by machines you rarely inspect. The job is knowing what is in it, proving where it came from, and choosing which outside code you will depend on

45 MINSECURITYUPDATED 2026-11-21
PREDICT

Your deploy pipeline now verifies a signed provenance attestation for every image. It names the repository, the commit and the hosted builder, and the signature checks out. One of the libraries pulled into that build was backdoored upstream before the commit you built. What does the passing check tell you?

Software supply chain security is the work of controlling what goes into your software and how it becomes a running service. That covers the open-source packages you depend on, the build pipeline that compiles and packages them, the registry that stores the result, and the platform that runs it. It sits next to vulnerability management, which deals with flaws that have been published, and next to identity, access and secrets, which governs the credentials your pipeline uses. Supply chain security covers the cases neither handles: the code that is hostile on purpose, the build that does something its source does not say, and the library whose only maintainer has stopped answering.

As a Security Engineer you are judged on findings fixed, not findings filed. Here that means the habits are in the pipeline by default: every build produces an inventory, every deploy checks where the artefact came from, and every new dependency passes a short, fair review.

The model: four doors and three questions

An attacker who cannot break your code can try to change the code you run. There are four places to do it.

Door What goes wrong Public example Main controls
Source and dependencies A package is malicious, hijacked or abandoned; a look-alike name gets installed xz-utils (2024); dependency confusion Lockfile with hashes, internal registry, review of new dependencies
Build A pipeline step runs attacker code or leaks secrets; the build differs from the source tj-actions/changed-files (2025) Pinned steps, least-privilege CI, hosted builders, provenance
Artefact and publishing A built artefact is swapped, or a publishing credential is stolen Stolen registry tokens Signing, deploy by digest, short-lived publishing identity
Deployment The platform runs something nobody approved Unsigned images pulled by tag Admission checks on signature and provenance

Over the four doors, three questions do the work.

What is in it? The software bill of materials, SBOM, answers this. It is an inventory, and it exists so that on a bad day you can search it.

Where did it come from? Provenance and signatures answer this. They tie an artefact to a source, a builder and an identity, and they make tampering after the fact visible.

Should we trust it? Neither of the first two answers this, and no tool does. It is a judgement about maintainers, activity, scope and what the code can touch if it turns hostile. It is the part teams skip, because it has no dashboard.

What is in it: the SBOM

An SBOM lists the components in a build, with versions and where they came from. Two formats dominate. SPDX is stewarded by the Linux Foundation. CycloneDX comes from OWASP and is standardised by Ecma International as ECMA-424. Most tools read both, so choose the one your scanner and your customers’ tools handle best, and stay consistent.

Three rules make an SBOM useful rather than decorative.

Generate it from the build, not from the repository. A manifest file says what you asked for. The built image says what you shipped, including transitive dependencies and the base image’s operating-system packages. Generate the SBOM from the artefact, at build time, in the pipeline.

Store it against the artefact’s digest. An SBOM filed under a version number drifts away from what runs. Keyed by the image digest, it cannot. On the day a component is found hostile, you query the store for that component and get a list of artefacts, then a list of running services.

Do not read an SBOM as a risk assessment. It says a component is present. It does not say the code is reachable, exploitable or exposed. The vulnerability management chapter covers how to turn presence into a tier and a deadline, and how a VEX statement records that a product is not affected. Treat the SBOM as the inventory that policy runs on.

Customers increasingly ask for one. A bank’s security review is a common trigger, and the reply is better when you can attach a real SBOM than when you promise to produce one. Government guidance on the minimum fields an SBOM should carry has been revised since the first version, so check the current CISA document before you promise a customer a specific set.

Where it came from: provenance, signatures and SLSA

Provenance is a signed statement about how an artefact was produced: which builder, what process, which inputs. A signature says that a particular identity vouched for particular bytes. Together they let a deploy step ask whether this image is the one the trusted pipeline built from the commit we expect. If anyone swapped the image in the registry, the answer is no.

The vocabulary comes from two projects. SLSA, pronounced salsa, is a specification from the Open Source Security Foundation. Its Build track has three levels:

Level What it requires What it protects against
Build L1 Provenance exists and shows how the package was built; it may be unsigned or incomplete Mistakes and poor documentation
Build L2 Signed provenance, generated by a hosted build platform Tampering after the build
Build L3 A hardened build platform Tampering during the build

SLSA v1.2 added a Source track beside it, which asks for confidence in the history and review of the source itself. At the time of writing the Build track is the one most teams adopt first, and Build L2 is a realistic target for a team that already builds in a hosted CI system.

Sigstore is the signing side. Its documentation describes cosign, the client you use to sign and verify; Fulcio, a certificate authority that issues short-lived certificates binding an ephemeral key to an OpenID Connect identity, such as your CI job; and Rekor, a transparency log that records signing events. The point is that nobody holds a long-lived signing key to lose. The identity is the pipeline, and the log lets you audit what it signed. If you have read the hashes, MACs and signatures lesson, this is a signature scheme with the key-management problem moved onto an identity provider.

What matters is where verification happens. A signature nobody checks is decoration. The check belongs at deploy: the cluster or the deploy tool refuses an image that lacks a valid signature from the expected identity, or whose provenance names a builder or repository you did not expect.

Be exact about what this proves, because the Predict above is the usual mistake. A verified L2 provenance tells you the pipeline built this commit and nothing changed afterwards. In the xz case, the malicious code sat in the release tarball but not in git, so a build from the tarball and a build from the repository would have produced different results. The control that notices that is building from the tagged repository, and comparing a release archive with the tag it claims to come from. Provenance can record which one you built from; deciding that it should be the repository is your policy.

How code gets in: pin, mirror, verify

Most of the daily work is at the entry points, and the controls are dull and effective.

Lockfiles with hashes, installed frozen. The lockfile records exact versions and content hashes of everything resolved, including transitive dependencies. The CI install command should refuse to change it. Without that, two builds of the same commit can differ.

Install-time scripts. Many package managers can run arbitrary scripts when a package is installed, on the build machine, with whatever secrets it holds. Turn them off by default and allow-list the few packages that need them, with a reason recorded.

One registry in front. Route installs through an internal proxy or mirror. It gives you a place to block a package you have decided against, a cache that survives an upstream removal, and one source of truth for names. It is also the defence against dependency confusion, the technique Alex Birsan published in February 2021: an attacker uploads a public package with the same name as one of your internal ones, and a misconfigured client prefers the public one. Resolve internal names only from the internal registry, and reserve them on public registries where you can.

Pin CI steps to a full commit hash. Pipelines pull in third-party steps, and a tag such as v45 is a label that its owner can move. In March 2025 the tj-actions/changed-files action, widely used in CI workflows, was modified to run malicious code that exposed secrets in workflow logs; CISA’s alert tracks it as CVE-2025-30066. GitHub’s secure use reference says pinning an action to a full-length commit SHA is currently the only way to use it as an immutable release, and adds that you should check the hash belongs to the action’s own repository, not a fork. Pinning has a cost: pins go stale, so you need an update process, usually an automated pull request that a person reads.

Pin the base image by digest. A tag such as stable moves. A digest does not.

Give the pipeline the least it needs. The build job should not hold production credentials, and the credential it uses to publish should be short-lived and issued to the job’s identity, as the identity chapter describes for CI federation. Compromise of a pipeline step then yields a token that expires in minutes.

The update tension. Pinning stops surprise changes, but it also delays fixes. Updating at once picks up security patches and also picks up a malicious release in its first hours. Many teams settle on a short delay before adopting a new release of a dependency, a few days is a common rule of thumb, with an override for fixes to known-exploited vulnerabilities. Choose a number, write it down, and make the override explicit.

Judging a dependency

A new direct dependency is a decision to run someone else’s code with your permissions. A short review, fifteen minutes, catches most of what matters.

  • What does it do, and could we write it? A ten-line helper is cheaper to own than to depend on.
  • What can it touch? A library that formats text and one that handles credentials or network calls are not the same risk.
  • Who maintains it, and how many people could ship a release? One maintainer is not a defect, it is a concentration of risk. Note it.
  • Is it alive? Recent releases, answered issues, a security policy. The OpenSSF Scorecard automates checks of this kind on a repository, including whether its dependencies and workflows are pinned. It measures practices, not whether the code is free of vulnerabilities, so use it to decide where to look.
  • How does it get installed? Install scripts, native code, a large transitive tree.

The hardest case is the critical library with one maintainer. You have four moves.

Move Fits when Costs
Pin The library is small, stable, has no open flaws, and the exposure is limited Does nothing if it stops getting fixes
Vendor You can read all of it, and need to patch without waiting A reviewed copy to keep and an owner
Fork You must change it and the maintainer will not or cannot You now maintain it, indefinitely
Replace It is abandoned, large, or touches things it should not Migration work, new bugs, a new dependency to judge

Whichever you choose, write down exit triggers: an unfixed vulnerability past its tier’s deadline, a change of maintainer, a release that adds install scripts, no release for a stated period. A decision with triggers is a risk acceptance. A decision without them is drift.

Where practitioners disagree

SBOM as a compliance artefact or an operational tool. One camp treats it as a document to hand customers and auditors. The other says its only value is being queryable in an incident. The sensible position is that the second makes the first honest.

Update fast or update slowly. Both are defensible, and the right answer depends on which risk your attackers exploit more often against you. The disagreement is why a written policy matters more than the number in it.

Vendoring or a package manager. Vendoring makes review and patching easy and makes updates a chore. Package managers do the reverse. Many teams vendor the small, critical libraries and use the manager for the rest.

How far to trust a framework. NIST’s Secure Software Development Framework, SP 800-218, groups its practices under four headings: prepare the organisation, protect the software, produce well-secured software, and respond to vulnerabilities. Customers and some regulators ask suppliers to attest against it. NIST describes it as a basis for a risk-based approach, not a checklist, so use it to show gaps. Meeting it is not the same as being safe, and a version 1.1 from February 2022 now has a draft revision, so check which one a customer cites.

Day to day

Daily, twenty minutes. Read advisories for the ecosystems you use, and the bot-opened dependency updates that show a new maintainer, a new install script or a jump in size. Check the deploy log for failed signature or provenance checks. A failed check is either a misconfiguration or the thing the control exists for, and you find out which the same day.

Weekly. Review new direct dependencies against the checklist above, fifteen minutes each. Read the pin-update pull requests for CI steps and base images. Meet the team that owns the pipeline for half an hour; you need them as allies, because every control here is configuration in their system.

Monthly. Report four measures: the share of production artefacts with a stored SBOM, the share deployed with verified provenance, the number of unpinned third-party pipeline steps, and the register of dependencies with one maintainer or no release in a year, with each one’s owner and exit trigger. Trend matters more than level.

Quarterly. Run a drill: pick a component name and ask how long it takes to list every artefact and service that contains it. Review the single-maintainer register. Check that publishing and signing identities are short-lived and that nobody has added a long-lived token. Read the customer questionnaires you received and see what they asked that you could not answer.

On the day a dependency is found compromised. The routine stops. Open an incident with detection and incident response. Query the SBOM store for the component, list artefacts and running services, and rotate any secret that was available to a build that used it, because a compromised build step reads secrets as readily as it reads code. Rebuild from known-good pins, and check what the artefacts did. The quiet-day work, SBOMs by digest and a short list of owners, decides whether this takes an hour or a week.

The meetings that matter are the design review where a new service chooses its build and deploy path, the procurement review where a new vendor’s own supply chain is asked about (the pentests, bug bounties and vendor risk chapter covers that side), and the customer security review, where your evidence is tested.

BY ORG SIZE
STARTUPunder 30 people

Nobody owns this, so choose the three controls that cost an afternoon each. Commit the lockfile and install from it frozen. Pin third-party pipeline steps to commit hashes and turn on the update bot. Generate an SBOM in the build and keep it with the image. Skip signing infrastructure and provenance for now. Write the one-page policy for adding a dependency, so the next person has a rule. The first customer security questionnaire will ask whether you have an SBOM and a patching process, and these three answer it.

SCALE-UP30 to 300

A security engineer owns the programme and builds it with the platform team. The work is rollout across many services with different pipelines: SBOMs everywhere, an internal registry, signed images, and provenance verified at deploy for the services that carry money or customer data first. Customers and auditors begin to ask for evidence, and a single-maintainer register becomes useful. Negotiate each control with the team that owns the pipeline, because a deploy check that blocks releases without warning is switched off within a month.

ENTERPRISE300 and up

A team runs the platform and you may own one part of it. The problems are scale and politics: thousands of repositories, several build systems from acquisitions, vendors that ship binaries with no SBOM, and business units that cannot update on your schedule. Policy is expressed as admission rules and attestation checks, and exceptions go to a risk committee. You are asked to attest against NIST SSDF, answer regulators about specific incidents within days, and decide which suppliers to demand SBOMs from. The leverage is the monthly coverage report.

ARTEFACT Review dependencies and build provenance for one service ~75 MIN
YOU PRODUCEDependency and build-provenance review with an SBOM

Template

# Dependency and build-provenance review: <service>
Reviewer · Owner · Date · Artefact digest reviewed

## Inventory
SBOM format and generator: <CycloneDX | SPDX, tool, where in the pipeline>
Components: <n> total = <n> direct + <n> transitive; base image packages: <n>
Stored: <where, keyed by what>

## How code gets in
| Check | Result | Action | Owner | Due |
|---|---|---|---|---|
| Lockfile with hashes, frozen install | | | | |
| Install-time scripts (count, allow-list) | | | | |
| Internal package names resolve internal-only | | | | |
| Third-party pipeline steps pinned to commit | | | | |
| Base image pinned by digest | | | | |
| Delay before adopting new releases | | | | |

## Direct dependencies of concern
| Dependency | What it touches | Maintainers | Last release | Decision | Exit triggers |
|---|---|---|---|---|---|

## Build and provenance
Builder: <hosted or not; who controls it>
Provenance: <none | L1 | L2 | L3>, signed by <identity>
Verified at: <deploy step, and what it refuses>
Built from: <tagged repository | release archive>
What this does not prove: <one sentence>

## Credentials
Publishing: <short-lived, issued to what>
Signing: <keyless | key held by whom>

## Gaps and next
| Gap | Owner | Date |
|---|---|---|
Next service to review, and why:
WORKED EXAMPLE

Ferrowave is a fictional bulk-payouts company: 140 staff, 38 engineers in six teams, 210 business customers, some of them banks. Ekenedilichukwu, a security engineer on its seven-person Platform and Security team, reviewed the service that builds the daily reconciliation file, which belongs to Osinachi on Reconciliation and Ledger (six engineers). The review took a week.

Inventory. The pipeline now generates a CycloneDX SBOM from the built image and stores it against the image digest: 412 components, 41 direct and 371 transitive, plus 96 base-image packages.

Entry points. The lockfile has hashes and CI installs from it frozen. Six of the 412 packages run install-time scripts; two were not needed and are disabled, and four are allow-listed with a reason each. The service uses three internal packages, and the client was configured to look in both registries for them; it now resolves them from the internal registry only. Nine third-party pipeline steps were found, six pinned to a commit hash and three to moving tags; all nine are now pinned and updates arrive as pull requests. The base image was pinned by tag and now by digest.

Dependencies of concern. Three of the 41 direct dependencies had no release in twelve months. One, with a single maintainer, got a recorded decision to pin with exit triggers; the other two have maintained alternatives and are scheduled for replacement.

Provenance. There was none. The hosted pipeline now emits signed provenance (Build L2) and the deploy step refuses an image whose signature or builder identity is wrong. It builds from the tagged repository, and the review says plainly that this proves origin, not safety.

Gaps. Publishing used a long-lived registry token; it moves to a short-lived credential next sprint, owner Osinachi. Next review: the payout API in Payouts Core, eight engineers.

Now you

You are on Ferrowave’s Platform and Security team, seven engineers in a company of 140. In 2024 an agency built the approver mobile app for ₦48m; approvers at customer companies, some of them banks, use it to authorise payout batches. The Customer Console, a web dashboard, belongs to a five-engineer team. A bank customer’s security review, due in six weeks, now asks for an SBOM for the app, evidence of how each release is built, and your process if a dependency is found compromised. You hold the source repository and a lockfile that lists 640 packages. The agency built releases on its own laptops and still holds the app-store signing credentials, and its contract has no support clause. Nobody at Ferrowave has ever built the app from source. The Console engineering manager can spare one engineer for two weeks. Produce the review for the app: the SBOM you can generate now, the entry-point checks, a build-provenance target you can reach in six weeks, and a gap list. Decide what you will promise the bank and what you will mark as a gap.

Self-check

DECIDE

You are on Ferrowave's Platform and Security team. Osinachi, who owns the reconciliation-file service in Reconciliation and Ledger, shows you that the library writing the spreadsheet-format file is a direct dependency with one maintainer and no release in 11 months. It has no open vulnerabilities, about 6,000 lines of code, and no network access in the job that uses it, but the job reads ledger data. The file goes every day to 210 business customers, whose finance teams load it. Osinachi asks whether to keep it, fork it or move off it. What do you recommend?

READING
  1. DOC
    SLSA specification, Build track basics (v1.2) SLSA, Open Source Security Foundation

    The Build levels and what each one protects against, from the source. Read it with the Source track beside it to see where provenance stops and review of the source begins.

  2. DOC
    Sigstore documentation Sigstore project

    How cosign, Fulcio and Rekor fit together for keyless signing and verification. Use the quickstart to sign one image before you design the deploy-time check.

  3. DOC
    NIST SP 800-218, Secure Software Development Framework (SSDF) v1.1 NIST, 2022

    The practice list customers and regulators ask suppliers to attest against. Read the four practice groups, then check whether a draft revision is the version your customer cites.

  4. POST
    Backdoor in upstream xz/liblzma leading to ssh server compromise Andres Freund, 2024

    The first public report of the xz backdoor, including the tarball-only component and how it reached sshd. Read it for what a careful investigator noticed and in what order.

  5. DOC
    Reported supply chain compromise affecting XZ Utils, CVE-2024-3094 CISA, 2024

    The government alert issued the same day, with the affected versions and the recommended action. Compare its advice with what your own inventory would let you do within an hour.

  6. DOC
    Supply chain compromise of a third-party GitHub Action, CVE-2025-30066 CISA, 2025

    The pipeline-step compromise discussed above, with the recommended response. A concrete case for pinning steps and for keeping secrets out of reach of build jobs.

  7. DOC
    Secure use reference, GitHub Actions GitHub

    The vendor's own guidance on pinning actions to a full-length commit SHA, handling secrets and limiting token permissions. A practical checklist for the build-door controls.

  8. CODE
    OpenSSF Scorecard Open Source Security Foundation

    Automated checks of an open-source project's security practices, including whether its dependencies and workflows are pinned. Use it to decide where to look, not as a verdict on the code.

All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: Authentication and authorisation for a multi-tenant SaaS and its public API →