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.
More on Security and scanning
A scan reports 300 CVEs in your base image. How do you triage?IntermediateAdd vulnerability scanning to CI so critical findings block the merge.BeginnerWhy is mounting `/var/run/docker.sock` into a container dangerous?IntermediateA developer asks for `--privileged`. What do you do?IntermediateHarden a container run command for a stateless web API.IntermediateA pentester got root inside a container. How bad is it?Advanced