RousselTMLEARNING

Observabilité

SBOM: the component inventory of your images

Generate a CycloneDX or SPDX SBOM, rescan it without rebuilding and know in seconds which images a new flaw affects.

1. What is an SBOM for? #

Knowing what runs.

The principle #

An SBOM (Software Bill of Materials) lists all components of an image, with versions and licenses. The day a flaw like Log4Shell is published, it answers “which images are affected?” in seconds, without rescanning everything. Recent regulations, such as the EU Cyber Resilience Act, also ask for it.

From build to incident response with an SBOM

2. Generating and using an SBOM #

With Trivy.

Generate #

trivy image --format cyclonedx -o sbom.cdx.json monimage:1.0
trivy image --format spdx-json -o sbom.spdx.json monimage:1.0

On the official nginx image, Trivy produced a CycloneDX 1.7 SBOM with 154 components.

Rescan without rebuilding #

trivy sbom sbom.cdx.json
trivy sbom --severity CRITICAL sbom.cdx.json

Keep the SBOM of each deployed version: when a new CVE comes out, rescan the SBOMs rather than the images.

Formats and tools #

ItemRole
CycloneDXSecurity-oriented format (OWASP)
SPDXStandardized format (ISO/IEC 5962), license-oriented
SyftAnchore’s SBOM generator
docker buildx --sbomSBOM attestation attached to the image at build
Going further. Sign the image and its SBOM (Cosign, Notation) to prove their provenance: the basis of a trusted supply chain.

Sources #

SBOM generated with Trivy 0.76.2.

Related articles

Hardened images: reducing your containers’ attack surface

Choosing a hardened base image: slim, distroless, Docker Hardened Images, Chainguard; non-root, pinned versio…

Linting Dockerfiles with Hadolint and docker build --check

Spot Dockerfile errors and bad practices before building: Hadolint, its rules, thresholds, and BuildKit built…

Scanning Docker images: Trivy, Grype and Docker Scout

Detect image vulnerabilities and misconfigurations with Trivy, read results, filter what is fixable and block…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!