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

Inconsistent behavior of --scanners aliases across CLI flags, environment variables, and config files #5803

Closed
knqyf263 opened this issue Dec 18, 2023 · 0 comments · Fixed by #5843
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@knqyf263
Copy link
Collaborator

Description

We recently added an alias for the --scanners option in #5558. While the alias works as expected when used with a CLI flag, it does not function properly when set through environment variables or configuration files.

CLI flag

Using the CLI flag --scanners, the alias works correctly:

$ trivy fs --scanners config .
2023-12-18T21:08:49.136+0400 WARN '--scanner config' is deprecated. Use '--scanner misconfig' instead. See https://github.com/aquasecurity/trivy/discussions/5586 for the detail.
2023-12-18T21:08:49.145+0400 INFO Misconfiguration scanning is enabled

Environment Variable

However, when setting the scanners through an environment variable, the aliases are not recognized:

$ TRIVY_SCANNERS=config trivy fs .
2023-12-18T21:09:06.379+0400 INFO To collect the license information of packages in "pkg/fanal/analyzer/language/nodejs/npm/testdata/no-node_modules/package-lock.json", "npm install" needs to be performed beforehand
It is crucial for the alias to be consistently recognized across all methods of setting it (CLI flags, environment variables, and configuration files) for a seamless user experience. Any assistance in resolving this inconsistency would be greatly appreciated.
@knqyf263 knqyf263 added the kind/bug Categorizes issue or PR as related to a bug. label Dec 18, 2023
@knqyf263 knqyf263 added this to the v0.49.0 milestone Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
Archived in project
1 participant