Skip to content

Commit 6559ae5

Browse files
committed
Address all Copilot review feedback
- Use Liquid variables instead of hardcoded product names - Add third-party actions disclaimer reusable to workflow example - Use action-checkout reusable for actions/checkout - Add note about immutable subject claim format (post July 15 2026) - Remove duplicate external links per style guide - Pin version comments to major version only (v1, v4, v6)
1 parent 1791b9b commit 6559ae5

1 file changed

Lines changed: 9 additions & 14 deletions

File tree

  • content/actions/how-tos/secure-your-work/security-harden-deployments

content/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-docker.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ For more information, see [OIDC connections](https://docs.docker.com/enterprise/
3030

3131
* You must have a Docker Business or Docker Team subscription.
3232
* You must be an organization owner or editor in your Docker organization.
33-
* You should plan which repositories, branches, and workflows need access to Docker Hub, and configure rulesets accordingly. For more information, see [Rulesets and subject claims](https://docs.docker.com/enterprise/security/oidc-connections/rulesets-claims/) in the Docker documentation.
33+
* You should plan which repositories, branches, and workflows need access to Docker Hub, and configure rulesets accordingly.
3434

3535
## Adding the identity provider to Docker Hub
3636

@@ -39,7 +39,7 @@ To use OIDC with Docker, establish a trust relationship between {% data variable
3939
1. Sign in to [Docker Home](https://app.docker.com/) and navigate to your organization.
4040
1. Go to **Identity & auth** > **OIDC connections**.
4141
1. Select **Create OIDC connection**.
42-
1. Configure at least one ruleset to define which GitHub repositories, branches, or workflows can authenticate. Each ruleset specifies:
42+
1. Configure at least one ruleset to define which {% data variables.product.prodname_dotcom %} repositories, branches, or workflows can authenticate. Each ruleset specifies:
4343
* **Rules**: Conditions matched against OIDC token claims (repository, branch, workflow path). Wildcard patterns like `repo:my-org/*` are supported.
4444
* **Resources**: Docker Hub repositories or Docker Build Cloud projects the workflow can access.
4545
* **Scopes**: Permission levels (`read`, `write`).
@@ -52,12 +52,7 @@ Once you have created an OIDC connection in Docker Hub, update your workflow to
5252
The following example uses the placeholder `YOUR_CONNECTION_ID` for the connection ID you copied from Docker Hub, and `YOUR_DOCKER_ORG` for your Docker organization name.
5353

5454
```yaml
55-
name: Build and push with OIDC
56-
57-
on:
58-
push:
59-
branches: [main]
60-
55+
{% data reusables.actions.actions-not-certified-by-github-comment %}
6156
permissions:
6257
id-token: write
6358
contents: read
@@ -67,16 +62,16 @@ jobs:
6762
runs-on: ubuntu-latest
6863
steps:
6964
- name: Check out repository
70-
uses: actions/checkout@v4
65+
uses: {% data reusables.actions.action-checkout %}
7166

7267
- name: Get Docker OIDC token
7368
id: docker-oidc
74-
uses: docker/oidc-action@3f002d200df5620744c973221788e401898c6f86 # v1.0.0
69+
uses: docker/oidc-action@3f002d200df5620744c973221788e401898c6f86 # v1
7570
with:
7671
connection_id: YOUR_CONNECTION_ID
7772

7873
- name: Sign in to Docker Hub
79-
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
74+
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4
8075
with:
8176
username: YOUR_DOCKER_ORG
8277
password: {% raw %}${{ steps.docker-oidc.outputs.token }}{% endraw %}
@@ -102,6 +97,9 @@ Docker evaluates the `sub` claim from the {% data variables.product.prodname_dot
10297
repo:<owner>/<repo>:ref:refs/heads/<branch>
10398
```
10499

100+
> [!NOTE]
101+
> Repositories created or renamed after July 15, 2026 use immutable owner and repository identifiers in the subject claim, for example: `repo:octocat@123456/my-repo@456789:ref:refs/heads/main`. For more information, see [AUTOTITLE](/actions/concepts/security/openid-connect).
102+
105103
Different workflow triggers produce different subject claims. For example:
106104

107105
| Trigger | Subject claim format |
@@ -117,7 +115,4 @@ For more information, see [Rulesets and subject claims](https://docs.docker.com/
117115

118116
## Further reading
119117

120-
* [OIDC connections overview](https://docs.docker.com/enterprise/security/oidc-connections/) in the Docker documentation
121-
* [Create and manage OIDC connections](https://docs.docker.com/enterprise/security/oidc-connections/create-manage/) in the Docker documentation
122-
* [Rulesets and subject claims](https://docs.docker.com/enterprise/security/oidc-connections/rulesets-claims/) in the Docker documentation
123118
* [AUTOTITLE](/actions/concepts/security/openid-connect)

0 commit comments

Comments
 (0)