Sachin Chaurasiya

Path 06 · learning path

Software Supply Chain Security

Where compromise enters between source and a running container, and the control at each link: an SBOM of a real image with Syft, findings and fixes with Grype, signing and verification by digest with Cosign, and an SBOM attached as an attestation. Container Security asks what is in the image; this path asks whether it is the image you built.

Parts
5 parts
Total reading time
~44 min to read
Difficulty
intermediate

What you will learn

  • Map the delivery chain from source to running container and name the control at each step
  • Generate an SBOM for a real image with Syft and read what it does and does not tell you
  • Scan the SBOM with Grype, fix the base image and dependencies, and prove the improvement with a rescan
  • Sign an image by digest with Cosign, watch a moved tag fail verification, and attach the SBOM as an attestation

Before you start

Knowledge assumed

  • Container images, tags and registries (the Container Security path covers them)
  • Reading JSON with jq or Python
  • Builds on Container Security

Hands-on environment

  • Docker, to run Syft, Grype, Cosign and a local registry from their images
  • Any small image to work on; the parts use the CI/CD Engineering sample application

Each part names what it needs. Nothing has to be installed before part 1.

The path

5 parts, in order

Each part states what it assumes from the previous one, so you can also jump in where your setup already is.

  1. Part 1 of 5 Start here

    Understanding the Software Supply Chain

    The delivery chain from source through dependencies, build, artifact, image, registry and deployment; where each link can be compromised; and the control for each, from lockfiles and SBOMs to signing by digest.

    DevSecOps intermediate 9 min read
  2. Part 2 of 5

    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.

    DevSecOps intermediate 8 min read
  3. Part 3 of 5

    Scan Images and SBOMs with Grype: From 183 Findings to 3

    Grype against the SBOM from part 2: 183 matches read by severity, ecosystem and fix state; two Dockerfile changes that take it to 3; exit-code behaviour for CI; and how to triage what remains.

    DevSecOps intermediate 11 min read
  4. Part 4 of 5

    Sign and Verify Container Images with Cosign

    Cosign with a key pair against a local registry: why the digest is the identity; signing and verifying; a moved tag failing verification while the digest passes; keyless signing as configuration; where the check goes.

    DevSecOps intermediate 9 min read
  5. Part 5 of 5

    Attestations and Provenance: Binding the SBOM to the Image

    Turn the SBOM from part 2 into a Cosign attestation bound to the image digest, verify it and read the predicate back, list what hangs off an image with cosign tree, and see what SLSA build provenance adds.

    DevSecOps intermediate 7 min read

Practise

Labs that exercise this path

All labs →
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
Lab

Secure Docker Images with Trivy

Build a deliberately weak image, scan it with Trivy, and rebuild it until the gate for fixable HIGH and CRITICAL findings passes: current base, non-root user, patched packages, no pip in the runtime image.

beginner 30 minutes Trivy · Docker

Toolchain

Tool profiles used in this path

All tools →
secure SBOM generation

Syft

Generates SBOMs (CycloneDX, SPDX) from images, directories and archives.

secure Vulnerability scanner

Grype

Vulnerability scanner for images, filesystems and SBOMs produced by Syft.

package Artifact signing

Cosign (Sigstore)

Signs and verifies container images, SBOMs and attestations.

secure Vulnerability & misconfiguration scanner

Trivy

All-in-one scanner for container images, filesystems, IaC, Kubernetes and SBOMs.

After the last part

Where to go next

One path picks up where this one stops. It is a suggestion, not a requirement.