What is an SBOM and how do you generate one?

BeginnerConceptSBOM
Answer

Short answer

An SBOM (Software Bill of Materials) is a complete list of every component inside your software — every library, package and version, plus licences. You generate it with tools like Syft or Trivy, usually in standard formats called SPDX or CycloneDX.

Explained in simple words

A packet of biscuits has an ingredients list. If an ingredient is found to be unsafe, you can check every packet's list and know instantly which ones are affected. An SBOM is the ingredients list for software. When a big vulnerability like Log4Shell appears, teams with SBOMs can answer "are we affected, and where?" in minutes instead of weeks.

Example — generate and use an SBOM

# Generate with Syft
syft orders-api:1.0 -o cyclonedx-json > sbom.json
syft dir:. -o spdx-json > sbom-spdx.json

# Generate with Trivy
trivy image --format cyclonedx --output sbom.json orders-api:1.0

# Later: scan the SBOM for vulnerabilities (no need to pull the image again)
grype sbom:./sbom.json
trivy sbom sbom.json

A small part of a CycloneDX SBOM:

{
  "bomFormat": "CycloneDX",
  "components": [
    { "name": "express", "version": "4.19.2", "purl": "pkg:npm/[email protected]", "licenses": [{ "license": { "id": "MIT" } }] },
    { "name": "openssl", "version": "3.0.11", "purl": "pkg:deb/debian/[email protected]" }
  ]
}

SPDX vs CycloneDX

SPDX CycloneDX
Created by Linux Foundation OWASP
Strong at Licence compliance Security and vulnerability use cases
Both Machine-readable (JSON, XML), widely supported

How it fits in the pipeline

  1. Build the image.
  2. Generate the SBOM and store it with the release (artifact store or registry).
  3. Optionally sign it or attach it as an attestation (with cosign) so others can trust it.
  4. Continuously re-scan stored SBOMs when new CVEs are published.

What to say in the interview

"An SBOM is an inventory of every component and version in our software. We generate it in CycloneDX format with Syft or Trivy for every image build and store it with the release. When a new critical CVE comes out, we search our SBOMs to find every affected image immediately. Many customers and regulations now ask for SBOMs, and it's a key part of software supply-chain security."

Follow-up questions you may get

  • What is a purl? A package URL — a standard ID like pkg:npm/[email protected] that uniquely identifies a package.
  • SBOM vs vulnerability scan? The SBOM lists what's inside; the scan checks those items against known vulnerabilities.
All Security Tools questions Roadmap: SBOM — software bill of materials

More on SBOM