Repository navigation
ci: authenticate Docker Hub with OIDC (SEC-4519) - #253
Merged
Merged
Conversation
Replace static Docker credentials with the configured OIDC connection while preserving workflow triggers and publishing behavior. Linear: https://linear.app/sourcegraph/issue/SEC-4519/configure-oidc-in-github-actions-that-log-in-to-docker Amp-Thread-ID: https://ampcode.com/threads/T-01a2180e-b11b-76a6-b0cd-520034d574a0 Co-authored-by: Amp <amp@ampcode.com>
Preserve default credentials for public Docker Hub base-image pulls. SEC-4519 Amp-Thread-ID: https://ampcode.com/threads/T-01a2180e-b11b-76a6-b0cd-520034d574a0 Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Part of SEC-4519: Configure OIDC in GitHub Actions that log in to Docker. Replace reusable Docker credentials, which can be abused if leaked, with short-lived OIDC authentication.
Changes
sourcegraphand connection7937e496-9edf-4170-9bc8-9ff38a3954fe, with no password input.sourcegraph/scip-python, preserving default authentication for the publicnikolaik/python-nodejsbase image. This prevents the restricted OIDC token from being used for unrelated Docker Hub pulls, as observed in scip-clang's first OIDC run. No dependencies changed: the latest publishing run used Buildx v0.38.0 (scope requires >=0.31.0).docker/login-actionpinned to8aa5831fb8d48d8f76594c7ddde61ae58019f550(v4.8.0).contents: read/id-token: writepermissions. npm trusted publishing is unchanged.OIDC refs and required Docker rule
Expected rule for Image Push to only
sourcegraph/scip-python:The connection ID is non-secret configuration. Its deployed rules have not been inspected; confirm the rule and resource scope before merging. All five migrated repositories still report legacy default subjects.
Test plan
actionlintv1.7.12 passed on this workflow (external shellcheck/pyflakes integrations disabled; scripts are unchanged).git diff --checkpassed.Investigation and ruleset rationale · GitHub Docker OIDC guide