diff --git a/report/src/__snapshots__/generateUrlReport.test.js.snap b/report/src/__snapshots__/generateUrlReport.test.js.snap index fe392487..fd249455 100644 --- a/report/src/__snapshots__/generateUrlReport.test.js.snap +++ b/report/src/__snapshots__/generateUrlReport.test.js.snap @@ -17,7 +17,7 @@ Object { "http": null, "lhr": null, "nmap": null, - "nuclei": null, + "nuclei": Array [], "screenshot": false, "sonarcloud": null, "stats": null, @@ -29,7 +29,6 @@ Object { }, "testssl": null, "thirdparties": null, - "trivy": null, "updownio": null, "url": "https://www.test.com", "wappalyzer": Object { @@ -94,11 +93,7 @@ Object { "nmap": Object { "report": "nmap.json", }, - "nuclei": Array [ - Object { - "report": "nuclei.json", - }, - ], + "nuclei": Array [], "screenshot": false, "sonarcloud": Array [ Object { @@ -161,7 +156,6 @@ Object { "thirdparties": Object { "report": "thirdparties.json", }, - "trivy": null, "updownio": Object { "report": "updownio.json", }, diff --git a/report/src/generateUrlReport.js b/report/src/generateUrlReport.js index 4ef8d027..1d721fce 100644 --- a/report/src/generateUrlReport.js +++ b/report/src/generateUrlReport.js @@ -50,13 +50,18 @@ const zapCleanup = (result) => /** * Minify nuclei JSON data * - * @param {NucleiReport} result nuclei JSON content + * @param {NucleiReport[]} result nuclei JSON content * @param {string} url extract only for this url * * @returns {NucleiReport} minified JSON content */ const nucleiCleanup = (result, url) => - result && result.map && result.map((r) => omit(r, ["request", "response"])); + (result && + Array.isArray(result) && + result[0] && + Array.isArray(result[0]) && + result[0].map((r) => omit(r, ["request", "response"]))) || + []; /** * Minify Lighthouse JSON data @@ -144,7 +149,8 @@ const tools = { github_repository: { data: requireToolData("github_repository.json") }, budget_page: { data: requireToolData("budget_page.json") }, 404: { data: requireToolData("404.json"), cleanup: wget404Cleanup }, - trivy: { data: requireToolData("trivy.json") /*, cleanup: trivyCleanup */ }, + // disable trivy + // trivy: { data: requireToolData("trivy.json") /*, cleanup: trivyCleanup */ }, "declaration-a11y": { data: requireToolData("declaration-a11y.json"), }, @@ -231,7 +237,8 @@ const generateUrlReport = (url) => { copyForWebsite("zap.html"); copyForWebsite("screenshot.jpeg"); copyForWebsite("nmapvuln.html"); - copyForWebsite("trivy.json"); + // disable trivy + // copyForWebsite("trivy.json"); return urlData; } else {