Skip to content

Commit 20573af

Browse files
admin: add org access tokens
Signed-off-by: Craig Osterhout <[email protected]>
1 parent 2502083 commit 20573af

File tree

4 files changed

+123
-2
lines changed

4 files changed

+123
-2
lines changed

content/manuals/admin/organization/activity-logs.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ Refer to the following section for a list of events and their descriptions:
6666
| Single Sign-On domain added | Details of the single sign-on domain added to your organization |
6767
| Single Sign-On domain removed | Details of the single sign-on domain removed from your organization |
6868
| Single Sign-On domain verified | Details of the single sign-on domain verified for your organization |
69+
| Access token created | Access token created in organization |
70+
| Access token updated | Access token updated in organization |
71+
| Access token deleted | Access token deleted in organization |
6972

7073
### Repository events
7174

content/manuals/docker-hub/release-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ Each organization page now breaks down into these tabs:
254254

255255
### New features
256256

257-
* You can now [create personal access tokens](access-tokens.md) in Docker Hub and use them to authenticate from the Docker CLI. Find them in your account settings, under the new **[Security](https://hub.docker.com/settings/security)** section.
257+
* You can now [create personal access tokens](/security/for-developers/access-tokens/) in Docker Hub and use them to authenticate from the Docker CLI. Find them in your account settings, under the new **[Security](https://hub.docker.com/settings/security)** section.
258258

259259
### Known Issues
260260

content/manuals/docker-hub/service-accounts.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ weight: 50
1111
>
1212
> Service accounts require a
1313
> [Docker Team, or Business subscription](../subscription/_index.md).
14+
>
15+
> Docker recommends that you use organization access tokens instead of service
16+
> accounts. For more details, see [Organization access
17+
> tokens](/security/for-admins/access-tokens/).
1418
1519
A service account is a Docker ID used for automated management of container images or containerized applications. Service accounts are typically used in automated workflows, and don't share Docker IDs with the members in the organization. Common use cases for service accounts include mirroring content on Docker Hub, or tying in image pulls from your CI/CD process.
1620

@@ -49,7 +53,7 @@ To create a new service account for your Team account:
4953
2. Create a [team](manage-a-team.md) in your organization and grant it read-only access to your private repositories.
5054
3. Add the new Docker ID to your [organization](orgs.md).
5155
4. Add the new Docker ID to the [team](manage-a-team.md) you created earlier.
52-
5. Create a new [personal access token (PAT)](access-tokens.md) from the user account and use it for CI.
56+
5. Create a new [personal access token (PAT)](/security/for-developers/access-tokens/) from the user account and use it for CI.
5357

5458
> [!NOTE]
5559
>
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
title: Organization access tokens
3+
description: Learn how to create and manage organization access tokens
4+
to securely push and pull images programmatically.
5+
keywords: docker hub, security, OAT, organization access token
6+
---
7+
8+
> [!NOTE]
9+
>
10+
> Organization access tokens require a
11+
> [Docker Team, or Business subscription](/subscription/core-subscription/details/).
12+
13+
An organization access token (OAT) is like a [personal access token
14+
(PAT)](/security/for-developers/access-tokens/), but an OAT is associated with
15+
an organization and not a single user account. Use an OAT instead of a PAT to
16+
let business-critical tasks access Docker Hub repositories without connecting
17+
the token to single user.
18+
19+
OATs provide the following advantages:
20+
21+
- You can investigate when the OAT was last used and then disable or delete it
22+
if you find any suspicious activity.
23+
- You can limit what each OAT has access to, which limits the impact if an OAT
24+
is compromised.
25+
- All organization owners can manage OATs. If one owner leaves the organization,
26+
the remaining owners can still manage the OATs.
27+
- OATs have their own Docker Hub usage limits that don't count towards your
28+
personal account's limits.
29+
30+
If you have existing [service accounts](/docker-hub/service-accounts/), Docker recommends that you replace the service accounts with OATs. OATs offer the following advantages over service accounts:
31+
32+
- Access permissions are easier to manage with OATs. You can assign access
33+
permissions to OATs, while service accounts require using teams for access
34+
permissions.
35+
- OATs are easier to manage. OATs are centrally managed in the Admin Console.
36+
For service accounts, you may need to sign in to that service account to
37+
manage it. If using single sign-on enforcement and the service account is not
38+
in your IdP, you may not be able to sign in to the service account to manage
39+
it.
40+
- OATs are not associated with a single user. If a user with access to the
41+
service account leaves your organization, you may lose access to the service
42+
account. OATs can be managed by any organization owner.
43+
44+
## Create an organization access token
45+
46+
> [!IMPORTANT]
47+
>
48+
> Treat access tokens like a password and keep them secret. Store your tokens securely in a credential manager for example.
49+
50+
Organization owners can create up to 3 organization access tokens (OATs) for
51+
organizations with a Team subscription and up to 100 OATs for organizations with
52+
a Business subscription. Expired tokens count towards the total amount of
53+
tokens.
54+
55+
To create an OAT:
56+
57+
1. Sign in to the [Admin Console](https://app.docker.com/admin).
58+
59+
2. Select the organization you want to create an access token for.
60+
61+
3. Under **Security and access**, select **Access tokens**.
62+
63+
4. Select **Generate access token**.
64+
65+
5. Add a label and optional description for your token. Use something that indicates the use case or purpose of the token.
66+
67+
6. Select the expiration date for the token.
68+
69+
7. Select the repository access for the token.
70+
71+
The access permissions are scopes that set restrictions in your repositories.
72+
For example, for Read & Write permissions, an automation pipeline can build
73+
an image and then push it to a repository. However, it can't delete the
74+
repository. You can select one of the following options:
75+
76+
- **Public repositories (read only)**
77+
- **All repositories**: You can select read access, or read and write access.
78+
- **Select repositories**: You can select up to 50 repositories, and then
79+
select read access, or read and write access for each repository.
80+
81+
8. Select **Generate token** and then copy the token that appears on the screen
82+
and save it. You won't be able to retrieve the token once you exit the
83+
screen.
84+
85+
## Use an organization access token
86+
87+
You can use an organization access token when you sign in using Docker CLI.
88+
89+
Sign in from your Docker CLI client with the following command, replacing
90+
`YOUR_ORG` with your organization name:
91+
92+
```console
93+
$ docker login --username <YOUR_ORG>
94+
```
95+
96+
When prompted for a password, enter your organization access token instead of a
97+
password.
98+
99+
## Modify existing tokens
100+
101+
You can rename, update the description, update the repository access,
102+
deactivate, or delete a token as needed.
103+
104+
1. Sign in to the [Admin Console](https://app.docker.com/admin).
105+
106+
2. Select the organization you want to modify an access token for.
107+
108+
3. Under **Security and access**, select **Access tokens**.
109+
110+
4. Select the actions menu on the far right of a token row, then select
111+
**Deactivate**, **Edit**, or **Delete** to modify the token. For **Inactive**
112+
tokens, you can only select **Delete**.
113+
114+
5. If editing a token, select **Save** after specifying your modifications.

0 commit comments

Comments
 (0)