Skip to content

Syft

17 commands

Generates a software bill of materials (SBOM) from container images and filesystems in SPDX, CycloneDX and other formats.

  • SBOM
  • containers
  • supply chain

Install Syft

brew install syft

Generating SBOMs7

syft <image>

Lists every package found in an image as a table.

Link
syft dir:<path>

Catalogues a directory — lock files, manifests and binaries.

Link
syft file:<path>

Catalogues a single file such as a JAR or binary.

Link
syft docker-archive:<file>

Reads an image saved with docker save.

Link
syft registry:<image>

Pulls straight from a registry without a Docker daemon.

Link
syft <image> --scope all-layers

Includes packages from every layer, even ones deleted later.

Link
syft <image> --exclude <glob>

Skips paths you do not want catalogued.

Link

Formats5

syft <image> -o spdx-json

SPDX JSON, a widely accepted SBOM standard.

Link
syft <image> -o cyclonedx-json

CycloneDX JSON, preferred by many security platforms.

Link
syft <image> -o syft-json

Syft’s own lossless format with the most detail.

Link
syft <image> -o table -o spdx-json=<file>

Writes several formats in one run.

Link
syft convert <sbom> -o <format>

Converts an existing SBOM between formats.

Link

Inspecting3

syft <image> -o json | jq '.artifacts[] | {name, version, type}'

Extracts package names, versions and ecosystems with jq.

Link
syft <image> --select-catalogers <name>

Runs only particular catalogers, such as Python or Java.

Link
syft cataloger list

Lists all available catalogers.

Link

Attestation2

syft attest --output spdx-json <image>

Generates an SBOM and signs it as an in-toto attestation with cosign.

Link
syft <image> -o spdx-json | grype

Pipes the SBOM straight into Grype for vulnerability matching.

Link