Every time a big vulnerability lands, the same question goes around the engineering channel: are we running this anywhere? For most teams the honest answer is "let me check", followed by a day of grepping lockfiles, exec-ing into containers and asking people who left six months ago.
A software bill of materials, or SBOM, exists to make that question boring. This guide covers what an SBOM is, what it is not, and how to start producing one in your pipeline this week.
What an SBOM actually is
An SBOM is a machine-readable list of the components inside a piece of software. For a container image that means the OS packages from the base image, the language packages your app pulled in, and ideally the versions, licences and where each one came from.
Think of it as the ingredients label on the box. It does not tell you whether the food is safe. It tells you what is in it, so that when someone announces a problem with one ingredient, you can find every box that contains it.
That distinction matters. An SBOM is not a vulnerability report. Vulnerability scanners read the SBOM (or build their own) and match it against advisory databases. The SBOM stays the same for the life of a release. The list of known vulnerabilities in it changes every week.
SPDX or CycloneDX?
There are two formats you will run into:
SPDX, a Linux Foundation project and an ISO standard, which grew out of licence compliance work.
CycloneDX, an OWASP project, which was designed with security use cases in mind.
Both are fine. Most tools can produce either. If a customer or regulator asks for a specific one, use that. If nobody has asked, pick CycloneDX JSON for security work and do not spend a meeting on it. You can convert later if you need to.
Where to generate it
The best place is the build pipeline, right after you build the artefact you are going to ship. Generating an SBOM from source code alone misses the base image. Generating one from a running server catches things that were never part of the release. The image you push to the registry is the thing you want described.
Two open source tools cover most teams:
Syft from Anchore, which only does SBOMs and does them well.
Trivy from Aqua, which can produce SBOMs as well as scan for vulnerabilities and misconfigurations.
With Syft, generating a CycloneDX SBOM for an image looks like this:
syft registry.example.com/payments-api:1.42.0 -o cyclonedx-json > sbom.cdx.json
With Trivy:
trivy image --format cyclonedx --output sbom.cdx.json registry.example.com/payments-api:1.42.0
A minimal GitHub Actions example
Here is the shape of it in a workflow. The SBOM step runs after the image is built and pushed, and the file is kept as a build artefact.
- name: Build and push image
run: |
docker build -t $IMAGE:$GITHUB_SHA .
docker push $IMAGE:$GITHUB_SHA
- name: Generate SBOM
uses: anchore/sbom-action@v0
with:
image: ${{ env.IMAGE }}:${{ github.sha }}
format: cyclonedx-json
output-file: sbom.cdx.json
- name: Keep the SBOM with the build
uses: actions/upload-artifact@v4
with:
name: sbom
path: sbom.cdx.json
On a typical service image this adds well under a minute to the build. If it adds much more, the image is probably carrying things it should not.
Where to keep it
A build artefact that expires after 90 days is a start, but it will not help you answer questions about the release you shipped last spring. Better options:
Attach it to the image in the registry. Tools like Cosign can attach an SBOM as an attestation, so it travels with the image and can be signed.
Send it to an SBOM store. Open source options like Dependency-Track ingest CycloneDX files and keep re-checking them against new advisories. Some cloud providers now build an inventory for you from their own scanners.
Whichever you choose, the rule is the same: one SBOM per released artefact, kept as long as that artefact might be running.
Using it on the bad day
The payoff comes when the next widely used library has a critical bug. Instead of searching repos, you query your SBOM store for the package name and version range, and get back a list of images. From the images you get the services, and from the services you get the owners. What used to take a day takes an hour.
We saw this play out with the recent Ruby and Java runtime flaws, where the vulnerable component was the interpreter inside the image, not anything in the app's own lockfile. Teams with image-level SBOMs found every affected service quickly. Teams relying on Gemfile.lock and pom.xml missed the ones that mattered.
Common mistakes
Generating from source only. You miss everything in the base image, which is where a lot of the risk lives.
Treating the SBOM as a one-off for an audit. It is only useful if every release has one.
Failing builds on every finding on day one. Start by producing and storing SBOMs. Add gates later, and only for issues that are known to be exploited and have a fix.
Forgetting the base images you build yourself. Your golden images need SBOMs too.
If you are just getting started with security in pipelines, our guide to DevSecOps in CI/CD covers where SBOMs fit alongside scanning and secrets checks.
Quick answers
What is an SBOM?
A software bill of materials is a machine-readable list of every component in a piece of software, such as the OS and language packages inside a container image, with their versions and origins.
Is an SBOM the same as a vulnerability scan?
No. An SBOM lists what is inside the software. A vulnerability scanner compares that list with advisory databases. The SBOM stays fixed for a release, while the list of known vulnerabilities changes over time.
Which tool should I use to generate an SBOM?
Syft and Trivy are the most common open source choices. Both can produce SPDX or CycloneDX output from a container image and run as a single step in CI.







