Generating SBOMs in your CI/CD pipeline without slowing builds
The single most reliable way to keep SBOMs accurate is to stop treating them as a document someone produces and start treating them as an artifact your build produces — automatically, every time. That means generating SBOMs in your CI/CD pipeline. Done right, it adds seconds to a build and removes an entire category of manual work. Done wrong, it slows everything down and generates SBOMs nobody trusts.
Why the pipeline is the correct place
An SBOM is only useful if it matches what you actually shipped. The build is the one moment where the exact set of components is known with certainty — resolved, pinned, and assembled. Generating the SBOM anywhere else means reconstructing that information, which is both error-prone and perpetually out of date. Generating it in the pipeline gives you three things for free:
- Accuracy — the SBOM reflects the real build, not a developer's lockfile from last Tuesday.
- Freshness — every release produces a current SBOM with zero human effort.
- Traceability — the SBOM is tied to a specific commit, build number, and artifact.
Where in the pipeline
The right insertion point is after dependency resolution and build, before or alongside artifact publication. You want the SBOM generated against the fully resolved dependency set, then stored next to the artifact it describes. For container images, generate against the built image so you capture OS packages and base-image layers, not just application dependencies. A typical flow:
- Check out source.
- Resolve and build.
- Generate the SBOM from the built artifact.
- Scan the SBOM for vulnerabilities and policy violations.
- Optionally gate the build on the results.
- Publish the artifact and store the SBOM alongside it.
On build gates: be careful
It is tempting to fail any build that contains a known vulnerability. Resist the absolutist version of this. A gate that blocks every CVE will be disabled within a week, because the world ships CVEs faster than you can fix them.
Effective gates are risk-based: fail on critical, reachable, or actively exploited vulnerabilities; warn on the rest. The goal is a gate that fires rarely enough to be trusted and meaningfully enough to be worth trusting. A gate everyone ignores protects nothing.
Keep it fast
The reason SBOM steps get ripped out of pipelines is speed. A few practices keep them cheap:
- Cache dependency and vulnerability data between runs.
- Run the scan asynchronously from the critical publish path where you can, so analysis does not block shipping.
- Generate once and reuse the SBOM across downstream stages rather than regenerating it.
For large estates, asynchronous scanning is not a luxury — it is the difference between a pipeline step measured in seconds and one measured in minutes.
Store SBOMs as first-class artifacts
A generated SBOM that lives only in a build log might as well not exist. Treat SBOMs like the binaries they describe: versioned, retained, queryable, and associated with the exact release they came from. When a vulnerability is disclosed eighteen months from now against a version you shipped, you will want to pull up that SBOM instantly — not regenerate it from a state of the world that no longer exists.
When SBOM generation is automated in CI/CD, the entire posture of your supply-chain security changes. Compliance evidence accrues as a side effect of shipping, and "where do we use this component?" becomes a query, not an investigation.