An SBOM for your app: know what's inside before a CVE hits
Short answer: A software bill of materials (SBOM) is a machine-readable list of every component your app ships with: libraries, their versions, where they came from and how they're related, including the dependencies of your dependencies. When a serious vulnerability is announced in a popular library, an up-to-date SBOM lets you answer "are we affected, and where?" in minutes instead of days. Generate one automatically on every build in a standard format like SPDX or CycloneDX, store it with the release, and scan it regularly.
The question every team gets asked
A new vulnerability makes the news. Customers, your boss or your own developers ask: do we use that library? Which apps? Which versions? For a small team with a few apps, a website, a mobile app and a couple of internal tools, answering that by hand means checking lock files across repositories, container images and old releases still running somewhere. It's slow and easy to get wrong, especially for transitive dependencies you never chose directly.
An SBOM turns the question into a search.
What an SBOM contains
GitHub's documentation on exporting an SBOM summarises what one includes: an inventory of a project's dependencies and related information such as versions, package identifiers, licences, transitive paths and copyright information. Each component typically carries:
- Its name and version.
- A package identifier, such as a package URL, that tools can match against vulnerability databases.
- Where it came from, such as a package registry or a base image.
- How it relates to other components, such as which library pulled it in.
- Its licence.
The two common formats
You'll mostly see two open standards:
- SPDX, developed under the Linux Foundation. Its project site notes that SPDX has been recognised as the international standard ISO/IEC 5962:2021.
- CycloneDX, an OWASP project whose specification covers SBOMs as well as related bills of materials for services and hardware. Its overview also lists standardisation as ECMA-424.
Both are widely supported by tools. Pick the one your scanners and customers accept; many tools can produce either.
How to generate one
You don't write SBOMs by hand. Options include:
- From your code host. GitHub's documentation describes exporting an SBOM for a repository from its dependency graph in SPDX format, through the interface, the API or GitHub Actions.
- From your build or container image. Tools like Syft, an open-source tool from Anchore, generate SBOMs from container images and file systems in formats including CycloneDX and SPDX.
- From your package manager or language tooling. Several ecosystems have plugins that output SBOMs as part of the build.
Generating from the final container image or build output is often the most accurate, because it captures what actually ships, including operating system packages from the base image.
Make it part of every build
An SBOM is only useful if it matches what's running. Build it into your pipeline:
- Generate an SBOM for each release build or image.
- Store it alongside the release artefact, labelled with the version and build ID.
- Keep SBOMs for every version still deployed anywhere: production, staging, older mobile app versions customers haven't updated.
- Make them easy to find, in your artefact store or a simple shared location.
Use it: scanning and answering questions
With SBOMs stored, two things become easy:
Regular vulnerability scanning. Scanners can read an SBOM and match components against vulnerability databases. Syft's README notes it pairs with the Grype scanner for vulnerability detection, and many other scanners accept SPDX or CycloneDX input. Scanning stored SBOMs, rather than only scanning at build time, catches newly announced vulnerabilities in software you shipped months ago.
Incident questions. When a vulnerability is announced, search all stored SBOMs for the affected package and versions. You get a list of apps and releases to patch, which you can prioritise by exposure.
Don't drown in alerts
SBOM scanning often turns up many findings, and not all matter. A vulnerable function you never call, or a library only used in build tooling, is lower priority than one in your login path. Triage by:
- Whether the component ships in production.
- Whether the vulnerable feature is reachable in your app.
- How exposed the app is: internet-facing, internal or offline.
Some tools offer reachability analysis or exploitability notes to help.
Licences come along for free
Because SBOMs record each component's licence, they also help with a different question: are we shipping anything under a licence our business or a customer's contract doesn't allow? A quick filter on licence fields flags components to review with whoever handles your contracts, long before a customer's security questionnaire asks.
SBOMs for customers
Some business customers, especially larger ones, ask suppliers for SBOMs as part of security reviews. If you already generate them per release, sharing one is quick. Agree on the format first, and make sure the SBOM doesn't include anything you'd rather not share, such as internal repository names.
A worked example
Picture a hypothetical Austin property-management software company with a web app, an API and an Android app. When a vulnerability in a widely used logging library was announced, the team spent two days checking repositories and images by hand and still missed an old internal tool. Afterwards they added SBOM generation to every CI build using the container image as the source, stored SBOMs with each release and set up a weekly scan of all stored SBOMs. The next time a library vulnerability made headlines, a single search listed the two affected services within minutes.
FAQ
Isn't the lock file enough?
It's a good start for one project, but it misses operating system packages, container base images and other repositories. An SBOM brings them together in a standard format.
Do small teams really need SBOMs?
If you run more than one app or ship container images, they save real time when it matters. Generation is mostly automated.
How often should I scan?
At every build, and on a schedule, such as weekly, for everything still deployed.
If you'd struggle to say whether a newly announced vulnerability affects your apps, ask us to set up SBOMs and scanning.