Skip to content

Commit 842ebdc

Browse files
docs: move info about detection priority into coverage section (aquasecurity#9469)
Co-authored-by: knqyf263 <[email protected]>
1 parent 6d562a3 commit 842ebdc

File tree

2 files changed

+45
-35
lines changed

2 files changed

+45
-35
lines changed

docs/docs/scanner/vulnerability.md

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -148,28 +148,17 @@ If you have software that is not managed by a package manager, Trivy can still d
148148
- [Rust Binaries with embedded information](../coverage/language/rust.md#binaries)
149149
- [SBOM embedded in container images](../supply-chain/sbom.md#sbom-detection-inside-targets)
150150

151-
## Kubernetes
152-
153-
Trivy can detect vulnerabilities in Kubernetes clusters and components by scanning a Kubernetes Cluster, or a KBOM (Kubernetes bill of Material). To learn more, see the [documentation for Kubernetes scanning](../target/kubernetes.md).
154-
155-
### Data Sources
156-
157-
| Vendor | Source |
158-
|------------|---------------------------------------------|
159-
| Kubernetes | [Kubernetes Official CVE feed][k8s-cve][^1] |
160-
161-
[^1]: Some manual triage and correction has been made.
162-
163-
## Databases
164-
The information from the above sources is collected and stored in databases that Trivy uses for vulnerability scanning. Trivy automatically fetches, maintains, and caches the relevant databases when performing a vulnerability scan
165-
For more information about Trivy's Databases mechanism and configurations, refer to the [Databases document](../configuration/db.md).
166-
167151
## Detection Behavior
168152
Trivy prioritizes precision in vulnerability detection, aiming to minimize false positives while potentially accepting some false negatives.
169153
This approach is particularly relevant in two key areas:
170154

171-
- Handling Software Installed via OS Packages
172-
- Handling Packages with Unspecified Versions
155+
- [Handling Software Installed via OS Packages](#handling-software-installed-via-os-packages)
156+
- [Handling Packages with Unspecified Versions](#handling-packages-with-unspecified-versions)
157+
158+
Trivy can also detect only specific packages:
159+
160+
- [Subset of Package Types](#enabling-a-subset-of-package-types)
161+
- [Specific package Relationship](#filtering-by-package-relationships)
173162

174163
### Handling Software Installed via OS Packages
175164
For files installed by OS package managers, such as `apt`, Trivy exclusively uses advisories from the OS vendor.
@@ -212,9 +201,29 @@ To detect potential vulnerabilities even with unspecified versions, use [--detec
212201
This option makes Trivy use the minimum version in the specified range for vulnerability detection.
213202
While this may increase false positives if the actual version used is not the minimum, it helps reduce false negatives.
214203

215-
## Configuration
216-
This section describes vulnerability-specific configuration.
217-
Other common options are documented [here](../configuration/index.md).
204+
## Package Detection
205+
Vulnerability detection is based on package detection.
206+
This section describes the specifics of package detection, which also affect SBOM generation.
207+
208+
### Detection Priority
209+
210+
Trivy provides a `--detection-priority` flag to control the balance between false positives and false negatives in package/vulnerability detection.
211+
This concept is similar to the relationship between [precision and recall][precision-recall] in machine learning evaluation.
212+
213+
```bash
214+
$ trivy image --detection-priority {precise|comprehensive} alpine:3.15
215+
```
216+
217+
- `precise`: This mode prioritizes reducing false positives. It results in less noisy vulnerability reports but may miss some potential vulnerabilities.
218+
- `comprehensive`: This mode aims to detect more vulnerabilities, potentially including some that might be false positives.
219+
It provides broader coverage but may increase the noise in the results.
220+
221+
The default value is `precise`. Also refer to the [detection behavior](#detection-behavior) section for more information.
222+
223+
Regardless of the chosen mode, user review of detected vulnerabilities is crucial:
224+
225+
- `precise`: Review thoroughly, considering potential missed vulnerabilities.
226+
- `comprehensive`: Carefully investigate each reported vulnerability due to increased false positive possibility.
218227

219228
### Enabling a Subset of Package Types
220229

@@ -288,7 +297,6 @@ Total: 7 (UNKNOWN: 0, LOW: 1, MEDIUM: 1, HIGH: 3, CRITICAL: 2)
288297
289298
### Filtering by Package Relationships
290299
291-
292300
Trivy supports filtering vulnerabilities based on the relationship of packages within a project.
293301
This is achieved through the `--pkg-relationships` flag.
294302
This feature allows you to focus on vulnerabilities in specific types of dependencies, such as only those in direct dependencies.
@@ -322,25 +330,25 @@ By default, all relationships are included in the scan.
322330
!!! warning
323331
As it may not provide a complete package list, `--pkg-relationships` cannot be used with `--dependency-tree`, `--vex` or SBOM generation.
324332
325-
### Detection Priority
333+
## Kubernetes
326334
327-
Trivy provides a `--detection-priority` flag to control the balance between false positives and false negatives in vulnerability detection.
328-
This concept is similar to the relationship between [precision and recall][precision-recall] in machine learning evaluation.
335+
Trivy can detect vulnerabilities in Kubernetes clusters and components by scanning a Kubernetes Cluster, or a KBOM (Kubernetes bill of Material). To learn more, see the [documentation for Kubernetes scanning](../target/kubernetes.md).
329336
330-
```bash
331-
$ trivy image --detection-priority {precise|comprehensive} alpine:3.15
332-
```
337+
### Data Sources
333338
334-
- `precise`: This mode prioritizes reducing false positives. It results in less noisy vulnerability reports but may miss some potential vulnerabilities.
335-
- `comprehensive`: This mode aims to detect more vulnerabilities, potentially including some that might be false positives.
336-
It provides broader coverage but may increase the noise in the results.
339+
| Vendor | Source |
340+
|------------|---------------------------------------------|
341+
| Kubernetes | [Kubernetes Official CVE feed][k8s-cve][^1] |
337342
338-
The default value is `precise`. Also refer to the [detection behavior](#detection-behavior) section for more information.
343+
[^1]: Some manual triage and correction has been made.
339344
340-
Regardless of the chosen mode, user review of detected vulnerabilities is crucial:
345+
## Databases
346+
The information from the above sources is collected and stored in databases that Trivy uses for vulnerability scanning. Trivy automatically fetches, maintains, and caches the relevant databases when performing a vulnerability scan
347+
For more information about Trivy's Databases mechanism and configurations, refer to the [Databases document](../configuration/db.md).
341348
342-
- `precise`: Review thoroughly, considering potential missed vulnerabilities.
343-
- `comprehensive`: Carefully investigate each reported vulnerability due to increased false positive possibility.
349+
## Configuration
350+
This section describes vulnerability-specific configuration.
351+
Other common options are documented [here](../configuration/index.md).
344352
345353
### Overriding OS version
346354
By default, Trivy automatically detects the OS during container image scanning and performs vulnerability detection based on that OS.

docs/docs/supply-chain/sbom.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ Trivy supports the following packages.
185185
- [OS packages][os_packages]
186186
- [Language-specific packages][language_packages]
187187

188+
Trivy has a specific logic for package detection.
189+
See the [package detection](../scanner/vulnerability.md#package-detection) section for more information.
188190

189191
### Formats
190192
#### CycloneDX

0 commit comments

Comments
 (0)