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.
The current check for secrets in the env commands of a Dockerfile can incorrectly flag trivially named variables used in certain image builds such as
ENV CC="/usr/bin/clang"
as potentially containing a secret.This is due to the
contains()
function performing a substring comparison. The string "ACCESS_KEY" which is a member of thesecrets_env
arraycontains
the string "CC" which causes Dockerfiles using this env variable to be flagged.This PR improves the suspicious env check by running different checks of the env values and performing some basic parsing of the keys and values to look for anything suspicious while avoiding use of the
contains()
functionSigned-off-by: Thomas Spear [email protected]