You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/manuals/dhi/how-to/scan.md
+87Lines changed: 87 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,93 @@ Example output:
53
53
54
54
For more detailed filtering and JSON output, see [Docker Scout CLI reference](/reference/cli/docker/scout/).
55
55
56
+
### Build child images with provenance attestations
57
+
58
+
When you build a custom image that uses a Docker Hardened Image as its base, you must build with `--provenance=mode=max` and `--sbom=true` so that Docker Scout can trace the base image lineage and correctly apply VEX statements.
59
+
60
+
Without these flags, Docker Scout cannot identify the DHI base image in
61
+
the provenance chain. As a result, it reports CVEs that are already suppressed
62
+
by VEX statements in the base image, producing false CVE positives in your
63
+
scan results.
64
+
65
+
> [!NOTE]
66
+
> **Why provenance attestation is required**
67
+
>
68
+
> Docker Scout uses max-mode provenance attestations to identify the DHI base image
69
+
> and track its lineage. A cryptographically signed provenance attestation ensures that
70
+
> base image lineage is verified and tamper-resistant, giving Docker Scout the trust
71
+
> anchor it needs to correctly apply VEX statements from the base image.
72
+
73
+
To build with maximum provenance and SBOM attestations:
74
+
75
+
```console
76
+
$ docker build \
77
+
--provenance=mode=max \
78
+
--sbom=true \
79
+
--push \
80
+
-t docker.io/<namespace>/<image>:<tag> .
81
+
```
82
+
83
+
After building with these flags, Docker Scout reads the full provenance
84
+
chain, matches the DHI base image, and applies its VEX statements. Scans of
85
+
your child image then reflect the correct suppressed CVEs, giving you an
86
+
accurate vulnerability assessment.
87
+
88
+
### VEX attestations in child images
89
+
90
+
If you introduce new layers in your child image and want to suppress CVEs in those layers, you can attach your own VEX attestation to the child image independently, you do not need to duplicate or aggregate the VEX statements from the DHI base image.
91
+
92
+
When `docker scout cves` runs against your child image, Scout reads VEX attestations from the full provenance chain and applies them cumulatively:
93
+
94
+
-**Base image VEX** - attached to the DHI, applied to CVEs in base image layers
95
+
-**Child image VEX** - attached to your image, applied to CVEs in layers you introduced
96
+
97
+
For example, if you add a `requests` layer to a DHI Python base image and attach a VEX statement suppressing `CVE-2024-47081`, Scout applies both VEX attestations independently and attributes each to its respective author:
98
+
99
+
```text
100
+
✓ VEX statements obtained from attestation
101
+
CVE-2024-47081 VEX: not affected [vulnerable code not present] : <your-namespace>
102
+
```
103
+
104
+
Scout suppresses CVEs from the DHI base VEX and CVEs from your child VEX in the same scan - no aggregate VEX document is required.
105
+
106
+
To create and attach a VEX attestation to your child image:
0 commit comments