How do you generate and use an SBOM with Syft and Grype?
BeginnerConceptSupply Chain, SBOM, Signing and Image/IaC Scanning
Answer
syft myapp:1.4.2 -o cyclonedx-json=sbom.cdx.json
syft dir:. -o spdx-json=sbom.spdx.json
grype sbom:sbom.cdx.json --fail-on high
Syft catalogues packages from image layers or directories; Grype matches the SBOM against its vulnerability DB. Scanning the stored SBOM later (without the image) is how you re-check old releases against new CVEs.