Interview Prep/Docker/Security and scanning

How do you generate and use an SBOM for images?

IntermediateScenarioSecurity and scanning
Answer

Situation read → When a new CVE like Log4Shell drops, you need to know which images contain it.

What I'd do →

syft app:1.8.2 -o spdx-json > sbom.spdx.json
docker buildx build --sbom=true --push -t reg/app:1.8.2 .
grype sbom:sbom.spdx.json

Store SBOMs next to images (attached as OCI attestations) and index them.

Why → Query inventory instead of rescanning everything.

Interview tip → cosign attest --type spdxjson signs the SBOM.

All Docker questions Roadmap: Docker & containers

More on Security and scanning