Skip to content

Commit

Permalink
fix: capitalise severity
Browse files Browse the repository at this point in the history
  • Loading branch information
lili2311 committed May 27, 2021
1 parent ff08e43 commit 67559b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/lib/convert-issue-to-spdx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ function getVulnerabilityRating(
const vulnerabilityRating: types.VulnerabilityRating = {
method: issue.CVSSv3 ? 'CVSS_3' : undefined, // must be CVSS_2, CVSS_3, OWASP_RISK or OTHER
score: [vulnerabilityRatingScore],
severity: issue.severity, // exploitability score of the vulnerability either None, Low, Medium, High or Critical
severity: capitalize(issue.severity), // exploitability score of the vulnerability either None, Low, Medium, High or Critical
vector: issue.CVSSv3,
};

return [vulnerabilityRating];
}

function capitalize(str: string) {
return str[0].toUpperCase() + str.slice(1);
}

function getExternalReferencesRelationships(
references: types.SnykIssueReference[],
): types.ExternalReferencesRelationship[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Upgrade \`json\` to version 2.3.0 or higher.
"impact": "<2.3.0",
},
],
"severity": "high",
"severity": "High",
"vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:H",
},
],
Expand Down

0 comments on commit 67559b1

Please sign in to comment.