Skip to content

Commit

Permalink
Update wording when fix unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Hodgetts committed May 20, 2024
1 parent 36d9a45 commit c4bf626
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 20 deletions.
15 changes: 7 additions & 8 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ function check_level(sev_value) {
function vulnerabilities2SARIFResByPackage(data) {
let results = [];
let rules = [];
let ruleIds = [];
let resultUrl = "";
let baseUrl = null;

Expand Down Expand Up @@ -630,7 +629,7 @@ function getSARIFVulnFullDescription(pkg, vuln) {
Severity: ${vuln.severity.value}
Package: ${pkg.name}
Type: ${pkg.type}
Fix: ${pkg.suggestedFix || "Unknown"}
Fix: ${pkg.suggestedFix || "No fix available"}
URL: https://nvd.nist.gov/vuln/detail/${vuln.name}`;
}

Expand All @@ -643,7 +642,7 @@ function getSARIFPkgHelp(pkg) {
CVSS Version: ${vuln.cvssScore.value.version}
CVSS Vector: ${vuln.cvssScore.value.vector}
Version: ${pkg.version}
Fix Version: ${pkg.suggestedFix || "Unknown"}
Fix Version: ${pkg.suggestedFix || "No fix available"}
Exploitable: ${vuln.exploitable}
Type: ${pkg.type}
Location: ${pkg.path}
Expand All @@ -670,7 +669,7 @@ CVSS Score: ${vuln.cvssScore.value.score}
CVSS Version: ${vuln.cvssScore.value.version}
CVSS Vector: ${vuln.cvssScore.value.vector}
Version: ${pkg.version}
Fix Version: ${pkg.suggestedFix || "Unknown"}
Fix Version: ${pkg.suggestedFix || "No fix available"}
Exploitable: ${vuln.exploitable}
Type: ${pkg.type}
Location: ${pkg.path}
Expand Down Expand Up @@ -709,7 +708,7 @@ function getSARIFReportMessageByPackage(data, pkg, baseUrl) {
CVSS Score: ${vuln.cvssScore.value.score}
CVSS Version: ${vuln.cvssScore.value.version}
CVSS Vector: ${vuln.cvssScore.value.vector}
Fixed Version: ${(vuln.fixedInVersion || 'Unknown')}
Fixed Version: ${(vuln.fixedInVersion || 'No fix available')}
Exploitable: ${vuln.exploitable}
Link to NVD: [${vuln.name}](https://nvd.nist.gov/vuln/detail/${vuln.name})\n`;
});
Expand Down Expand Up @@ -740,7 +739,7 @@ function getSARIFReportMessage(data, vuln, pkg, baseUrl) {
CVSS Score: ${vuln.cvssScore.value.score}
CVSS Version: ${vuln.cvssScore.value.version}
CVSS Vector: ${vuln.cvssScore.value.vector}
Fixed Version: ${(vuln.fixedInVersion || 'Unknown')}
Fixed Version: ${(vuln.fixedInVersion || 'No fix available')}
Exploitable: ${vuln.exploitable}
Link to NVD: [${vuln.name}](https://nvd.nist.gov/vuln/detail/${vuln.name})`;

Expand Down Expand Up @@ -793,7 +792,7 @@ function getRulePkgMessage(rule, packages) {
`${vuln.cvssScore.value.score}`,
`${vuln.cvssScore.value.version}`,
`${vuln.cvssScore.value.vector}`,
`${pkg.suggestedFix || "Unknown"}`,
`${pkg.suggestedFix || "No fix available"}`,
`${vuln.exploitable}`
]);
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "secure-inline-scan-action",
"version": "4.1.0",
"version": "4.1.1",
"description": "This actions performs image analysis on locally built container image and posts the result of the analysis to Sysdig Secure.",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function cleanupTemporaryDir(tmpDir) {
}

const exampleReport = JSON.stringify(require("./fixtures/report-test.json"));
const exampleSarif = JSON.stringify(require("./fixtures/sarif-test.json"),null,2);
//const exampleSarif = JSON.stringify(require("./fixtures/sarif-test.json"),null,2);

describe("input parsing", () => {
let oldEnv;
Expand Down

0 comments on commit c4bf626

Please sign in to comment.