Skip to content

Commit 12a185e

Browse files
committed
fix wrong trivy severites, update findings schema
Signed-off-by: Johannes Zahn <johannes.zahn@iteratec.com>
1 parent bbd9415 commit 12a185e

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎parser-sdk/nodejs/findings-schema.json‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@
4545
"INFORMATIONAL",
4646
"LOW",
4747
"MEDIUM",
48-
"HIGH",
49-
"CRITICAL",
50-
"UNKNOWN"
48+
"HIGH"
5149
]
5250
},
5351
"attributes": {

‎scanners/trivy/parser/parser.js‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,21 @@ async function parse(scanResults) {
3838
source: `https://github.com/nodejs/security-wg/tree/master/vuln`,
3939
};
4040
}
41+
42+
const adjustedSeverity =
43+
vulnerability.Severity === "CRITICAL"
44+
? "HIGH"
45+
: vulnerability.Severity === "UNKNOWN"
46+
? "INFORMATIONAL"
47+
: vulnerability.Severity;
4148

4249
findings.push({
43-
name: vulnerability.Title || `Vulnerability in Dependency ${vulnerability.PkgName} (${vulnerability.InstalledVersion})`,
50+
name: vulnerability.Title || `Vulnerability in Dependency ${vulnerability.PkgName} (${vulnerability.InstalledVersion})`,
4451
description: vulnerability.Description,
4552
category,
4653
location: imageId,
4754
osi_layer: "NOT_APPLICABLE",
48-
severity: vulnerability.Severity,
55+
severity: adjustedSeverity,
4956
reference,
5057
attributes: {
5158
installedVersion: vulnerability.InstalledVersion,

0 commit comments

Comments
 (0)