fix(dockerfile): resolve build ARG default value in CKV_DOCKER_7 base… - #7671
Open
ArquimedesMonteiro wants to merge 1 commit into
Open
fix(dockerfile): resolve build ARG default value in CKV_DOCKER_7 base…#7671ArquimedesMonteiro wants to merge 1 commit into
ArquimedesMonteiro wants to merge 1 commit into
Conversation
ArquimedesMonteiro
requested a deployment
to
scan-security
September 4, 2026 23:37 — with
GitHub Actions
Waiting
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.
Description
Fixes a false positive in
CKV_DOCKER_7when theFROMinstruction references a buildARGwhose default value already pins a specific tag, e.g.:Previously this was reported as a violation, because the check only saw the literal string
${BASE_IMAGE}and never resolved it against theARGdeclaration.Fixes #7667
New/Edited policies (Delete if not relevant)
Description
CKV_DOCKER_7("Ensure the base image uses a non latest version tag") was registered withsupported_instructions = ("FROM",), so it never had access to the file'sARGinstructions and could not resolve variable references used inFROM.Fix
Changed the check to a wildcard check (
supported_instructions = ("*",), following the same pattern already used byHealthcheckExists/UserExists), so it now receives the full per-file instruction dictionary. It builds a map ofARGnames to default values and resolvesFROM ${VAR}/FROM $VARagainst that map before evaluating the tag. No user action is required to benefit from the fix.Checklist: