Skip to content

Commit 774a995

Browse files
authored
fix: triage with directory scanning and documentation for TRIAGE.json (#4349)
1 parent 4472e65 commit 774a995

File tree

4 files changed

+29
-16
lines changed

4 files changed

+29
-16
lines changed

.github/workflows/cve_bin_tool_action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
- uses: intel/cve-bin-tool-action@main
1717
with:
1818
exclude_dir: test
19-
triage_input_file: TRIAGE.vex
19+
vex_file: TRIAGE.json

TRIAGE.vex renamed to TRIAGE.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"analysis": {
3131
"state": "false_positive",
3232
"response": [],
33-
"detail": "NewFound"
33+
"detail": "false positive because the python API for zstandard has lower version numbers than the main zstandard library"
3434
},
3535
"affects": [
3636
{
@@ -65,7 +65,7 @@
6565
"analysis": {
6666
"state": "false_positive",
6767
"response": [],
68-
"detail": "NewFound"
68+
"detail": "false positive because the python API for zstandard has lower version numbers than the main zstandard library"
6969
},
7070
"affects": [
7171
{
@@ -100,7 +100,7 @@
100100
"analysis": {
101101
"state": "false_positive",
102102
"response": [],
103-
"detail": "NewFound"
103+
"detail": "RSA detected is rust library."
104104
},
105105
"affects": [
106106
{
@@ -135,7 +135,7 @@
135135
"analysis": {
136136
"state": "false_positive",
137137
"response": [],
138-
"detail": "NewFound"
138+
"detail": "arrow is reporting CVEs found for another product named arrow"
139139
},
140140
"affects": [
141141
{
@@ -170,7 +170,7 @@
170170
"analysis": {
171171
"state": "false_positive",
172172
"response": [],
173-
"detail": "NewFound"
173+
"detail": "arrow is reporting CVEs found for another product named arrow"
174174
},
175175
"affects": [
176176
{
@@ -205,7 +205,7 @@
205205
"analysis": {
206206
"state": "false_positive",
207207
"response": [],
208-
"detail": "NewFound"
208+
"detail": "arrow is reporting CVEs found for another product named arrow"
209209
},
210210
"affects": [
211211
{
@@ -240,7 +240,7 @@
240240
"analysis": {
241241
"state": "false_positive",
242242
"response": [],
243-
"detail": "NewFound"
243+
"detail": "arrow is reporting CVEs found for another product named arrow"
244244
},
245245
"affects": [
246246
{
@@ -275,7 +275,7 @@
275275
"analysis": {
276276
"state": "false_positive",
277277
"response": [],
278-
"detail": "NewFound"
278+
"detail": "arrow is reporting CVEs found for another product named arrow"
279279
},
280280
"affects": [
281281
{
@@ -310,7 +310,7 @@
310310
"analysis": {
311311
"state": "false_positive",
312312
"response": [],
313-
"detail": "NewFound"
313+
"detail": "arrow is reporting CVEs found for another product named arrow"
314314
},
315315
"affects": [
316316
{
@@ -415,7 +415,7 @@
415415
"analysis": {
416416
"state": "false_positive",
417417
"response": [],
418-
"detail": "NewFound"
418+
"detail": "docutils is reporting CVEs found for another product with the same name"
419419
},
420420
"affects": [
421421
{
@@ -450,7 +450,7 @@
450450
"analysis": {
451451
"state": "not_affected",
452452
"response": [],
453-
"detail": "NewFound"
453+
"detail": "Applied the appropriate mitigations to avoid malicious images"
454454
},
455455
"affects": [
456456
{

cve_bin_tool/cli.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,6 @@ def main(argv=None):
988988
args["input_file"]
989989
and not args["input_file"].endswith(".csv")
990990
and not args["input_file"].endswith(".json")
991-
and not args["input_file"].endswith(".vex")
992991
):
993992
args["directory"] = args["input_file"]
994993
args["input_file"] = ""
@@ -1063,9 +1062,16 @@ def main(argv=None):
10631062
if scan_info:
10641063
product_info, path = scan_info
10651064
LOGGER.debug(f"{product_info}: {path}")
1066-
triage_data = parsed_data.get(product_info, {"default": {}})
1067-
# Ignore paths from triage_data if we are scanning directory
1068-
triage_data["paths"] = {path}
1065+
# add product_info to parsed_data to check for with vex file
1066+
if product_info in parsed_data:
1067+
# update the paths in triage_data with the new path
1068+
triage_data = parsed_data[product_info]
1069+
triage_data["paths"].add(path)
1070+
else:
1071+
# create a new entry if product_info not in parsed_data
1072+
triage_data = {"default": {}, "paths": {path}}
1073+
parsed_data[product_info] = triage_data
1074+
10691075
cve_scanner.get_cves(product_info, triage_data)
10701076
total_files = version_scanner.total_scanned_files
10711077

doc/triaging_process.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ Note: Always pass value for `-rr` flag in double quotes
247247
]
248248
}
249249
```
250+
### Why We Use a `TRIAGE.json` File Inside the CVE Binary Tool Repository?
251+
252+
The CVE Binary Tool provides functionality to include scans as part of a GitHub continuous integration (CI) workflow using the [`cve-bin-tool-action`](https://github.com/intel/cve-bin-tool-action). This action is used to scan the repository for vulnerabilities, with the results displayed in the security tab of the scanned repository.
253+
254+
However, the generated report may sometimes include false positives. For example, CVE Binary Tool uses the Python arrow package, but the vulnerability report could mistakenly flag a vulnerability associated with Rust's arrow package, which shares the same name. Additionally, some detected vulnerabilities may not affect the repository being scanned; they might be mitigated, or the vulnerable function might not be used, as discussed earlier.
255+
256+
To address this, cve-bin-tool-action provides an option to filter out FalsePositive and NotAffected vulnerabilities using the vex_file option in the [`cve_bin_tool_action.yml`](https://github.com/intel/cve-bin-tool/blob/main/.github/workflows/cve_bin_tool_action.yml) configuration file, Such packages can be marked as NotAffected or FalsePositive in the TRIAGE.json file, which can then be used with cve-bin-tool-action to ensure that these entries are appropriately filtered out during the scanning process. reference: [`Issue #3193`](https://github.com/intel/cve-bin-tool/issues/3193)
250257

251258
### Limitations :
252259

0 commit comments

Comments
 (0)