Skip to content

Commit 1762a2f

Browse files
scout: add new dhi policy (#23650)
<!--Delete sections as needed --> ## Description Add new scout DHI policy. Topics updated: - https://deploy-preview-23650--docsdocker.netlify.app/scout/policy/#valid-docker-hardened-image-dhi-or-dhi-base-image - https://deploy-preview-23650--docsdocker.netlify.app/dhi/how-to/policies/ Any change required for https://deploy-preview-23650--docsdocker.netlify.app/scout/policy/scores/#policy-weights ? ## Related issues or tickets ENGDOCS-3097 ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [ ] Editorial review - [ ] Product review --------- Signed-off-by: Craig Osterhout <[email protected]>
1 parent 1b9250b commit 1762a2f

File tree

2 files changed

+61
-29
lines changed

2 files changed

+61
-29
lines changed

content/manuals/dhi/how-to/policies.md

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ images without additional setup. Using Docker Scout policies, you can define and
1414
apply rules that ensure only approved and secure images, such as those based on
1515
DHIs, are used across your environments.
1616

17+
Docker Scout includes a dedicated [**Valid Docker Hardened Image (DHI) or DHI
18+
base
19+
image**](../../scout/policy/_index.md#valid-docker-hardened-image-dhi-or-dhi-base-image)
20+
policy type that validates whether your images are Docker Hardened Images or are
21+
built using a DHI as the base image. This policy checks for valid Docker signed
22+
verification summary attestations.
23+
1724
With policy evaluation built into Docker Scout, you can monitor image compliance
1825
in real time, integrate checks into your CI/CD workflows, and maintain
1926
consistent standards for image security and provenance.
@@ -33,23 +40,18 @@ Docker Scout automatically evaluates policy compliance when new images are
3340
pushed. Each policy includes a compliance result and a link to the affected
3441
images and layers.
3542

36-
## Create policies for your DHI-based images
37-
38-
To ensure that the images you build using Docker Hardened Images remain secure,
39-
you can create Docker Scout policies tailored to your requirements for your own
40-
repositories. These policies help enforce security standards such as preventing
41-
high-severity vulnerabilities, requiring up-to-date base images, or validating
42-
the presence of key metadata.
43+
## Evaluate DHI policy compliance for your images
4344

44-
Policies evaluate images when they are pushed to a repository, allowing you to
45-
track compliance, get notified of deviations, and integrate policy checks into
46-
your CI/CD pipeline.
45+
When you enable Docker Scout for your repositories, you can configure the
46+
[**Valid Docker Hardened Image (DHI) or DHI base
47+
image**](../../scout/policy/_index.md#valid-docker-hardened-image-dhi-or-dhi-base-image)
48+
policy. This optional policy validates whether your images are DHIs or built with DHI
49+
base images by checking for Docker signed verification summary attestations.
4750

48-
### Example: Create a policy for DHI-based images
51+
The following example shows how to build an image using a DHI base image and
52+
evaluate its compliance with the DHI policy.
4953

50-
This example shows how to create a policy that requires all images in your
51-
organization to use Docker Hardened Images as their base. This ensures that
52-
your applications are built on secure, minimal, and production-ready images.
54+
### Example: Build and evaluate a DHI-based image
5355

5456
#### Step 1: Use a DHI base image in your Dockerfile
5557

@@ -85,26 +87,30 @@ $ docker scout enroll YOUR_ORG
8587
$ docker scout repo enable --org YOUR_ORG YOUR_ORG/my-dhi-app
8688
```
8789

88-
#### Step 4: Create a policy
90+
#### Step 4: Configure the DHI policy
91+
92+
Once Docker Scout is enabled, you can configure the **Valid Docker Hardened
93+
Image (DHI) or DHI base image** policy for your organization:
8994

9095
1. Go to the [Docker Scout dashboard](https://scout.docker.com).
9196
2. Select your organization and navigate to **Policies**.
92-
3. Select **Add policy**.
93-
4. Select **Configure** for **Approved Base Images Policy**.
94-
5. Give the policy a compliant name, such as **Approved DHI Base Images**.
95-
6. In **Approved base image sources**, delete the default item.
96-
7. In **Approved base image sources**, add approved base image sources. For this
97-
example, use the wildcard (`*`) to allow all mirrored DHI repositories,
98-
`docker.io/ORG_NAME/dhi-*`. Replace `ORG_NAME` with your organization name.
99-
8. Select **Save policy**.
97+
3. Configure the **Valid Docker Hardened Image (DHI) or DHI base image** policy
98+
to enable it for your repositories.
99+
100+
For more information on configuring policies, see
101+
[Configure policies](../../scout/policy/configure.md).
102+
103+
#### Step 5: View policy compliance
100104

101-
#### Step 5: Evaluate policy compliance
105+
Once the DHI policy is configured and active, you can view compliance results:
102106

103107
1. Go to the [Docker Scout dashboard](https://scout.docker.com).
104108
2. Select your organization and navigate to **Images**.
105109
3. Find your image, `YOUR_ORG/my-dhi-app:v1`, and select the link in the **Compliance** column.
106110

107-
This shows the policy compliance results for your image, including whether it
108-
meets the requirements of the **Approved DHI Base Images** policy.
111+
This shows the policy compliance results for your image. The **Valid Docker
112+
Hardened Image (DHI) or DHI base image** policy evaluates whether your image has
113+
a valid Docker signed verification summary attestation or if its base image has
114+
such an attestation.
109115

110116
You can now [evaluate policy compliance in your CI](/scout/policy/ci/).

content/manuals/scout/policy/_index.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ Docker Scout supports the following policy types:
6363
- [Default Non-Root User](#default-non-root-user)
6464
- [Approved Base Images](#approved-base-images)
6565
- [SonarQube Quality Gates](#sonarqube-quality-gates)
66+
- [Valid Docker Hardened Image (DHI) or DHI base image](#valid-docker-hardened-image-dhi-or-dhi-base-image)
6667

6768
Docker Scout automatically provides default policies for repositories where it
68-
is enabled, except for the SonarQube Quality Gates policy, which requires
69-
[integration with SonarQube](/manuals/scout/integrations/code-quality/sonarqube.md)
70-
before use.
69+
is enabled, except for the following policies, which are optional and must be
70+
configured:
71+
72+
- The **SonarQube Quality Gates** policy, which requires
73+
[integration with SonarQube](/manuals/scout/integrations/code-quality/sonarqube.md)
74+
before use.
75+
- The **Valid Docker Hardened Image (DHI) or DHI base image** policy, which can
76+
be configured if you want to enforce the use of Docker Hardened Images.
7177

7278
You can create custom policies from any of the supported policy types, or
7379
delete a default policy if it isn't applicable to your project. For more
@@ -358,6 +364,26 @@ in the CLI.
358364
> a SonarQube analysis and policy evaluation after enabling the integration to
359365
> view the results in Docker Scout.
360366
367+
### Valid Docker Hardened Image (DHI) or DHI base image
368+
369+
The **Valid Docker Hardened Image (DHI) or DHI base image** policy type ensures
370+
that your images are either Docker Hardened Images (DHI) or are built using a
371+
DHI as the base image.
372+
373+
This policy validates images by checking for a valid Docker signed verification
374+
summary attestation. The policy considers an image compliant if either:
375+
376+
- The image itself is a Docker Hardened Image with a valid Docker signed
377+
verification summary attestation, or
378+
- The base image used in the build (identified from SLSA provenance
379+
attestations) has a valid Docker signed verification summary attestation
380+
381+
Images are non-compliant with this policy if they lack the required Docker
382+
signed verification summary attestation and are not built from a base image
383+
with such an attestation.
384+
385+
This policy has no configurable parameters.
386+
361387
## No base image data
362388

363389
There are cases when it's not possible to determine information about the base

0 commit comments

Comments
 (0)