Skip to main content
Security & multi-tenancyLesson 8 of 13

Image and Supply Chain Security

The software supply chain is the whole path from source → dependencies → build → image → deploy. If any one point is compromised, malicious code ships through the normal process. Let's follow one image along this path and see where each check is placed.

Vuln scanNot yet
SignatureNone
Deploy points to-
Source · depsbase imageBuildmakes the imageVuln scane.g. TrivySigningproves the builderSBOMcomponent listDeploy requestmanifestAdmissionchecks sig · policyRegistrye.g. HarborwebPodSource + deps
RequestResponse / reportAppears in a later step

What you will learn

  • Where supply chain attacks strike
  • What SBOM, scanning and signing each verify
  • Why pin by digest instead of tag
  • Why signatures matter only if checked at deploy

What each check verifies, and its limits​

CheckWhat it verifiesLimit
Vulnerability scanWhether image packages have known vulnerabilities (CVEs)Cannot find unknown flaws. Rescan when new vulnerabilities are published
SBOMThe full component list of the imageOnly a list, not proof of safety
SignatureThat our build made it and it was not changedMeaningful only with a policy that verifies at deploy
Digest pinningExactly which image is deployedHard for humans to read. Add a version tag too

Example: an image registry like Harbor can attach Trivy as a scanner to scan stored images and show the results (CVE ID, package name, installed version, fixed version, severity). Locally you can run the same scan with trivy image <image>.

Try it yourself​

kubectl get pods -n <namespace> -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.containerStatuses[*].imageID}{"\n"}{end}' # Digest each Pod actually runs
trivy image --format cyclonedx --output sbom.json <image> # Generate an SBOM
trivy image --severity HIGH,CRITICAL --ignore-unfixed <image> # High severity with a fixed version first
cosign verify --key <cosign.pub> <image> # Who built it, and is it unchanged?
kubectl get validatingwebhookconfigurations # Is a policy verifying signatures at deploy?

Check yourself

  1. Your images are signed in CI, but a swapped image in the registry still runs in the cluster. What is missing?
  2. Pods in one Deployment run different versions of app:latest, yet the manifest never changed. Why?
  3. A new vulnerability is announced in a library. What helps you find at once which of your images contain it?

Further reading: Images · Harbor docs · Sigstore docs · Trivy