Prerequisites
- Target system, dependencies and environment configured.
Usage
Purpose
You can't defend a supply chain you can't enumerate. A Software Bill of Materials is the ingredient list — every component, version, and licence in an artifact — in a standard format. When the next Log4Shell drops, an SBOM answers "are we affected, and where" in seconds instead of a frantic week. This skill covers generating one and putting it to use.
When to use it
Generate an SBOM as a build output for anything you ship or run: application artifacts, container images, releases. It underpins vulnerability triage, licence compliance, and incident response, so it's the foundation for most of this domain.
Procedure
- Generate the SBOM from the artifact. Syft reads a container image, directory, or archive and lists everything it finds:
syft myapp:latest -o cyclonedx-json > sbom.json
Prefer a standard format — CycloneDX or SPDX — so other tools can consume it.
- Generate it from the built artifact, not just the source manifest. A lockfile lists declared deps; scanning the built image/binary captures what actually shipped, including transitive and system packages.
- Store the SBOM as a versioned build artifact, tied to the exact release it describes. An SBOM that doesn't match a specific build is worthless during an incident.
- Feed it to a scanner to turn the inventory into a risk view — the SBOM says what's there, the scanner says what's vulnerable:
trivy sbom sbom.json
- Diff SBOMs across releases to see what changed — a new dependency appearing is a supply-chain event worth noticing.
- When a new critical CVE lands, query your stored SBOMs for the affected component instead of re-scanning everything from scratch.
Cheatsheet
syft myapp:latest -o cyclonedx-json > sbom.json
syft dir:. -o spdx-json > sbom.spdx.json
trivy image --format cyclonedx -o sbom.json myapp:latest
trivy sbom sbom.json
grype sbom:sbom.json
grep -i 'log4j' sbom.json
Reading the output
- The component count and depth — a huge transitive tree is a large attack surface; it's worth knowing before an incident, not during one.
- Unexpected components you didn't knowingly pull in are the supply-chain signal — a package appearing that no one added deserves a look.
- Version accuracy matters most: the SBOM's value is answering "which version of X shipped", so verify it reflects the built artifact, not a stale manifest.
- Licences in the SBOM surface compliance risk (a copyleft dependency in a proprietary product) alongside the security view.
How to make it useful (the "fix")
An SBOM is only worth generating if it's used:
- Automate it in CI as a build artifact for every release, in a standard format (CycloneDX/SPDX).
- Store and index SBOMs so you can query across your whole estate when a CVE drops — that fast lookup is the entire payoff.
- Scan continuously, not once — the inventory is static, but new vulnerabilities against those components appear over time.
- Diff releases to catch new or changed dependencies early.
- Combine with signing/provenance (later skills in this domain) so you can also trust the SBOM reflects a build nobody tampered with.
Pitfalls
- Generating from source manifests only. Misses transitive and OS-level components that the built artifact actually contains.
- A one-off SBOM. Generated once and never regenerated, it drifts from reality and misleads during an incident.
- SBOM without scanning. An inventory nobody checks against vulnerability data is a document, not a control.
- No version linkage. An SBOM not tied to a specific build can't answer the one question you'll ask it under pressure.
References
- CycloneDX and SPDX specifications
- Syft, Trivy, and Grype documentation
- CISA — Software Bill of Materials guidance
- NTIA — Minimum Elements for an SBOM
Inputs
- Relevant source code, logs, network traces, or system specifications.
Outputs
- Analysis findings, security audit report, or generated code artifacts.
1---2name: sbom-generation3description: Use when you need a complete inventory of what's inside a build — every dependency and its version — as an SBOM you can scan, track, and hand to auditors.4---5678## Prerequisites9- Target system, dependencies and environment configured.1011## Usage12### Purpose1314You can't defend a supply chain you can't enumerate. A Software Bill of Materials is the ingredient list — every component, version, and licence in an artifact — in a standard format. When the next Log4Shell drops, an SBOM answers "are we affected, and where" in seconds instead of a frantic week. This skill covers generating one and putting it to use.1516### When to use it1718Generate an SBOM as a build output for anything you ship or run: application artifacts, container images, releases. It underpins vulnerability triage, licence compliance, and incident response, so it's the foundation for most of this domain.1920### Procedure21221. Generate the SBOM from the artifact. Syft reads a container image, directory, or archive and lists everything it finds:23 ```24 syft myapp:latest -o cyclonedx-json > sbom.json25 ```26 Prefer a standard format — **CycloneDX** or **SPDX** — so other tools can consume it.272. Generate it from the **built artifact**, not just the source manifest. A lockfile lists declared deps; scanning the built image/binary captures what actually shipped, including transitive and system packages.283. Store the SBOM as a versioned build artifact, tied to the exact release it describes. An SBOM that doesn't match a specific build is worthless during an incident.294. Feed it to a scanner to turn the inventory into a risk view — the SBOM says what's there, the scanner says what's vulnerable:30 ```31 trivy sbom sbom.json32 ```335. Diff SBOMs across releases to see what changed — a new dependency appearing is a supply-chain event worth noticing.346. When a new critical CVE lands, query your stored SBOMs for the affected component instead of re-scanning everything from scratch.3536### Cheatsheet3738```bash39syft myapp:latest -o cyclonedx-json > sbom.json40syft dir:. -o spdx-json > sbom.spdx.json4142trivy image --format cyclonedx -o sbom.json myapp:latest4344trivy sbom sbom.json45grype sbom:sbom.json4647grep -i 'log4j' sbom.json48```4950### Reading the output5152- **The component count and depth** — a huge transitive tree is a large attack surface; it's worth knowing before an incident, not during one.53- **Unexpected components** you didn't knowingly pull in are the supply-chain signal — a package appearing that no one added deserves a look.54- **Version accuracy** matters most: the SBOM's value is answering "which version of X shipped", so verify it reflects the built artifact, not a stale manifest.55- **Licences** in the SBOM surface compliance risk (a copyleft dependency in a proprietary product) alongside the security view.5657### How to make it useful (the "fix")5859An SBOM is only worth generating if it's used:6061- **Automate it in CI** as a build artifact for every release, in a standard format (CycloneDX/SPDX).62- **Store and index** SBOMs so you can query across your whole estate when a CVE drops — that fast lookup is the entire payoff.63- **Scan continuously**, not once — the inventory is static, but new vulnerabilities against those components appear over time.64- **Diff releases** to catch new or changed dependencies early.65- Combine with signing/provenance (later skills in this domain) so you can also trust the SBOM reflects a build nobody tampered with.6667### Pitfalls6869- **Generating from source manifests only.** Misses transitive and OS-level components that the built artifact actually contains.70- **A one-off SBOM.** Generated once and never regenerated, it drifts from reality and misleads during an incident.71- **SBOM without scanning.** An inventory nobody checks against vulnerability data is a document, not a control.72- **No version linkage.** An SBOM not tied to a specific build can't answer the one question you'll ask it under pressure.7374### References7576- CycloneDX and SPDX specifications77- Syft, Trivy, and Grype documentation78- CISA — Software Bill of Materials guidance79- NTIA — Minimum Elements for an SBOM8081## Inputs82- Relevant source code, logs, network traces, or system specifications.8384## Outputs85- Analysis findings, security audit report, or generated code artifacts.