Skip to content

Commit f40b119

Browse files
authored
Merge pull request #21028 from dvdksn/scout-policy-no-custom-ootb
scout: ootb policy → policy types
2 parents cd80a30 + 4976dae commit f40b119

File tree

10 files changed

+191
-165
lines changed

10 files changed

+191
-165
lines changed

content/manuals/build/building/best-practices.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,12 @@ to look up and include the image digest for base image versions manually each
229229
time you want to update it. And you're opting out of automated security fixes,
230230
which is likely something you want to get.
231231

232-
Docker Scout has a built-in [**No outdated base images**
233-
policy](../../scout/policy/_index.md#no-outdated-base-images) that checks for
234-
whether the base image version you're using is in fact the latest version. This
235-
policy also checks if pinned digests in your Dockerfile correspond to the
236-
correct version. If a publisher updates an image that you've pinned, the policy
237-
evaluation returns a non-compliant status, indicating that you should update
238-
your image.
232+
Docker Scout's default [**Up-to-Date Base Images**
233+
policy](../../scout/policy/_index.md#up-to-date-base-images) checks whether the
234+
base image version you're using is in fact the latest version. This policy also
235+
checks if pinned digests in your Dockerfile correspond to the correct version.
236+
If a publisher updates an image that you've pinned, the policy evaluation
237+
returns a non-compliant status, indicating that you should update your image.
239238

240239
Docker Scout also supports an automated remediation workflow for keeping your
241240
base images up-to-date. When a new image digest is available, Docker Scout can
@@ -245,8 +244,7 @@ changes the version automatically, because you're in control and you have an
245244
audit trail of when and how the change occurred.
246245

247246
For more information about automatically updating your base images with Docker
248-
Scout, see
249-
[Remediation](../../scout/policy/remediation.md#automatic-base-image-updates).
247+
Scout, see [Remediation](/manuals/scout/policy/remediation.md).
250248

251249
## Build and test your images in CI
252250

content/manuals/scout/integrations/code-quality/sonarqube.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ keywords: scout, supply chain, integration, code quality
66
---
77

88
The SonarQube integration enables Docker Scout to surface SonarQube quality
9-
gate checks through Policy Evaluation, under a new [SonarQube quality gates passed
10-
policy](/scout/policy/#sonarqube-quality-gates-passed).
9+
gate checks through Policy Evaluation, under a new [SonarQube Quality Gates
10+
Policy](/manuals/scout/policy/_index.md#sonarqube-quality-gates-policy).
1111

1212
## How it works
1313

@@ -68,8 +68,8 @@ To integrate Docker Scout with SonarQube, ensure that:
6868
statuses.
6969

7070
From the integration overview page, you can go directly to the
71-
**SonarQube quality gates passed** policy.
71+
**SonarQube Quality Gates Policy**.
7272
This policy will have no results initially. To start seeing evaluation results
7373
for this policy, trigger a new SonarQube analysis of your project and push the
7474
corresponding image to a repository. For more information, refer to the
75-
[policy description](../../policy/_index.md#sonarqube-quality-gates-passed).
75+
[policy description](../../policy/_index.md#sonarqube-quality-gates).

content/manuals/scout/integrations/source-code-management/github.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ containing security fixes. The `alpine:3.18` tag you've been using becomes
3434
out-of-date; the `alpine:3.18` you're using is no longer the latest.
3535

3636
When this happens, Docker Scout detects the discrepancy and surfaces it through
37-
the [No outdated base images](/scout/policy/#no-outdated-base-images) policy.
37+
the [Up-to-Date Base Images policy](/manuals/scout/policy/_index.md#up-to-date-base-images-policy).
3838
When the GitHub integration's enabled, you'll also get automated suggestions on
3939
how to update your base image. For more information about how Docker Scout can
4040
help you automatically improve your supply chain conduct and security posture,

content/manuals/scout/policy/_index.md

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -51,39 +51,47 @@ vulnerabilities. You can use policies to measure and track other aspects of
5151
supply chain management as well, such as open-source license usage and base
5252
image up-to-dateness.
5353

54-
## Out-of-the-box policies
54+
## Policy types
5555

56-
Docker Scout ships the following out-of-the-box policies:
56+
In Docker Scout, a *policy* is derived from a *policy type*. Policy types are
57+
templates that define the core parameters of a policy. You can compare policy
58+
types to classes in object-oriented programming, with each policy acting as an
59+
instance created from its corresponding policy type.
5760

58-
- [No fixable critical or high vulnerabilities](#no-fixable-critical-or-high-vulnerabilities)
59-
- [No AGPL v3 licenses](#no-agpl-v3-licenses)
60-
- [No outdated base images](#no-outdated-base-images)
61-
- [No high-profile vulnerabilities](#no-high-profile-vulnerabilities)
62-
- [Supply chain attestations](#supply-chain-attestations)
63-
- [Default non-root user](#default-non-root-user)
64-
- [No unapproved base images](#no-unapproved-base-images)
61+
Docker Scout supports the following policy types:
6562

66-
To give you a head start, Scout enables several policies by default for your
67-
Scout-enabled repositories. You can customize the default configurations to
68-
reflect internal requirements and standards. You can also disable a policy
69-
altogether if it isn't relevant to you. For more information, see [Configure
70-
policies](./configure.md).
63+
- [Severity-Based Vulnerability](#severity-based-vulnerability)
64+
- [Compliant Licenses](#compliant-licenses)
65+
- [Up-to-Date Base Images](#up-to-date-base-images)
66+
- [High-Profile Vulnerabilities](#high-profile-vulnerabilities)
67+
- [Supply Chain Attestations](#supply-chain-attestations)
68+
- [Default Non-Root User](#default-non-root-user)
69+
- [Approved Base Images](#approved-base-images)
70+
- [SonarQube Quality Gates](#sonarqube-quality-gates)
7171

72-
There's also a set of [additional policies](#additional-policies) that can be
73-
optionally enabled for repositories.
72+
Docker Scout automatically provides default policies for repositories where it
73+
is enabled, except for the SonarQube Quality Gates policy, which requires
74+
[integration with SonarQube](/manuals/scout/integrations/code-quality/sonarqube.md)
75+
before use.
7476

75-
### No fixable critical or high vulnerabilities
77+
You can create custom policies from any of the supported policy types, or
78+
delete a default policy if it isn't applicable to your project. For more
79+
information, refer to [Configure policies](./configure.md).
7680

77-
The **No fixable critical or high vulnerabilities** policy requires that your
78-
artifacts aren't exposed to known vulnerabilities where there's a fix version
79-
available. Essentially, this means that there's an easy fix that you can deploy
80-
for images that fail this policy: upgrade the vulnerable package to a version
81-
containing a fix for the vulnerability.
81+
<!-- vale Docker.HeadingSentenceCase = NO -->
8282

83-
By default, this policy only flags critical and high severity vulnerabilities.
83+
### Severity-Based Vulnerability
8484

85-
This policy is violated if an artifact is affected by one or more critical-
86-
or high-severity vulnerability, where a fix version is available.
85+
The **Severity-Based Vulnerability** policy type checks whether your
86+
artifacts are exposed to known vulnerabilities.
87+
88+
By default, this policy only flags critical and high severity vulnerabilities
89+
where there's a fix version available. Essentially, this means that there's an
90+
easy fix that you can deploy for images that fail this policy: upgrade the
91+
vulnerable package to a version containing a fix for the vulnerability.
92+
93+
Images are deemed non-compliant with this policy if they contain one or more
94+
vulnerabilities that fall outside the specified policy criteria.
8795

8896
You can configure the parameters of this policy by creating a custom version of the policy.
8997
The following policy parameters are configurable in a custom version:
@@ -109,31 +117,32 @@ The following policy parameters are configurable in a custom version:
109117

110118
For more information about configuring policies, see [Configure policies](./configure.md).
111119

112-
### No AGPL v3 licenses
120+
### Compliant Licenses
113121

114-
The **No AGPL v3 licenses** policy requires that your artifacts don't contain
115-
packages distributed under an AGPLv3 license. This policy is violated if
116-
your artifacts contain one or more packages with this license.
122+
The **Compliant Licenses** policy type checks whether your images contain
123+
packages distributed under an inappropriate license. Images are considered
124+
non-compliant if they contain one or more packages with such a license.
117125

118126
You can configure the list of licenses that this policy should look out for,
119127
and add exceptions by specifying an allow-list (in the form of PURLs).
120128
See [Configure policies](./configure.md).
121129

122-
### No outdated base images
130+
### Up-to-Date Base Images
123131

124-
The **No outdated base images** policy requires that the base images you use are
125-
up-to-date.
132+
The **Up-to-Date Base Images** policy type checks whether the base images you
133+
use are up-to-date.
126134

127-
It's violated when the tag you used to build your image points to a
128-
different digest than what you're using. If there's a mismatch in digests, that
129-
means the base image you're using is out of date.
135+
Images are considered non-compliant with this policy if the tag you used to
136+
build your image points to a different digest than what you're using. If
137+
there's a mismatch in digests, that means the base image you're using is out of
138+
date.
130139

131140
Your images need provenance attestations for this policy to successfully
132141
evaluate. For more information, see [No base image data](#no-base-image-data).
133142

134-
### No high-profile vulnerabilities
143+
### High-Profile Vulnerabilities
135144

136-
The **No high-profile vulnerabilities** policy requires that your artifacts don't
145+
The **High-Profile Vulnerabilities** policy type checks whether your images
137146
contain vulnerabilities from Docker Scout’s curated list. This list is kept
138147
up-to-date with newly disclosed vulnerabilities that are widely recognized to
139148
be risky.
@@ -150,8 +159,8 @@ The list includes the following vulnerabilities:
150159
- [CVE-2024-47175 (OpenPrinting - `libppd`)](https://scout.docker.com/v/CVE-2024-47175)
151160
- [CVE-2024-47177 (OpenPrinting - `cups-filters`)](https://scout.docker.com/v/CVE-2024-47177)
152161

153-
You can configure the CVEs included in this list by creating a custom policy.
154-
Custom configuration options include:
162+
You can customize this policy to change which CVEs that are considered
163+
high-profile by configuring the policy. Custom configuration options include:
155164

156165
- **Excluded CVEs**: Specify the CVEs that you want this policy to ignore.
157166

@@ -167,14 +176,14 @@ Custom configuration options include:
167176

168177
For more information on policy configuration, see [Configure policies](./configure.md).
169178

170-
### Supply chain attestations
179+
### Supply Chain Attestations
171180

172-
The **Supply chain attestations** policy requires that your artifacts have
181+
The **Supply Chain Attestations** policy type checks whether your images have
173182
[SBOM](/manuals/build/metadata/attestations/sbom.md) and
174183
[provenance](/manuals/build/metadata/attestations/slsa-provenance.md) attestations.
175184

176-
This policy is violated if an artifact lacks either an SBOM attestation or a
177-
provenance attestation with max mode. To ensure compliance,
185+
Images are considered non-compliant if they lack either an SBOM attestation or
186+
a provenance attestation with *max mode* provenance. To ensure compliance,
178187
update your build command to attach these attestations at build-time:
179188

180189
```console
@@ -188,18 +197,18 @@ If you're using GitHub Actions to build and push your images,
188197
learn how you can [configure the action](/manuals/build/ci/github-actions/attestations.md)
189198
to apply SBOM and provenance attestations.
190199

191-
### Default non-root user
200+
### Default Non-Root User
192201

193202
By default, containers run as the `root` superuser with full system
194203
administration privileges inside the container, unless the Dockerfile specifies
195204
a different default user. Running containers as a privileged user weakens their
196205
runtime security, as it means any code that runs in the container can perform
197206
administrative actions.
198207

199-
The **Default non-root user** policy detects images that are set to run as the
200-
default `root` user. To comply with this policy, images must specify a non-root
201-
user in the image configuration. Images violate this policy if they don't
202-
specify a non-root default user for the runtime stage.
208+
The **Default Non-Root User** policy type detects images that are set to run as
209+
the default `root` user. To comply with this policy, images must specify a
210+
non-root user in the image configuration. Images are non-compliant with this
211+
policy if they don't specify a non-root default user for the runtime stage.
203212

204213
For non-compliant images, evaluation results show whether or not the `root`
205214
user was set explicitly for the image. This helps you distinguish between
@@ -265,9 +274,9 @@ ENTRYPOINT ["/app/production"]
265274
{{< /tab >}}
266275
{{< /tabs >}}
267276

268-
### No unapproved base images
277+
### Approved Base Images
269278

270-
The **No unapproved base images** policy ensures that the base images you use
279+
The **Approved Base Images** policy type ensures that the base images you use
271280
in your builds are maintained and secure.
272281

273282
This policy checks whether the base images used in your builds match any of the
@@ -322,18 +331,9 @@ This policy is configurable with the following options:
322331
Your images need provenance attestations for this policy to successfully
323332
evaluate. For more information, see [No base image data](#no-base-image-data).
324333

325-
## Additional policies
326-
327-
In addition to the [out-of-the-box policies](#out-of-the-box-policies) enabled
328-
by default, Docker Scout supports the following optional policies. Before you
329-
can enable these policies, you need to either configure the policies, or
330-
configure the integration that the policy requires.
331-
332-
- [SonarQube quality gates passed](#sonarqube-quality-gates-passed)
333-
334-
### SonarQube quality gates passed
334+
### SonarQube Quality Gates
335335

336-
The **SonarQube quality gates passed** policy builds on the [SonarQube
336+
The **SonarQube Quality Gates** policy type builds on the [SonarQube
337337
integration](../integrations/code-quality/sonarqube.md) to assess the quality
338338
of your source code. This policy works by ingesting the SonarQube code analysis
339339
results into Docker Scout.
@@ -366,8 +366,8 @@ in the CLI.
366366
## No base image data
367367

368368
There are cases when it's not possible to determine information about the base
369-
images used in your builds. In such cases, the **No outdated base images** and
370-
**No unapproved base images** policies get flagged as having **No data**.
369+
images used in your builds. In such cases, the **Up-to-Date Base Images** and
370+
**Approved Base Images** policies get flagged as having **No data**.
371371

372372
This "no data" state occurs when:
373373

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,46 @@
11
---
22
title: Configure policies
3-
description: Learn how to configure or disable the default policies in Docker Scout
4-
keywords: scout, policy, configure, disable, enable, parametrize, thresholds
3+
description: Learn how to configure, disable, or delete policies in Docker Scout
4+
keywords: scout, policy, configure, delete, enable, parametrize, thresholds
55
---
66

7-
Some of the existing policies are configurable. This means that you can clone
8-
an existing policy and create new, custom policies with your own configuration.
9-
You can also disable a policy altogether, if a policy doesn't quite match your
10-
needs.
7+
Some policy types are configurable. This means that you can create new,
8+
customized version of that policy type with your own configuration parameters.
9+
You can also disable a policy if you need to temporarily disregard it, or
10+
delete a policy altogether if it doesn't match your needs.
1111

12-
## Configure a policy
12+
> [!NOTE]
13+
> Historic evaluation results for the default policy configuration are removed
14+
> if you delete or customize a policy.
1315
14-
To change the configuration of a policy, you must clone one of the existing
15-
default policies, and then save your configuration as a new policy. You can
16-
edit the display name and description of the new policy to help distinguish
17-
it from the default policy it's based on.
16+
## Add a policy
1817

19-
The available configuration parameters for a policy depends on the default
20-
policy you used as a base for your custom policy.
18+
To add a new policy, select the policy type that you want to customize. All
19+
custom policies use a policy type as a base.
2120

22-
To configure a policy:
21+
You can edit the display name and description of the new policy to help
22+
better communicate the compliant and non-compliant states of the policy.
23+
You can not change the name of the policy type, only its display names.
24+
25+
The available configuration parameters for a policy depends on the
26+
policy type that you're editing. For more information, refer to
27+
[Policy types](/manuals/scout/policy/_index.md#policy-types).
28+
29+
To add a policy:
2330

2431
1. Go to the [Policies page](https://scout.docker.com/reports/policy) in the Docker Scout Dashboard.
25-
2. Select the policy you want to configure.
26-
3. Select **View policy details** to open the policy side panel.
32+
2. Select the **Add policy** button to open the policy configuration screen.
33+
3. On the policy configuration screen, locate the policy type that you want to
34+
configure, and select **Configure** to open the policy configuration panel.
2735

28-
If this button is grayed out, then the selected policy doesn't have any
29-
configuration parameters.
36+
- If the **Configure** button is grayed out, it means the selected policy
37+
has no configurable parameters.
38+
- If the button reads **Integrate**, it indicates that setup is required
39+
before the policy can be enabled. Selecting **Integrate** will direct you
40+
to the integration's setup guide.
3041

31-
4. In the side panel, select **Copy to customize** to open the policy configuration page.
32-
5. Update the policy parameters.
33-
6. Save the changes:
42+
4. Update the policy parameters.
43+
5. Save the changes:
3444

3545
- Select **Save and enable** to commit the changes and enable the policy for
3646
your current organization.
@@ -50,3 +60,21 @@ To disable a policy:
5060
1. Go to the [Policies page](https://scout.docker.com/reports/policy) in the Docker Scout Dashboard.
5161
2. Select the policy you want to disable.
5262
3. Select the **Disable** button.
63+
64+
## Delete a policy
65+
66+
When you delete a policy, evaluation results for that policy are deleted as
67+
well, and no longer appear in the Docker Scout Dashboard or in the CLI.
68+
69+
To delete a policy:
70+
71+
1. Go to the [Policies page](https://scout.docker.com/reports/policy) in the Docker Scout Dashboard.
72+
2. Select the policy you want to delete.
73+
3. Select **View policy details**.
74+
4. Select the **Delete** button.
75+
76+
## Recover a deleted policy
77+
78+
If you've deleted a policy, you can recreate it by following the steps in [Add
79+
a policy](#add-a-policy). On the policy configuration screen, select
80+
**Configure** on the deleted policy that you wish to recreate.

0 commit comments

Comments
 (0)