Reading a software bill of materials: CycloneDX and SPDX in practice
An SBOM lists the components inside a build. How to generate one with Syft, read the fields that matter (name, version, purl, license, hashes), and answer “are we affected?” within minutes of a new advisory.
Diagram
From image to answer
Step 1 of 4
Generate
Create an SBOM from an image or directory.
$ syft registry.example.test/shop/api:1.42.0 -o cyclonedx-json > api.cdx.json $ jq '.components | length' api.cdx.json 412
Grep every repo and image
Days
Unknown
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
Package URLs
- What fails
- The purl identifies ecosystem, namespace, name, and version in one string.
- Who is affected
- Teams matching advisories to components.
- What you would notice
- SBOMs without purls or with only file names.
- What you change
- Use generators that emit purls and keep them.
Transitive dependencies
- What fails
- Most components arrive as dependencies of dependencies.
- Who is affected
- Services that never chose those packages directly.
- What you would notice
- A vulnerable library absent from the manifest but present in the SBOM.
- What you change
- Generate SBOMs from built artifacts, not only manifests.
Storage and lookup
- What fails
- An SBOM nobody can query does not help on advisory day.
- Who is affected
- Incident responders.
- What you would notice
- SBOMs left as build artifacts that expire.
- What you change
- Store them centrally, for example in Dependency-Track, keyed by release.
CycloneDX and SPDX
Both are standard formats. CycloneDX (OWASP) is common in security tooling and supports vulnerability and service data; SPDX (Linux Foundation, ISO/IEC 5962) has deep license expression support. Most tools read both, so pick one and generate it for every release.
VEX: affected or not
A Vulnerability Exploitability eXchange document records whether a listed vulnerability actually affects a product, for example because the vulnerable function is never called. It turns a long scanner list into decisions others can reuse.
{"vulnerability":{"id":"CVE-2024-0000"},
"analysis":{"state":"not_affected","justification":"code_not_reachable"},
"affects":[{"ref":"pkg:npm/example-lib@3.1.0"}]}Check yourself
Recognition and the fix. Nothing here is a procedure.
A library is not in package.json but appears in the SBOM. Why?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.