Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 6318099

Browse files
committed
Refactored the ZAP parser to generate more detailed finding objects #14
1 parent 6b0e5f8 commit 6318099

File tree

11 files changed

+2123
-538
lines changed

11 files changed

+2123
-538
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
.DS_Store
22
**/node_modules
3-
coverage/
3+
coverage/
4+
.vagrant
5+
**.log
6+
**/*.monopic

hooks/imperative-subsequent-scans/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

hooks/imperative-subsequent-scans/hook.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,12 @@ async function startZAPBaselineHttpsScan({ parentScan, hostname, port }) {
191191
console.log(
192192
" --> Starting async subsequent ZAP Scan for host: '" + hostname + "' and port: '" + port + "'"
193193
);
194+
// https://www.zaproxy.org/docs/docker/baseline-scan/
194195
await startSubsequentSecureCodeBoxScan({
195196
parentScan,
196197
name: `zap-${port}-${hostname.toLowerCase()}`,
197198
scanType: "zap-baseline",
198-
parameters: ["-t", "https://" + hostname + ":" + port],
199+
parameters: ["-a", "-j", "-t", "https://" + hostname + ":" + port],
199200
});
200201
}
201202
else

hooks/imperative-subsequent-scans/hook.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ test("Should create subsequent scans for open HTTPS ports (NMAP findings)", asyn
6565
});
6666
expect(startSubsequentSecureCodeBoxScan).toHaveBeenNthCalledWith(2, {
6767
name: "zap-443-foobar.com",
68-
parameters: ["-t", "https://foobar.com:443"],
68+
parameters: ["-a", "-j", "-t", "https://foobar.com:443"],
6969
parentScan: { metadata: { labels: { foo: "bar" } } },
7070
scanType: "zap-baseline",
7171
});
@@ -78,7 +78,7 @@ test("Should create subsequent scans for open HTTPS ports (NMAP findings)", asyn
7878
});
7979
expect(startSubsequentSecureCodeBoxScan).toHaveBeenNthCalledWith(4, {
8080
name: "zap-8443-example.com",
81-
parameters: ["-t", "https://example.com:8443"],
81+
parameters: ["-a", "-j", "-t", "https://example.com:8443"],
8282
parentScan: { metadata: { labels: { foo: "bar" } } },
8383
scanType: "zap-baseline",
8484
});
@@ -677,7 +677,7 @@ test("Should create subsequent scans for Service which are running in custom por
677677
});
678678
expect(startSubsequentSecureCodeBoxScan).toHaveBeenNthCalledWith(16, {
679679
name: "zap-3000-https.example.com",
680-
parameters: ["-t", "https://https.example.com:3000"],
680+
parameters: ["-a", "-j", "-t", "https://https.example.com:3000"],
681681
parentScan: { metadata: { labels: { foo: "bar" } } },
682682
scanType: "zap-baseline",
683683
});

scanner/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

scanner/package-lock.json

Lines changed: 825 additions & 517 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scanner/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"author": "",
1414
"license": "ISC",
1515
"devDependencies": {
16-
"jest": "^25.1.0"
16+
"jest": "^25.5.4"
1717
}
1818
}

0 commit comments

Comments
 (0)