Skip to content

Commit 40915c3

Browse files
committed
scout: support OATs
Signed-off-by: David Karlsson <[email protected]>
1 parent 27094d5 commit 40915c3

File tree

6 files changed

+34
-24
lines changed

6 files changed

+34
-24
lines changed

content/manuals/scout/explore/metrics-exporter.md

+21-16
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,18 @@ The metrics endpoint exposes the following metrics:
3636

3737
## Creating an access token
3838

39-
To export metrics from your organization, first make sure your organization is enrolled in Docker Scout.
40-
Then, create a Personal Access Token (PAT) - a secret token that allows the exporter to authenticate with the Docker Scout API.
39+
To export metrics from your organization, first make sure your organization is
40+
enrolled in Docker Scout. Then, create either an organization access token or a
41+
personal access token. These tokens are used to authenticate to Docker Scout.
4142

42-
The PAT does not require any specific permissions, but it must be created by a user who is an owner of the Docker organization.
43-
To create a PAT, follow the steps in [Create an access token](/security/for-developers/access-tokens/#create-an-access-token).
43+
The access token does not require any specific permissions, but if you choose
44+
to use a personal access token, it must be created by a user who is an owner of
45+
the Docker organization.
4446

45-
Once you have created the PAT, store it in a secure location.
47+
For instructions on how to create an access token, follow the steps in [Create
48+
an access token](/security/for-developers/access-tokens/#create-an-access-token).
49+
50+
Once you have created the access token, store it in a secure location.
4651
You will need to provide this token to the exporter when scraping metrics.
4752

4853
## Prometheus
@@ -70,11 +75,11 @@ Make sure that there's no firewall rule in place preventing the server from comm
7075

7176
### Add bearer token authentication
7277

73-
To scrape metrics from the Docker Scout Exporter endpoint using Prometheus, you need to configure Prometheus to use the PAT as a bearer token.
74-
The exporter requires the PAT to be passed in the `Authorization` header of the request.
78+
To scrape metrics from the Docker Scout Exporter endpoint using Prometheus, you need to configure Prometheus to use the Docker access token as a bearer token.
79+
The exporter requires the access token to be passed in the `Authorization` header of the request.
7580

7681
Update the Prometheus configuration file to include the `authorization` configuration block.
77-
This block defines the PAT as a bearer token stored in a file:
82+
This block defines the access token as a bearer token stored in a file:
7883

7984
```yaml
8085
scrape_configs:
@@ -84,10 +89,10 @@ scrape_configs:
8489
credentials_file: /etc/prometheus/token
8590
```
8691

87-
The content of the file should be the PAT in plain text:
92+
The content of the file should be the access token in plain text:
8893

8994
```console
90-
dckr_pat_...
95+
dckr_oat_...
9196
```
9297

9398
If you are running Prometheus in a Docker container or Kubernetes pod, mount the file into the container using a volume or secret.
@@ -112,7 +117,7 @@ alongside Grafana with a pre-configured dashboard to visualize the vulnerability
112117
and store it in a plain text file at `/prometheus/prometheus/token` under the template directory.
113118

114119
```plaintext {title=token}
115-
$ echo $DOCKER_PAT > ./prometheus/token
120+
$ echo $DOCKER_TOKEN > ./prometheus/token
116121
```
117122

118123
3. In the Prometheus configuration file at `/prometheus/prometheus/prometheus.yml`,
@@ -245,7 +250,7 @@ and a Datadog site.
245250
and store it in a plain text file at `/datadog/token` under the template directory.
246251

247252
```plaintext {title=token}
248-
$ echo $DOCKER_PAT > ./token
253+
$ echo $DOCKER_TOKEN > ./token
249254
```
250255

251256
3. In the `/datadog/compose.yaml` file, update the `DD_API_KEY` and `DD_SITE` environment variables
@@ -346,8 +351,8 @@ To change the scrape interval:
346351

347352
## Revoke an access token
348353

349-
If you suspect that your PAT has been compromised or is no longer needed, you can revoke it at any time.
350-
To revoke a PAT, follow the steps in the [Create and manage access tokens](/security/for-developers/access-tokens/#modify-existing-tokens).
354+
If you suspect that your access token has been compromised or is no longer needed, you can revoke it at any time.
355+
To revoke an access token, follow the steps in the [Create and manage access tokens](/security/for-developers/access-tokens/#modify-existing-tokens).
351356

352-
Revoking a PAT immediately invalidates the token, and prevents Prometheus from scraping metrics using that token.
353-
You will need to create a new PAT and update the Prometheus configuration to use the new token.
357+
Revoking an access token immediately invalidates the token, and prevents Prometheus from scraping metrics using that token.
358+
You will need to create a new access token and update the Prometheus configuration to use the new token.

content/manuals/scout/how-tos/configure-cli.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ CLI commands, and the corresponding `docker/scout-cli` container image:
1818
| DOCKER_SCOUT_OFFLINE | Boolean | Use [offline mode](#offline-mode) when indexing SBOM |
1919
| DOCKER_SCOUT_REGISTRY_TOKEN | String | Token for authenticating to a registry when pulling images |
2020
| DOCKER_SCOUT_REGISTRY_USER | String | Username for authenticating to a registry when pulling images |
21-
| DOCKER_SCOUT_REGISTRY_PASSWORD | String | Password or personal access token for authenticating to a registry when pulling images |
21+
| DOCKER_SCOUT_REGISTRY_PASSWORD | String | Password or access token for authenticating to a registry when pulling images |
2222
| DOCKER_SCOUT_HUB_USER | String | Docker Hub username for authenticating to the Docker Scout backend |
23-
| DOCKER_SCOUT_HUB_PASSWORD | String | Docker Hub password or personal access token for authenticating to the Docker Scout backend |
23+
| DOCKER_SCOUT_HUB_PASSWORD | String | Docker Hub password or access token for authenticating to the Docker Scout backend |
2424
| DOCKER_SCOUT_NEW_VERSION_WARN | Boolean | Warn about new versions of the Docker Scout CLI |
2525
| DOCKER_SCOUT_EXPERIMENTAL_WARN | Boolean | Warn about experimental features |
2626
| DOCKER_SCOUT_EXPERIMENTAL_POLICY_OUTPUT | Boolean | Disable experimental output for policy evaluation |

content/manuals/scout/install.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ Use the `docker/scout-cli` to run `docker scout` commands without installing the
115115

116116
```console
117117
$ docker run -it \
118-
-e DOCKER_SCOUT_HUB_USER=<your Docker Hub user name> \
119-
-e DOCKER_SCOUT_HUB_PASSWORD=<your Docker Hub PAT> \
118+
-e DOCKER_SCOUT_HUB_USER=<your-docker-username> \
119+
-e DOCKER_SCOUT_HUB_PASSWORD=<your-docker-token> \
120120
docker/scout-cli <command>
121121
```
122122

content/manuals/scout/integrations/environment/cli.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ refer to the [CLI reference](/reference/cli/docker/scout/environment.md).
2020
Before you start, set the following environment variables in your CI system:
2121

2222
- `DOCKER_SCOUT_HUB_USER`: your Docker Hub username
23-
- `DOCKER_SCOUT_HUB_PASSWORD`: your Docker Hub personal access token
23+
- `DOCKER_SCOUT_HUB_PASSWORD`: your Docker Hub access token
2424

2525
Make sure the variables are accessible to your project.
2626

content/manuals/scout/integrations/registry/artifactory.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,19 @@ The configuration file includes the following properties:
9090
| --------------------------- | ------------------------------------------------------------------------------- |
9191
| `agent_id` | Unique identifier for the agent. |
9292
| `docker.organization_name` | Name of the Docker organization. |
93-
| `docker.username` | Username of the admin user in the Docker organization. |
94-
| `docker.pat` | Personal access token of the admin user with read and write permissions. |
93+
| `docker.username` | Docker organization, or the username of a Docker organization owner. |
94+
| `docker.pat` | Docker access token. [^1] |
9595
| `artifactory.base_url` | Base URL of the Artifactory instance. |
9696
| `artifactory.username` | Username of the Artifactory user with read permissions that the agent will use. |
9797
| `artifactory.password` | Password or API token for the Artifactory user. |
9898
| `artifactory.image_filters` | Optional: List of repositories and images to analyze. |
9999

100+
[^1]:
101+
If you specify a Docker organization as `docker.username`, you must use an
102+
organization access token for `docker.pat`. If `docker.username` refers to
103+
the username of an organization owner, `docker.pat` must be a personal
104+
access token created for that user.
105+
100106
If you don't specify any repositories in `artifactory.image_filters`, the agent
101107
runs image analysis on all images in your Artifactory instance.
102108

content/manuals/security/for-admins/access-tokens.md

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ The organization access tokens feature is currently in [Beta](../../release-life
1515
> Organization access tokens aren't currently compatible with the following services:
1616
>
1717
> - Docker Build Cloud
18-
> - Docker Scout
1918
> - Docker REST APIs
2019
>
2120
> If you use these services, you must use personal access tokens instead.

0 commit comments

Comments
 (0)