Skip to content

Commit 5c03fa8

Browse files
do not set false_p
1 parent 909b7c6 commit 5c03fa8

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

docs/content/en/connecting_your_tools/parsers/file/trivy.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ JSON report of [trivy scanner](https://github.com/aquasecurity/trivy).
66

77
The [status](https://trivy.dev/latest/docs/configuration/filtering/) field in Trivy is mapped to the Defect Dojo status flags in the following way:
88

9-
| Trivy Status | Active | Verified | Mitigated | False Positive | Remarks |
10-
|----------------------|--------|----------|-----------|---------------|-----------------------------------------------------------------------------------------------------------------|
11-
| unknown | True | False | False | | use default value for active which is usually True |
12-
| not_affected | False | True | True | True | false positive is the most appropriate status for not affected as out of scope might be interpreted as something else |
13-
| affected | True | True | False | | standard case |
14-
| fixed | True | True | False | | fixed in this context means that there is a fix available by patching/updating/upgrading the package but it's still active and verified |
15-
| under_investigation | True | False | False | | no status flag in Defect Dojo to capture this, but verified is False |
16-
| will_not_fix | True | True | False | | no different from affected as Defect Dojo doesn't have a flag to capture will_not_fix by OS/Package Vendor; we can't set active to False as the user needs to risk accept this finding |
17-
| fix_deferred | True | True | False | | no different from affected as Defect Dojo doesn't have a flag to capture will_not_fix by OS/Package Vendor; we can't set active to False as the user needs to (temporarily) risk accept this finding |
18-
| end_of_life | True | True | False | | no different from affected as Defect Dojo doesn't have a flag to capture will_not_fix by OS/Package Vendor; we can't set active to False as the user needs to (temporarily) risk accept
9+
| Trivy Status | Active | Verified | Mitigated | Remarks |
10+
|----------------------|--------|----------|-----------|-----------------------------------------------------------------------------------------------------------------|
11+
| unknown | True | False | False | use default value for active which is usually True |
12+
| not_affected | False | True | True | false positive is the most appropriate status for not affected as out of scope might be interpreted as something else |
13+
| affected | True | True | False | standard case |
14+
| fixed | True | True | False | fixed in this context means that there is a fix available by patching/updating/upgrading the package but it's still active and verified |
15+
| under_investigation | True | False | False | no status flag in Defect Dojo to capture this, but verified is False |
16+
| will_not_fix | True | True | False | no different from affected as Defect Dojo doesn't have a flag to capture will_not_fix by OS/Package Vendor; we can't set active to False as the user needs to risk accept this finding |
17+
| fix_deferred | True | True | False | no different from affected as Defect Dojo doesn't have a flag to capture will_not_fix by OS/Package Vendor; we can't set active to False as the user needs to (temporarily) risk accept this finding |
18+
| end_of_life | True | True | False | no different from affected as Defect Dojo doesn't have a flag to capture will_not_fix by OS/Package Vendor; we can't set active to False as the user needs to (temporarily) risk accept
1919

2020
The status field contains the status as assigned by the OS/Package vendor such as Red Hat, Debian, etc.
21-
It is recommended to assess the appropriate action in your Product's context
21+
It is recommended to assess the appropriate action in your Product's context.
2222
If you want to exclude certain status from being imported into Defect Dojo, please [filter them in the export from Trivy](https://trivy.dev/latest/docs/configuration/filtering/)
2323

2424
### Sample Scan Data
25-
Sample Trivy scans can be found [here](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans/trivy).
25+
Sample Trivy scans can be found [here](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans/trivy)

dojo/tools/trivy/parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ def convert_trivy_status(self, trivy_status: str) -> dict:
104104
# false positive is the most appropriate status for not affected as out of scope might be interpreted as something else
105105
"active": False,
106106
"verified": True,
107-
"false_p": True,
108107
"is_mitigated": True,
109108
},
110109
"affected": {

unittests/tools/test_trivy_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def test_all_statuses(self):
249249
finding = findings[1]
250250
self.assertEqual(False, finding.active)
251251
self.assertEqual(True, finding.verified)
252-
self.assertEqual(True, finding.false_p)
252+
self.assertEqual(False, finding.false_p)
253253
self.assertEqual(False, finding.out_of_scope)
254254
self.assertEqual(True, finding.is_mitigated)
255255

0 commit comments

Comments
 (0)