Skip to content

Commit

Permalink
fix: fix nuclei and disable trivy (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
matmut7 authored Oct 11, 2023
1 parent 5e49055 commit feb01b5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
10 changes: 2 additions & 8 deletions report/src/__snapshots__/generateUrlReport.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Object {
"http": null,
"lhr": null,
"nmap": null,
"nuclei": null,
"nuclei": Array [],
"screenshot": false,
"sonarcloud": null,
"stats": null,
Expand All @@ -29,7 +29,6 @@ Object {
},
"testssl": null,
"thirdparties": null,
"trivy": null,
"updownio": null,
"url": "https://www.test.com",
"wappalyzer": Object {
Expand Down Expand Up @@ -94,11 +93,7 @@ Object {
"nmap": Object {
"report": "nmap.json",
},
"nuclei": Array [
Object {
"report": "nuclei.json",
},
],
"nuclei": Array [],
"screenshot": false,
"sonarcloud": Array [
Object {
Expand Down Expand Up @@ -161,7 +156,6 @@ Object {
"thirdparties": Object {
"report": "thirdparties.json",
},
"trivy": null,
"updownio": Object {
"report": "updownio.json",
},
Expand Down
15 changes: 11 additions & 4 deletions report/src/generateUrlReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"),
},
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit feb01b5

Please sign in to comment.