Skip to content

Commit 28adbe7

Browse files
authored
docs(dhi): update OAT authentication support for dhi.io and mirror.md (#24357)
<!--Delete sections as needed --> ## Description Documents OAT (Organization Access Token) support for authenticating to the dhi.io registry, which was previously undocumented. Adds guidance for CI/CD workflows where org-scoped tokens are preferred over personal credentials. <!-- Tell us what you did and why --> ## Related issues or tickets <!-- Related issues, pull requests, or Jira tickets --> ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [ ] Editorial review - [ ] Product review
1 parent 8c5bfcc commit 28adbe7

2 files changed

Lines changed: 69 additions & 11 deletions

File tree

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

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ repository.
154154

155155
> [!NOTE]
156156
>
157-
> If you only want to stop mirroring ELS versions, you can uncheck the ELS
157+
> If you only want to stop mirroring ELS versions, you can clear the ELS
158158
> option in the mirrored repository's **Settings** tab. For more details, see
159159
> [Disable ELS for a repository](./els.md#disable-els-for-a-repository).
160160
@@ -189,6 +189,56 @@ OCI-aware CLI that supports mirroring images along with attached artifacts such
189189
as SBOMs, vulnerability reports, and SLSA provenance. For ongoing synchronization,
190190
you can use [`regsync`](https://regclient.org/cli/regsync/).
191191

192+
### Authenticate to `dhi.io` with an organization access token
193+
194+
You can authenticate to `dhi.io` using an [organization access token
195+
(OAT)](../../enterprise/security/access-tokens.md) instead of a personal access
196+
token (PAT). OATs are owned by the organization rather than an individual user,
197+
which makes them better suited for CI/CD pipelines and automated workflows.
198+
199+
> [!NOTE]
200+
>
201+
> When using an OAT, use your organization name as the username, not your
202+
> personal Docker ID. OATs are org-scoped and will return a `401 Unauthorized`
203+
> error if presented under an individual user's username.
204+
205+
To authenticate using an OAT:
206+
207+
1. Sign in to [Docker Home](https://app.docker.com) and select your organization.
208+
2. Select **Admin Console**, then **Access tokens**.
209+
3. Select **Generate access token**.
210+
4. Give the token a descriptive name, for example `dhi-pull-automation`.
211+
5. Expand the **Repository** drop-down and select **Read public repositories**.
212+
6. Select **Generate token**, then copy and save the token. You won't be able
213+
to retrieve it after closing the screen.
214+
7. Sign in to `dhi.io` using your organization name as the username and the OAT
215+
as the password:
216+
217+
```console
218+
$ oras login dhi.io -u <YOUR_ORGANIZATION_NAME>
219+
```
220+
221+
Or non-interactively in a CI/CD pipeline:
222+
223+
```console
224+
$ echo $OAT | oras login dhi.io -u "$DOCKER_ORG" --password-stdin
225+
```
226+
227+
8. Verify access by discovering attestations on a DHI image:
228+
229+
```console
230+
$ oras discover dhi.io/node:24-dev --platform linux/amd64
231+
```
232+
233+
> [!NOTE]
234+
>
235+
> The `--platform` flag is required. Without it, `oras discover` resolves to
236+
> the multi-arch image index, which returns only an index-level signature
237+
> rather than the full set of per-platform attestations.
238+
239+
A successful response lists the attestations attached to the image,
240+
including SBOMs, provenance, vulnerability reports, and changelog metadata.
241+
192242
### Example mirroring with `regctl`
193243

194244
The following example shows how to mirror a specific tag of a Docker Hardened
@@ -198,7 +248,7 @@ attestations using `regctl`. You must [install
198248

199249
The example assumes you have mirrored the DHI repository to your organization's
200250
namespace on Docker Hub as described in the previous section. You can apply the
201-
same steps to a non-mirrored image by updating the the `SRC_ATT_REPO` and
251+
same steps to a non-mirrored image by updating the `SRC_ATT_REPO` and
202252
`SRC_REPO` variables accordingly.
203253

204254
1. Set environment variables for your specific environment. Replace the
@@ -207,10 +257,12 @@ same steps to a non-mirrored image by updating the the `SRC_ATT_REPO` and
207257
In this example, you use a Docker username to represent a member of the Docker
208258
Hub organization that the DHI repositories are mirrored in. Prepare a
209259
[personal access token (PAT)](../../security/access-tokens.md) for the user
210-
with `read only` access. Alternatively, you can use an organization namespace and
260+
with `read only` access. Alternatively, you can use your organization name and
211261
an [organization access token
212-
(OAT)](../../enterprise/security/access-tokens.md) to sign in to Docker Hub, but OATs
213-
are not yet supported for `registry.scout.docker.com`.
262+
(OAT)](../../enterprise/security/access-tokens.md) to authenticate with `docker.io`.
263+
Note that OATs are not supported for `registry.scout.docker.com`. If your
264+
workflow requires authenticating to the Scout registry, use a personal access
265+
token (PAT) for that step.
214266

215267
```console
216268
$ export DOCKER_USERNAME="YOUR_DOCKER_USERNAME"

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,32 @@ reference them in your Dockerfile, and run containers with `docker run`.
1212

1313
The key difference is that DHIs are security-focused and intentionally minimal
1414
to reduce the attack surface. This means some variants don't include a shell or
15-
package manager, and may run as a nonroot user by default.
15+
package manager, and may run as a non-root user by default.
1616

1717
> [!IMPORTANT]
1818
>
1919
> You must authenticate to the Docker Hardened Images registry (`dhi.io`) to
20-
> pull images. Use your Docker ID credentials (the same username and password
21-
> you use for Docker Hub) when signing in. If you don't have a Docker account,
22-
> [create one](../../accounts/create-account.md) for free.
20+
> pull images. You can authenticate using either of the following:
21+
>
22+
> - **Docker ID (personal credentials):** Use the same username and password
23+
> you use for Docker Hub. If you don't have a Docker account,
24+
> [create one](../../accounts/create-account.md) for free.
25+
> - **Organization access token (OAT):** Use your organization name as the
26+
> username and an OAT as the password. OATs are recommended for CI/CD
27+
> pipelines and automated workflows. See
28+
> [Organization access tokens](../../enterprise/security/access-tokens.md).
2329
>
2430
> Run `docker login dhi.io` to authenticate.
2531
2632
## Considerations when adopting DHIs
2733

28-
Docker Hardened Images are intentionally minimal to improve security. If you're updating existing Dockerfiles or frameworks to use DHIs, keep the following considerations in mind:
34+
Docker Hardened Images are intentionally minimal to improve security. If you're updating existing Dockerfiles or frameworks to use DHIs, keep the considerations in mind:
2935

3036
| Feature | Details |
3137
|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
3238
| No shell or package manager | Runtime images don’t include a shell or package manager. Use `-dev` or `-sdk` variants in build stages to run shell commands or install packages, and then copy artifacts to a minimal runtime image. |
3339
| Non-root runtime | Runtime DHIs default to running as a non-root user. Ensure your application doesn't require privileged access and that all needed files are readable and executable by a non-root user. |
34-
| Ports | Applications running as non-root users can't bind to ports below 1024 in older versions of Docker or in some Kubernetes configurations. Use ports above 1024 for compatibility. |
40+
| Ports | Applications running as non-root users can't bind to ports lower than 1024 in older versions of Docker or in some Kubernetes configurations. Use ports higher than 1024 for compatibility. |
3541
| Entry point | DHIs may not include a default entrypoint or might use a different one than the original image you're familiar with. Check the image configuration and update your `CMD` or `ENTRYPOINT` directives accordingly. |
3642
| Multi-stage builds | Always use multi-stage builds for frameworks: a `-dev` image for building or installing dependencies, and a minimal runtime image for the final stage. |
3743
| TLS certificates | DHIs include standard TLS certificates. You do not need to manually install CA certs. |

0 commit comments

Comments
 (0)