Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation to turn off false positive SecretsUsedInArgOrEnv #3059

Open
jonapich opened this issue Mar 11, 2025 · 5 comments
Open

Annotation to turn off false positive SecretsUsedInArgOrEnv #3059

jonapich opened this issue Mar 11, 2025 · 5 comments
Labels
area/checks kind/enhancement New feature or request

Comments

@jonapich
Copy link
Contributor

Description

I am getting a SecretsUsedInArgOrEnv warning on non-sensitive data.

The variables are named instance_types_file_key and static_variables_file_key. Since this is a refactor I can't rename them just like that and will have to live with the warning.

It would be great if there was a way to annotate the line to acknowledge the false positive. For instance, some linters let you use # noqa at the minimum to disable these warnings, while some others are more specific e.g. # noqa: ignore[index-error]

@crazy-max
Copy link
Member

It would be great if there was a way to annotate the line to acknowledge the false positive. For instance, some linters let you use # noqa at the minimum to disable these warnings, while some others are more specific e.g. # noqa: ignore[index-error]

@colinhemmings Recall we discussed about it internally with smth like a nolint directive similar to https://golangci-lint.run/usage/false-positives/#nolint-directive

@tonistiigi
Copy link
Member

You can set #check=skip=SecretsUsedInArgOrEnv on top of Dockerfile

@ggjulio
Copy link

ggjulio commented Mar 17, 2025

Or like shellcheck behavior.

A comment on top of a file disable the rule globally, whereas above a line of code it only ignores the LoC.

@jonapich
Copy link
Contributor Author

Right now it's just noise because we don't enforce clean checks, but eventually, CI should fail when these come up. Being able to ignore a specific check at the line level is important to retain the ability of flagging new contributions (vs ignoring the whole file, which would silence the warning on the new contribution).

@KK-Repos
Copy link

Is there a way to suppress the warning for a specific ENV or ARG variable if it's a false positive? If not, is there any existing solution or a feature planned to address this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/checks kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants