Repository navigation
dockerfile: check PSW variables for secrets - #7286
Merged
Merged
Conversation
thaJeztah
reviewed
Oct 15, 2026
| "password", | ||
| "pword", | ||
| "passwd", | ||
| "psw", |
Member
There was a problem hiding this comment.
should this only be detected with a _ prefix? So that something like DIPSWITCH doesn't get flagged?
Contributor
Author
There was a problem hiding this comment.
The existing regex already requires _ or a string boundary on both sides of the token ((?:_|^) and (?:_|$)), so DIPSWITCH does not match. I verified this for both ARG and ENV.
Contributor
Author
There was a problem hiding this comment.
Added DIPSWITCH cases for both ARG and ENV in 35ed6ea. The regression test passes, confirming neither triggers a warning.
Member
There was a problem hiding this comment.
Oh! Thx; missed that it already has the underscore handling 🙈👍
Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
hezhizhen
force-pushed
the
codex/dockerfile-check-psw
branch
from
October 16, 2026 14:41
35ed6ea to
04c80e3
Compare
tonistiigi
requested changes
Oct 21, 2026
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func TestSecretsUsedInArgOrEnvPSW(t *testing.T) { |
Member
There was a problem hiding this comment.
There is already testSecretsUsedInArgOrEnv test for this.
Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
tonistiigi
approved these changes
Oct 21, 2026
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.
Recognize
pswas a sensitive name token so Jenkins-style_PSWvariables triggerSecretsUsedInArgOrEnvfor both ARG and ENV.Fixes #6064.
The regression covers case-insensitive matching, token boundaries, and allowlisted names. It fails without the change and passes with it. Related frontend package tests and golangci-lint v2.14.0 pass.
Docker-based validation could not run because the Docker daemon is unavailable.
AI disclosure: OpenAI Codex prepared the code change, regression test, and PR description.