Skip to content

Commit 3562529

Browse files
authored
feat: support multiple DB repositories for vulnerability and Java DB (#7605)
Signed-off-by: nikpivkin <[email protected]>
1 parent 7602d14 commit 3562529

File tree

28 files changed

+301
-203
lines changed

28 files changed

+301
-203
lines changed

docs/docs/references/configuration/cli/trivy_filesystem.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ trivy filesystem [flags] PATH
2929
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
3030
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
3131
--custom-headers strings custom headers in client mode
32-
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
32+
--db-repository strings OCI repository(ies) to retrieve trivy-db in order of priority (default [ghcr.io/aquasecurity/trivy-db:2])
3333
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
3434
--detection-priority string specify the detection priority:
3535
- "precise": Prioritizes precise by minimizing false positives.
@@ -56,7 +56,7 @@ trivy filesystem [flags] PATH
5656
--include-deprecated-checks include deprecated checks (default true)
5757
--include-dev-deps include development dependencies in the report (supported: npm, yarn)
5858
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
59-
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
59+
--java-db-repository strings OCI repository(ies) to retrieve trivy-java-db in order of priority (default [ghcr.io/aquasecurity/trivy-java-db:1])
6060
--license-confidence-level float specify license classifier's confidence level (default 0.9)
6161
--license-full eagerly look for licenses in source code headers and license files
6262
--list-all-pkgs output all packages in the JSON report regardless of vulnerability

docs/docs/references/configuration/cli/trivy_image.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ trivy image [flags] IMAGE_NAME
4343
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
4444
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
4545
--custom-headers strings custom headers in client mode
46-
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
46+
--db-repository strings OCI repository(ies) to retrieve trivy-db in order of priority (default [ghcr.io/aquasecurity/trivy-db:2])
4747
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
4848
--detection-priority string specify the detection priority:
4949
- "precise": Prioritizes precise by minimizing false positives.
@@ -74,7 +74,7 @@ trivy image [flags] IMAGE_NAME
7474
--include-deprecated-checks include deprecated checks (default true)
7575
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
7676
--input string input file path instead of image name
77-
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
77+
--java-db-repository strings OCI repository(ies) to retrieve trivy-java-db in order of priority (default [ghcr.io/aquasecurity/trivy-java-db:1])
7878
--license-confidence-level float specify license classifier's confidence level (default 0.9)
7979
--license-full eagerly look for licenses in source code headers and license files
8080
--list-all-pkgs output all packages in the JSON report regardless of vulnerability

docs/docs/references/configuration/cli/trivy_kubernetes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ trivy kubernetes [flags] [CONTEXT]
3838
--config-check strings specify the paths to the Rego check files or to the directories containing them, applying config files
3939
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
4040
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
41-
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
41+
--db-repository strings OCI repository(ies) to retrieve trivy-db in order of priority (default [ghcr.io/aquasecurity/trivy-db:2])
4242
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
4343
--detection-priority string specify the detection priority:
4444
- "precise": Prioritizes precise by minimizing false positives.
@@ -70,7 +70,7 @@ trivy kubernetes [flags] [CONTEXT]
7070
--include-kinds strings indicate the kinds included in scanning (example: node)
7171
--include-namespaces strings indicate the namespaces included in scanning (example: kube-system)
7272
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
73-
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
73+
--java-db-repository strings OCI repository(ies) to retrieve trivy-java-db in order of priority (default [ghcr.io/aquasecurity/trivy-java-db:1])
7474
--k8s-version string specify k8s version to validate outdated api by it (example: 1.21.0)
7575
--kubeconfig string specify the kubeconfig file path to use
7676
--list-all-pkgs output all packages in the JSON report regardless of vulnerability

docs/docs/references/configuration/cli/trivy_repository.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ trivy repository [flags] (REPO_PATH | REPO_URL)
2929
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
3030
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
3131
--custom-headers strings custom headers in client mode
32-
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
32+
--db-repository strings OCI repository(ies) to retrieve trivy-db in order of priority (default [ghcr.io/aquasecurity/trivy-db:2])
3333
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
3434
--detection-priority string specify the detection priority:
3535
- "precise": Prioritizes precise by minimizing false positives.
@@ -56,7 +56,7 @@ trivy repository [flags] (REPO_PATH | REPO_URL)
5656
--include-deprecated-checks include deprecated checks (default true)
5757
--include-dev-deps include development dependencies in the report (supported: npm, yarn)
5858
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
59-
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
59+
--java-db-repository strings OCI repository(ies) to retrieve trivy-java-db in order of priority (default [ghcr.io/aquasecurity/trivy-java-db:1])
6060
--license-confidence-level float specify license classifier's confidence level (default 0.9)
6161
--license-full eagerly look for licenses in source code headers and license files
6262
--list-all-pkgs output all packages in the JSON report regardless of vulnerability

docs/docs/references/configuration/cli/trivy_rootfs.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ trivy rootfs [flags] ROOTDIR
3131
--config-data strings specify paths from which data for the Rego checks will be recursively loaded
3232
--config-file-schemas strings specify paths to JSON configuration file schemas to determine that a file matches some configuration and pass the schema to Rego checks for type checking
3333
--custom-headers strings custom headers in client mode
34-
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
34+
--db-repository strings OCI repository(ies) to retrieve trivy-db in order of priority (default [ghcr.io/aquasecurity/trivy-db:2])
3535
--dependency-tree [EXPERIMENTAL] show dependency origin tree of vulnerable packages
3636
--detection-priority string specify the detection priority:
3737
- "precise": Prioritizes precise by minimizing false positives.
@@ -58,7 +58,7 @@ trivy rootfs [flags] ROOTDIR
5858
--ignorefile string specify .trivyignore file (default ".trivyignore")
5959
--include-deprecated-checks include deprecated checks (default true)
6060
--include-non-failures include successes and exceptions, available with '--scanners misconfig'
61-
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
61+
--java-db-repository strings OCI repository(ies) to retrieve trivy-java-db in order of priority (default [ghcr.io/aquasecurity/trivy-java-db:1])
6262
--license-confidence-level float specify license classifier's confidence level (default 0.9)
6363
--license-full eagerly look for licenses in source code headers and license files
6464
--list-all-pkgs output all packages in the JSON report regardless of vulnerability

docs/docs/references/configuration/cli/trivy_sbom.md

+48-48
Original file line numberDiff line numberDiff line change
@@ -20,54 +20,54 @@ trivy sbom [flags] SBOM_PATH
2020
### Options
2121

2222
```
23-
--cache-backend string [EXPERIMENTAL] cache backend (e.g. redis://localhost:6379) (default "memory")
24-
--cache-ttl duration cache TTL when using redis as cache backend
25-
--compliance string compliance report to generate
26-
--custom-headers strings custom headers in client mode
27-
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
28-
--detection-priority string specify the detection priority:
29-
- "precise": Prioritizes precise by minimizing false positives.
30-
- "comprehensive": Aims to detect more security findings at the cost of potential false positives.
31-
(precise,comprehensive) (default "precise")
32-
--download-db-only download/update vulnerability database but don't run a scan
33-
--download-java-db-only download/update Java index database but don't run a scan
34-
--exit-code int specify exit code when any security issues are found
35-
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
36-
--file-patterns strings specify config file patterns
37-
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
38-
-h, --help help for sbom
39-
--ignore-policy string specify the Rego file path to evaluate each vulnerability
40-
--ignore-status strings comma-separated list of vulnerability status to ignore (unknown,not_affected,affected,fixed,under_investigation,will_not_fix,fix_deferred,end_of_life)
41-
--ignore-unfixed display only fixed vulnerabilities
42-
--ignored-licenses strings specify a list of license to ignore
43-
--ignorefile string specify .trivyignore file (default ".trivyignore")
44-
--java-db-repository string OCI repository to retrieve trivy-java-db from (default "ghcr.io/aquasecurity/trivy-java-db:1")
45-
--list-all-pkgs output all packages in the JSON report regardless of vulnerability
46-
--no-progress suppress progress bar
47-
--offline-scan do not issue API requests to identify dependencies
48-
-o, --output string output file name
49-
--output-plugin-arg string [EXPERIMENTAL] output plugin arguments
50-
--pkg-relationships strings list of package relationships (unknown,root,direct,indirect) (default [unknown,root,direct,indirect])
51-
--pkg-types strings list of package types (os,library) (default [os,library])
52-
--redis-ca string redis ca file location, if using redis as cache backend
53-
--redis-cert string redis certificate file location, if using redis as cache backend
54-
--redis-key string redis key file location, if using redis as cache backend
55-
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
56-
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
57-
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
58-
--scanners strings comma-separated list of what security issues to detect (vuln,license) (default [vuln])
59-
--server string server address in client mode
60-
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
61-
--show-suppressed [EXPERIMENTAL] show suppressed vulnerabilities
62-
--skip-db-update skip updating vulnerability database
63-
--skip-dirs strings specify the directories or glob patterns to skip
64-
--skip-files strings specify the files or glob patterns to skip
65-
--skip-java-db-update skip updating Java index database
66-
--skip-vex-repo-update [EXPERIMENTAL] Skip VEX Repository update
67-
-t, --template string output template
68-
--token string for authentication in client/server mode
69-
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
70-
--vex strings [EXPERIMENTAL] VEX sources ("repo", "oci" or file path)
23+
--cache-backend string [EXPERIMENTAL] cache backend (e.g. redis://localhost:6379) (default "memory")
24+
--cache-ttl duration cache TTL when using redis as cache backend
25+
--compliance string compliance report to generate
26+
--custom-headers strings custom headers in client mode
27+
--db-repository strings OCI repository(ies) to retrieve trivy-db in order of priority (default [ghcr.io/aquasecurity/trivy-db:2])
28+
--detection-priority string specify the detection priority:
29+
- "precise": Prioritizes precise by minimizing false positives.
30+
- "comprehensive": Aims to detect more security findings at the cost of potential false positives.
31+
(precise,comprehensive) (default "precise")
32+
--download-db-only download/update vulnerability database but don't run a scan
33+
--download-java-db-only download/update Java index database but don't run a scan
34+
--exit-code int specify exit code when any security issues are found
35+
--exit-on-eol int exit with the specified code when the OS reaches end of service/life
36+
--file-patterns strings specify config file patterns
37+
-f, --format string format (table,json,template,sarif,cyclonedx,spdx,spdx-json,github,cosign-vuln) (default "table")
38+
-h, --help help for sbom
39+
--ignore-policy string specify the Rego file path to evaluate each vulnerability
40+
--ignore-status strings comma-separated list of vulnerability status to ignore (unknown,not_affected,affected,fixed,under_investigation,will_not_fix,fix_deferred,end_of_life)
41+
--ignore-unfixed display only fixed vulnerabilities
42+
--ignored-licenses strings specify a list of license to ignore
43+
--ignorefile string specify .trivyignore file (default ".trivyignore")
44+
--java-db-repository strings OCI repository(ies) to retrieve trivy-java-db in order of priority (default [ghcr.io/aquasecurity/trivy-java-db:1])
45+
--list-all-pkgs output all packages in the JSON report regardless of vulnerability
46+
--no-progress suppress progress bar
47+
--offline-scan do not issue API requests to identify dependencies
48+
-o, --output string output file name
49+
--output-plugin-arg string [EXPERIMENTAL] output plugin arguments
50+
--pkg-relationships strings list of package relationships (unknown,root,direct,indirect) (default [unknown,root,direct,indirect])
51+
--pkg-types strings list of package types (os,library) (default [os,library])
52+
--redis-ca string redis ca file location, if using redis as cache backend
53+
--redis-cert string redis certificate file location, if using redis as cache backend
54+
--redis-key string redis key file location, if using redis as cache backend
55+
--redis-tls enable redis TLS with public certificates, if using redis as cache backend
56+
--rekor-url string [EXPERIMENTAL] address of rekor STL server (default "https://rekor.sigstore.dev")
57+
--sbom-sources strings [EXPERIMENTAL] try to retrieve SBOM from the specified sources (oci,rekor)
58+
--scanners strings comma-separated list of what security issues to detect (vuln,license) (default [vuln])
59+
--server string server address in client mode
60+
-s, --severity strings severities of security issues to be displayed (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL) (default [UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL])
61+
--show-suppressed [EXPERIMENTAL] show suppressed vulnerabilities
62+
--skip-db-update skip updating vulnerability database
63+
--skip-dirs strings specify the directories or glob patterns to skip
64+
--skip-files strings specify the files or glob patterns to skip
65+
--skip-java-db-update skip updating Java index database
66+
--skip-vex-repo-update [EXPERIMENTAL] Skip VEX Repository update
67+
-t, --template string output template
68+
--token string for authentication in client/server mode
69+
--token-header string specify a header name for token in client/server mode (default "Trivy-Token")
70+
--vex strings [EXPERIMENTAL] VEX sources ("repo", "oci" or file path)
7171
```
7272

7373
### Options inherited from parent commands

docs/docs/references/configuration/cli/trivy_server.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ trivy server [flags]
2222
```
2323
--cache-backend string [EXPERIMENTAL] cache backend (e.g. redis://localhost:6379) (default "fs")
2424
--cache-ttl duration cache TTL when using redis as cache backend
25-
--db-repository string OCI repository to retrieve trivy-db from (default "ghcr.io/aquasecurity/trivy-db:2")
25+
--db-repository strings OCI repository(ies) to retrieve trivy-db in order of priority (default [ghcr.io/aquasecurity/trivy-db:2])
2626
--download-db-only download/update vulnerability database but don't run a scan
2727
--enable-modules strings [EXPERIMENTAL] module names to enable
2828
-h, --help help for server

0 commit comments

Comments
 (0)