Sachin Chaurasiya

Secure · SBOM generation

Syft

Syft catalogs the packages inside container images, filesystems and source trees and emits software bills of materials in CycloneDX, SPDX and its own JSON format for downstream scanning and attestation.

Stage
Secure
Category
SBOM generation
Website
github.com
Documentation
Official docs
License
Apache-2.0
On this page

What it does

Inventories OS packages and language dependencies (npm, pip, Go modules, Java, Rust, .NET and more) and writes a standards-compliant SBOM.

Where it fits

Secure and Package: generate an SBOM for every built image and attach it to the release (cosign attach sbom) so it can be re-scanned as new CVEs appear.

Quick start

syft registry.example.com/app:1.2.3 -o cyclonedx-json=app.cdx.json
syft dir:. -o spdx-json=source.spdx.json

Common pitfalls

  • Compiled-only images (no lockfiles, no package DB) produce thin SBOMs; keep metadata in the final stage or generate from source.
  • Pin the output schema version (cyclonedx-json@1.5) when a downstream tool is strict.

On this site

Hands-on labs using Syft

Lab

Generate an SBOM with Syft and Scan It with Grype

Produce CycloneDX and SPDX bills of materials for a container image without a Docker socket, scan the SBOM with Grype, gate on fixable findings only, and see why the SBOM is worth keeping after the release.

intermediate 35 minutes Syft · Grype · Docker

Articles about Syft

DevSecOps intermediate

Generate an SBOM with Syft and Read What It Tells You

Run Syft from its container against a small Node.js image, read the CycloneDX output package by package, see where each one came from, learn what an SBOM does not prove, and store it next to the artifact.

8 min read