Skip to content

[29.x backport] gha/build: Use OIDC for Docker Hub login - #7132

Open
vvoland wants to merge 2 commits into
docker:29.xfrom
vvoland:7131-29.x
Open

[29.x backport] gha/build: Use OIDC for Docker Hub login#7132
vvoland wants to merge 2 commits into
docker:29.xfrom
vvoland:7131-29.x

Conversation

@vvoland

@vvoland vvoland commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

vvoland added 2 commits July 28, 2026 17:19
OIDC login requires docker/login-action v4.5.0 or newer

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 5ff2ff6)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland added this to the 29.6.3 milestone Jul 28, 2026
@vvoland vvoland self-assigned this Jul 28, 2026
@vvoland vvoland modified the milestone: 29.6.3 Jul 28, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

This PR correctly migrates Docker Hub authentication from username/password secrets to OIDC using docker/login-action v4.5.0. The id-token: write permission is granted at job level, which is the only way GitHub Actions supports OIDC — an accepted and unavoidable pattern.

One security note posted inline: verify that the hardcoded username: dockereng matches the Docker Hub account that has the OIDC connection registered.

Dismissed security findings (review manually)

  • .github/workflows/build.yml:103 — id-token: write permission at job level exposes OIDC token to all steps (verifier mitigation: this is the only mechanism GitHub Actions provides for OIDC; all steps are from the docker/ org; accepted trade-off)

with:
username: ${{ secrets.DOCKERHUB_CLIBIN_USERNAME }}
password: ${{ secrets.DOCKERHUB_CLIBIN_TOKEN }}
username: dockereng

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[medium] Hardcoded username: dockereng may mismatch the OIDC-linked Docker Hub account

The login step now uses hardcoded username: dockereng instead of the former ${{ secrets.DOCKERHUB_CLIBIN_USERNAME }}. In Docker Hub's OIDC federation, the username field must match the account that has the OIDC connection configured. If DOCKERHUB_CLIBIN_USERNAME previously referred to a service account other than dockereng, the OIDC token exchange will fail because the username used to look up the OIDC connection will be wrong.

If dockereng is the correct Docker Hub org/account that owns the OIDC connection (likely, given that Docker CLI bin images are published under dockereng), this is fine — but it is worth double-checking that the OIDC connection in Docker Hub is registered against the dockereng account, not against the previous service account that DOCKERHUB_CLIBIN_USERNAME pointed to.

Confidence Score
🟠 weak 52/100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants