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

Commit df71a34

Browse files
authored
Merge pull request #15 from secureCodeBox/feature/improve-zap-parser
Refactored the ZAP parser to generate more detailed finding objects #14
2 parents 9516e7d + a170728 commit df71a34

File tree

12 files changed

+2149
-538
lines changed

12 files changed

+2149
-538
lines changed

.codeclimate.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: "2" # required to adjust maintainability checks
2+
checks:
3+
file-lines:
4+
config:
5+
threshold: 300
6+
method-lines:
7+
config:
8+
threshold: 50
9+
exclude_patterns:
10+
- "config/"
11+
- "db/"
12+
- "dist/"
13+
- "features/"
14+
- "**/node_modules/"
15+
- "script/"
16+
- "**/spec/"
17+
- "**/test/"
18+
- "**/tests/"
19+
- "**/__testFiles__/"
20+
- "**/__snapshots__/"
21+
- "Tests/"
22+
- "**/vendor/"
23+
- "**/*_test.go"
24+
- "**/*.deepcopy.go"
25+
- "**/*.test.js"
26+
- "**/*.d.ts"

.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.

0 commit comments

Comments
 (0)