Sub topic 5
Reading vulnerability lists with docker scout cves
This chapter assumes you have read the earlier chapters on CVEs, severity and fixed versions, and that you have Docker Scout available (it ships with recent Docker Desktop and as a CLI plugin) and are signed in to Docker. You should be comfortable pulling images and reading command output in a terminal.
What the command does
docker scout quickview gives you totals. docker scout cves gives you the list behind those totals. It reads the image's package inventory, matches each package against Scout's advisory data, and prints one entry per vulnerable package, grouped by package and sorted by severity.
docker scout cves nginx:latestThe command accepts a local image, an image in a registry, or other sources such as a directory or an archive. If the image is not in your local image store, Scout fetches its metadata from the registry.
Reading the output
Each package block shows the package URL (purl), the number of findings, and then one row per CVE. The fields you will use most often are:
| Field | Meaning |
|---|---|
| Package | The package name and version, written as a purl such as `pkg:deb/debian/[email protected]` |
| CVE ID | The identifier, for example `CVE-2024-00000` |
| Severity | Critical, High, Medium, Low, or Unspecified |
| Affected range | The package versions the advisory covers |
| Fixed version | The first version that contains a fix, or `not fixed` |
The fixed version column decides what you can do next. If a fixed version exists, you can usually get it by rebuilding on a newer base image or upgrading the package. If it says not fixed, no patched release exists yet, and your options are to accept the risk, mitigate it, or switch to a different base image.
Narrowing the list
An unfiltered list for a full Debian-based image can run to hundreds of lines. Filter it down to the findings you plan to act on.
docker scout cves --only-severity critical,high nginx:latest
docker scout cves --only-fixed --only-severity critical,high nginx:latestThe second command adds --only-fixed, which hides findings that have no fix available. This gives you a list in which every entry has a known remedy.
Two more options help in practice:
--only-package <name>limits output to a single package, which is useful when you are checking whether an upgrade resolved a specific finding.--format json --output cves.jsonwrites the results in a form other tools can read. Scout also supportssariffor code-scanning platforms.
Common mistakes
- Treating the count as a risk score. One image with 40 low findings is often safer than one with a single critical finding in a package that your application actually loads.
- Ignoring the fixed-version column. A critical finding with a fix is a rebuild. A critical finding with no fix needs a decision, which later chapters on triage cover.
- Scanning a stale local tag.
nginx:lateston your machine may be weeks older than the one in the registry. Pull first, or scan the exact digest you deploy. - Reading results as permanent. Advisory data changes daily. An image that scanned clean last month can show new findings today without any change to the image.
Exercise
You run docker scout cves --only-severity critical,high myapp:1.0 and see 12 findings. You want to know how many of them you can fix today by updating packages or the base image. Which option do you add, and why?
Show answer
Add --only-fixed. It hides findings with no fixed version, so the remaining entries are the ones for which a patched package version exists. The findings it hides still need a separate decision in triage.