Sub topic 1
What Is Inside a Container Image?
Prerequisites
Assume you can pull, build, and run Docker images. You should also know basic Dockerfile syntax and understand that software packages can have dependencies.
Image layers and installed packages
A container image is a collection of read-only layers. Each Dockerfile instruction can add a layer. The layers contain files such as the application, system libraries, package-manager metadata, and language dependencies.
A scanner examines the final filesystem and its package metadata. It may report a vulnerable package even when your application does not directly use it. A package in a base image can create the finding.
CVEs, severity, and fixed versions
A CVE, or Common Vulnerabilities and Exposures identifier, names a publicly recorded security issue. Advisory databases associate a CVE with affected package versions and sometimes a fixed version.
| Field | Meaning |
|---|---|
| CVE identifier | The public identifier for a vulnerability |
| Severity | An estimate of potential impact, such as low, high, or critical |
| Fixed version | The package version that contains a vendor-provided fix |
Severity helps prioritize work, but it does not prove exploitability in your runtime. “Unfixed” means the database has no available fixed version. It does not mean the finding is harmless.
SBOMs: the inventory scanners work from
An SBOM, or Software Bill of Materials, is a machine-readable inventory of software components and versions. Scanners match this inventory against vulnerability databases. Accurate package metadata improves matching, while incomplete metadata can produce missing or uncertain results.
Getting started with Docker Scout
Docker Scout is integrated with Docker workflows. Scan an image such as nginx:latest:
docker scout quickview nginx:latestThe quick view summarizes vulnerability counts and image information. It is useful for a first assessment before examining individual findings.
Reading vulnerability lists with `docker scout cves`
Use docker scout cves to list package-level findings. To focus on urgent results:
docker scout cves --only-severity critical,high nginx:latestRead each result together with its package, installed version, severity, CVE, and fixed-version information. Then decide whether to update the base image, update an application dependency, or document an accepted risk.
Exercise
Why might a scanner report a vulnerability that your application does not directly depend on?
Show answer
The vulnerable package may come from the image's base operating system or another transitive dependency.