mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 23:26:39 -08:00
chore(cli): disable java-db flags in server mode (#5263)
* disable java-db flag for server mode * update docs
This commit is contained in:
@@ -64,6 +64,9 @@ Downloading the Java index DB from an external OCI registry can be done by using
|
|||||||
$ trivy image --java-db-repository registry.gitlab.com/gitlab-org/security-products/dependencies/trivy-java-db --download-java-db-only
|
$ trivy image --java-db-repository registry.gitlab.com/gitlab-org/security-products/dependencies/trivy-java-db --download-java-db-only
|
||||||
```
|
```
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
In [Client/Server](../references/modes/client-server.md) mode, `Java index DB` is currently only used on the `client` side.
|
||||||
|
|
||||||
## Remove DBs
|
## Remove DBs
|
||||||
The `--reset` flag removes all caches and databases.
|
The `--reset` flag removes all caches and databases.
|
||||||
|
|
||||||
|
|||||||
@@ -20,30 +20,27 @@ trivy server [flags]
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
```
|
```
|
||||||
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
--cache-backend string cache backend (e.g. redis://localhost:6379) (default "fs")
|
||||||
--cache-ttl duration cache TTL when using redis as cache backend
|
--cache-ttl duration cache TTL when using redis as cache backend
|
||||||
--clear-cache clear image caches without scanning
|
--clear-cache clear image caches without scanning
|
||||||
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db")
|
||||||
--download-db-only download/update vulnerability database but don't run a scan
|
--download-db-only download/update vulnerability database but don't run a scan
|
||||||
--download-java-db-only download/update Java index database but don't run a scan
|
--enable-modules strings [EXPERIMENTAL] module names to enable
|
||||||
--enable-modules strings [EXPERIMENTAL] module names to enable
|
-h, --help help for server
|
||||||
-h, --help help for server
|
--listen string listen address in server mode (default "localhost:4954")
|
||||||
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db")
|
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
||||||
--listen string listen address in server mode (default "localhost:4954")
|
--no-progress suppress progress bar
|
||||||
--module-dir string specify directory to the wasm modules that will be loaded (default "$HOME/.trivy/modules")
|
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
||||||
--no-progress suppress progress bar
|
--redis-ca string redis ca file location, if using redis as cache backend
|
||||||
--password strings password. Comma-separated passwords allowed. TRIVY_PASSWORD should be used for security reasons.
|
--redis-cert string redis certificate file location, if using redis as cache backend
|
||||||
--redis-ca string redis ca file location, if using redis as cache backend
|
--redis-key string redis key file location, if using redis as cache backend
|
||||||
--redis-cert string redis certificate file location, if using redis as cache backend
|
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
|
||||||
--redis-key string redis key file location, if using redis as cache backend
|
--registry-token string registry token
|
||||||
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
|
--reset remove all caches and database
|
||||||
--registry-token string registry token
|
--skip-db-update skip updating vulnerability database
|
||||||
--reset remove all caches and database
|
--token string for authentication in client/server mode
|
||||||
--skip-db-update skip updating vulnerability database
|
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
||||||
--skip-java-db-update skip updating Java index database
|
--username strings username. Comma-separated usernames allowed.
|
||||||
--token string for authentication in client/server mode
|
|
||||||
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
|
|
||||||
--username strings username. Comma-separated usernames allowed.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Options inherited from parent commands
|
### Options inherited from parent commands
|
||||||
|
|||||||
@@ -582,6 +582,11 @@ func NewServerCommand(globalFlags *flag.GlobalFlagGroup) *cobra.Command {
|
|||||||
RegistryFlagGroup: flag.NewRegistryFlagGroup(),
|
RegistryFlagGroup: flag.NewRegistryFlagGroup(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// java-db only works on client side.
|
||||||
|
serverFlags.DBFlagGroup.DownloadJavaDBOnly = nil // disable '--download-java-db-only'
|
||||||
|
serverFlags.DBFlagGroup.SkipJavaDBUpdate = nil // disable '--skip-java-db-update'
|
||||||
|
serverFlags.DBFlagGroup.JavaDBRepository = nil // disable '--java-db-repository'
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "server [flags]",
|
Use: "server [flags]",
|
||||||
Aliases: []string{"s"},
|
Aliases: []string{"s"},
|
||||||
|
|||||||
Reference in New Issue
Block a user