docs/guide/configuration/index.md
Trivy's settings can be configured in any of the following methods, which will apply in the following precedence:
You can view the list of available flags by adding the --help flag to a Trivy command, or by exploring the CLI reference.
Any CLI option can be set as an environment variable. The environment variable names are similar to the CLI option names, with the following augmentations:
TRIVY_ prefix- with _For example:
--debug => TRIVY_DEBUG--cache-dir => TRIVY_CACHE_DIR$ TRIVY_DEBUG=true TRIVY_SEVERITY=CRITICAL trivy image alpine:3.15
Any setting can be set in a YAML file. By default, config file named trivy.yaml is read from the current directory where Trivy is run. To load configuration from a different file, use the --config flag and specify the config path to load: trivy --config /etc/trivy/myconfig.yaml.
The structure and settings of the YAML config file is documented in the Config file document.