SBOM: What It Is and How to Generate One
What an SBOM is, CycloneDX vs. SPDX, why customers and regulators ask for one, and how to generate a software bill of materials from your lockfiles.
An SBOM, or software bill of materials, is a machine-readable list of every component in your software: each open-source package, its exact version, who supplies it and what depends on what. You can generate one in minutes from your lockfiles in CycloneDX or SPDX format, and the hard part is keeping it current and acting on it.
This guide covers what goes into an SBOM, how CycloneDX and SPDX differ, why customers and regulators now ask for one, and how to generate it with free SBOM generator tools, with the exact commands. It is written by Strac, a Y Combinator-backed data security company trusted by enterprises, whose dependency scanning exports SBOMs on demand.
Think of an SBOM as the ingredient list for an application. Its job is to answer one question quickly and reliably: what exactly are we running? The US baseline for what that list must contain comes from the NTIA's Minimum Elements for a Software Bill of Materials, published in 2021:

The NTIA document also expects SBOMs to be machine-readable and generated automatically, and CISA now leads the US government's SBOM work. In practice, the identifier that makes an SBOM useful is the package URL, or purl, such as pkg:npm/lodash@4.17.21, because it lets a scanner match a component to advisories without guessing.
Here is a trimmed CycloneDX JSON SBOM with one component and one dependency relationship. A real one for a web app has hundreds of components, but each looks like this:
{
"bomFormat": "CycloneDX",
"specVersion": "1.6",
"metadata": {
"timestamp": "2026-12-05T10:00:00Z",
"tools": { "components": [{ "type": "application", "name": "cdxgen" }] },
"component": { "type": "application", "name": "your-app", "version": "3.2.0" }
},
"components": [
{
"type": "library",
"bom-ref": "pkg:npm/lodash@4.17.21",
"name": "lodash",
"version": "4.17.21",
"purl": "pkg:npm/lodash@4.17.21",
"licenses": [{ "license": { "id": "MIT" } }],
"hashes": [{ "alg": "SHA-512", "content": "<from package-lock.json>" }]
}
],
"dependencies": [
{ "ref": "your-app", "dependsOn": ["pkg:npm/lodash@4.17.21"] }
]
}Every NTIA field is there: the supplier and name, the exact version, a purl as the unique identifier, the dependency relationship, the tool that authored it and a timestamp. Notice that none of it required anything beyond the lockfile.
For most software companies the first SBOM request comes from a customer's security questionnaire, usually after a large supply chain incident has made their own security team ask the same question of every vendor. Regulation is following the same path:

The details: Executive Order 14028 (2021) made SBOMs part of US federal software security guidance. The FDA requires an SBOM in premarket submissions for cyber devices. And the EU Cyber Resilience Act requires manufacturers of products with digital elements to draw up an SBOM covering at least top-level dependencies, with its main obligations applying from December 11, 2027 and vulnerability reporting duties from September 11, 2026.
Even where no law applies, the commercial pressure is real. A single enterprise deal can stall for weeks on a vendor review, and being able to send a current SBOM, with your patch deadlines and the evidence that you meet them, is one of the fastest ways to clear the security section of that review.
There are two widely used SBOM formats, and the honest answer is that either works for most purposes. Pick the one your customers ask for, and use tools that can produce both.
| CycloneDX | SPDX | |
|---|---|---|
| Steward | OWASP Foundation | Linux Foundation |
| Standard | ECMA-424 | ISO/IEC 5962:2021 |
| Origin | Built for application security and supply chain risk | Built for license compliance, extended to security |
| Formats | JSON, XML, Protocol Buffers | JSON, YAML, RDF, tag-value, spreadsheet |
| Strengths | Vulnerability (VEX) data, services, lightweight | Rich license and file-level detail, long track record |
| Typical asker | Security teams, questionnaires | Legal, open-source program offices, some government buyers |
If nobody has specified, CycloneDX JSON is the more common default in security questionnaires. Strac exports both, so the format question never blocks a deal.
An SBOM generator reads the same lockfiles your package manager uses and writes them out in a standard format. You likely already have one installed. Run these from the project root:
# npm 10.1+: built-in SBOM, CycloneDX or SPDX
npm sbom --sbom-format=cyclonedx > sbom.cdx.json
npm sbom --sbom-format=spdx > sbom.spdx.json
# OWASP cdxgen: many ecosystems, recursive through a monorepo
npx @cyclonedx/cdxgen -r -o sbom.cdx.json .
# Python: CycloneDX from a requirements file or the installed environment
pip install cyclonedx-bom
cyclonedx-py requirements requirements.txt -o sbom.cdx.json
# GitHub: export the dependency graph of a repo as SPDX
gh api repos/OWNER/REPO/dependency-graph/sbom > sbom.spdx.jsonEach command produces a valid SBOM for one project. The gaps show up at company scale: dozens of repos, several ecosystems per repo, and a customer who wants one document for the whole product. That is where a platform helps. Strac reads every lockfile across your GitHub and GitLab repos, monorepos included, keeps one inventory of every direct and transitive package, and exports it as CycloneDX or SPDX in one click. See Strac's SBOM export.

Need an SBOM for a security questionnaire this week?
Book a demo of Strac's SBOM export · Run a free security scan
If you ship containers, your application SBOM is only part of the story: the base image brings its own operating system packages. Container-aware generators such as OWASP cdxgen can read an image as well as a source tree, and many registries can attach an SBOM to an image as an attestation. For a SaaS company the usual approach is one SBOM per service, covering both the application lockfiles and the image it runs in.
| Option | Best for | Formats | Limits |
|---|---|---|---|
| npm sbom | Single npm projects | CycloneDX, SPDX | npm only, one project at a time |
| OWASP cdxgen | Polyglot repos and monorepos in CI | CycloneDX | You manage storage and monitoring |
| cyclonedx-py | Python projects | CycloneDX | Python only |
| GitHub dependency graph export | Quick export of a GitHub repo | SPDX | One repo at a time, GitHub only |
| Strac | Every repo, one inventory, kept current | CycloneDX, SPDX | Part of Strac Comply, alongside SCA, secrets and cloud |
Whatever you choose, generate in CI rather than by hand, and store each SBOM with the release it describes. A hand-made SBOM is out of date the day after it is made.
An SBOM by itself fixes nothing. Its value comes from what you do with it after it is generated:

The monitoring step is the one that pays off. When a new advisory or a hijacked release hits the news, a monitored inventory tells you in seconds whether any product is affected and which version. You can already do a manual version of this with an SBOM and Google's free scanner:
# check an existing CycloneDX or SPDX SBOM against osv.dev
osv-scanner scan source -L sbom.cdx.jsonStrac does this continuously: every new vulnerability or malware advisory is matched against the stored inventory without rescanning, ranked with actively exploited issues first, and fixed with a pull request carrying the smallest safe upgrade. That is the core of software composition analysis, and it is why our software supply chain security guide treats the SBOM as an incident response tool first.
An SBOM and software composition analysis are built from the same inventory but answer different questions. The SBOM is a document: what is in this release, in a format someone else can read. SCA is a process: which of those components are vulnerable, malicious, unlicensed or end of life, and what to do about it. You can have an SBOM without SCA, but it is a list nobody checks. You can run SCA without exporting an SBOM, but you will rebuild the inventory by hand the first time a customer asks. Running both from one inventory avoids both problems.
The first thing a customer does with your SBOM is scan it, and the scan will flag vulnerabilities in components you ship. Many will not affect you: the vulnerable function is never called, the component is only used in tests, or a configuration blocks the attack. VEX, short for Vulnerability Exploitability eXchange, is a machine-readable way to say so, with a status such as not affected, affected, fixed or under investigation for each one. CycloneDX can carry VEX data inside the SBOM or alongside it. Sharing VEX with an SBOM saves both sides a round of questions.
The seven minimum fields get you a compliant document. A few more make it far more useful to the people who read it:
Customers reviewing vendors increasingly look for exactly this context. If your company runs vendor reviews of its own, our third-party risk management policy guide shows how to ask suppliers for SBOMs in turn.
When the request arrives in a security review, a calm, repeatable answer works better than a rushed export:
Most SBOM problems are process problems:
SOC 2 does not require an SBOM, but the inventory behind it supports controls auditors do test: asset inventory, vulnerability detection under CC7.1 and vendor risk under CC9.2. In practice, the SBOM request arrives in the same questionnaire that asks how fast you patch and whether you scan dependencies, so it pays to answer all three from one system. Strac keeps the inventory, the findings and the fix dates together, saves them as SOC 2, ISO 27001 and HIPAA evidence, and runs beside secret scanning and cloud checks in one platform. For tool options, see our roundup of the best SCA tools, and for the bigger picture our guide to application security posture management.
Know every component you ship, and export the SBOM in one click.
Book a demo of Strac's SBOM and SCA · Run a free security scan
A software bill of materials (SBOM) is a machine-readable list of every component in a piece of software, with versions, suppliers and the relationships between them. It is the ingredient list for an application.
Both are open, machine-readable SBOM formats. CycloneDX is an OWASP project focused on security use cases and standardized as ECMA-424. SPDX is a Linux Foundation project that began with license compliance and is an international standard, ISO/IEC 5962:2021. Most tools can produce either.
In some cases. US federal agencies can require one from software suppliers under Executive Order 14028, the FDA requires one in premarket submissions for cyber devices, and the EU Cyber Resilience Act requires manufacturers to keep one from December 2027. For most SaaS companies the practical driver is enterprise customers' security questionnaires.
On every release, at minimum. An SBOM describes one build, so a stale one is misleading. The useful version is generated automatically in CI and continuously checked against new vulnerability advisories.
No. An SBOM lists the third-party components and versions you use, not your source code. Some companies share it only under NDA, because it does reveal which versions you run.
.avif)
.avif)
.avif)
.avif)
.avif)


.gif)

