01 / 20

Image Provenance
& Dependencies

Learn where your container images come from, why their dependency chains matter, and how to evaluate trust and risk in your software supply chain.

Cyber Security

What Is a Container Image?

A container image is a lightweight, standalone package that includes everything needed to run a piece of software: the code, runtime, libraries, and system tools. Think of it as a snapshot of a configured machine, frozen in time.

Layered
Images are built in layers, each adding files on top of the last.
Immutable
Once built, an image does not change. New changes create new images.
Portable
Images run identically on any system with a compatible container runtime.

What Is Image Provenance?

Provenance is the verifiable history of an image: who built it, what source code was used, when it was built, and how it was assembled. It answers the question: "Can I trust this image?"

Understanding Dependencies

A dependency is any external component your image relies on to function: base OS images, language runtimes, libraries, and packages. Dependencies form a tree that can be hundreds of nodes deep.

Your Application Base OS Image Language Runtime glibc openssl pip / npm frameworks libcrypto requests lib Transitive dependencies: inherited risk you may not see

Why Provenance & Dependencies Matter

Every dependency you include is code you did not write but must still trust. Attackers target the weakest link in this chain. High-profile breaches like the SolarWinds and Log4Shell attacks exploited exactly this trust relationship.

Supply Chain Attacks
Adversaries inject malicious code into popular libraries, affecting all downstream consumers.
Vulnerability Inheritance
A single CVE in a base image can make thousands of production deployments vulnerable.
Compliance
Regulations increasingly require a verifiable Software Bill of Materials (SBOM).

The Trust Chain Model

Every container image inherits the trust level of its least-trusted dependency. This is the fundamental security rule of image provenance:

Official OS ✓ Signed Runtime ✓ Signed Library X ✕ Unknown Final Image ✕ Untrusted Weakest link breaks the chain Trust level = min(all component trust levels)

Direct vs. Transitive Dependencies

Direct Dependencies Transitive Dependencies
Definition Libraries you explicitly install Libraries your libraries depend on
Visibility Listed in your Dockerfile / manifest Often hidden several layers deep
Control You choose the version and source Chosen by upstream maintainers
Risk Level Moderate: you can audit them High: harder to track and patch
Example Flask in requirements.txt Werkzeug pulled in by Flask

How Image Layers Work

Layer 1: Base OS (ubuntu:22.04) Layer 2: apt install python3 Layer 3: pip install flask Layer 4: COPY app.py . Inherited Inherited Added Your code Attack Surface Each layer adds packages, files, and potential vulnerabilities

Tools for Verification

SBOM
Software Bill of Materials: a complete inventory of every component inside an image.
Image Signing
Cryptographic signatures (e.g., Cosign, Notary) prove an image was built by a trusted party.
Vulnerability Scanners
Tools like Trivy, Grype, and Snyk scan layers for known CVEs in packages.

Step-by-Step: Evaluating an Image

1
Check the source. Is the image from an official registry (Docker Hub Verified, GitHub Container Registry)?
2
Verify the signature. Use cosign verify or docker trust inspect to confirm cryptographic authenticity.
3
Inspect the Dockerfile. Read the build instructions. Does it use a minimal base? Are versions pinned?
4
Scan for vulnerabilities. Run a scanner (e.g., Trivy) and review the CVE report before deployment.
5
Generate an SBOM. Produce a bill of materials for audit and compliance tracking.

Example 1: Good Provenance

# Dockerfile with good provenance practices FROM python:3.11-slim@sha256:a1b2c3d4... # ↑ Pinned to exact digest, not just a tag RUN pip install --no-cache-dir \ flask==3.0.0 \ gunicorn==21.2.0 # ↑ Exact versions pinned COPY app.py /app/ USER nonroot # ↑ Non-root user for least privilege

Example 2: Poor Provenance

# Dockerfile with poor provenance practices FROM ubuntu:latest # ↑ "latest" tag can change at any time RUN apt-get update && apt-get install -y \ python3 python3-pip curl wget # ↑ Unpinned versions, unnecessary packages RUN pip install flask requests # ↑ No version pinning at all COPY . /app/ # ↑ Copies everything, including secrets

Example 3: Tracing a Vulnerability

Suppose a scanner reports CVE-2024-XXXX in libcrypto 3.0.2. How do you trace where this came from?

CVE in libcrypto 3.0.2 openssl 3.0.2 (depends on it) python3 (links openssl) ubuntu:22.04 base image Vulnerability Transitive dep Direct dep Base image Fix: update base image or pin openssl >= 3.0.12

Registry Trust Levels

Official / Verified
Published by Docker, the software vendor, or a verified organization. Cryptographically signed. Highest trust.
Community
Published by individual users. May have many stars and pulls but no formal verification. Medium trust.
Unknown / Private
From unknown registries or private repos without signatures. No external validation. Lowest trust.

Common Mistakes

✕ Using :latest Tags
The "latest" tag is mutable. Your image could silently change between builds, introducing unknown code.
✕ Ignoring Base Image CVEs
Assuming "official" means "vulnerability-free." Even official images ship with known CVEs that need patching.
✕ No Dependency Pinning
Not locking library versions allows compromised or buggy updates to enter your supply chain.
✕ Skipping Scanning
Deploying without running a vulnerability scan means flying blind into production with unknown risks.

Summary: Key Concepts

Concept What It Means How to Address It
Provenance Where an image came from and who built it Verify signatures, check publisher
Direct Dependencies Packages you explicitly include Pin exact versions in manifests
Transitive Dependencies Hidden packages pulled in by your deps Generate SBOM, scan recursively
Image Layers Stacked filesystem changes in a build Use minimal base, reduce layers
Trust Chain Security is only as strong as weakest link Validate every component

Question 1 of 5

What does image provenance primarily help you determine?

Question 2 of 5

A transitive dependency is best described as:

Question 3 of 5

Why is using FROM ubuntu:latest in a Dockerfile considered a security risk?

Question 4 of 5

According to the Trust Chain Principle, what determines the overall trust level of a container image?

Question 5 of 5

Which combination of tools provides the strongest assurance about an image's security posture?