You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trivy can download images from a private registry without the need for installing Docker or any other 3rd party tools.
2
2
This makes it easy to run within a CI process.
3
3
4
-
## Credential
5
-
To use Trivy with private images, simply install it and provide your credentials:
4
+
## Login
5
+
You can log in to a private registry using the `trivy auth login` command.
6
+
It uses the Docker configuration file (`~/.docker/config.json`) to store the credentials under the hood, and the configuration file path can be configured by `DOCKER_CONFIG` environment variable.
When passing credentials via environment variables or CLI flags, Trivy will attempt to use these credentials for all registries encountered during scanning, regardless of the target registry.
22
+
This can potentially lead to unintended credential exposure.
23
+
To mitigate this risk:
24
+
25
+
1. Set credentials cautiously and only when necessary.
26
+
2. Prefer using `trivy auth config` to pre-configure credentials with specific registries, which ensures credentials are only sent to appropriate registries.
27
+
11
28
Trivy also supports providing credentials through CLI flags:
0 commit comments