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

Commit feb5b8a

Browse files
authored
Merge pull request #97 from secureCodeBox/zap-integration-tests
Add Integration Tests for ZAP and some other improvements to improve the stability and debuggability of the tests
2 parents cc4e074 + 4e5b665 commit feb5b8a

File tree

24 files changed

+150
-29
lines changed

24 files changed

+150
-29
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ jobs:
412412
run: |
413413
# Install dummy-ssh app
414414
helm -n demo-apps install dummy-ssh ./demo-apps/dummy-ssh/ --wait
415+
# Install plain nginx server
416+
kubectl create deployment --image nginx:alpine nginx --namespace demo-apps
417+
kubectl expose deployment nginx --port 80 --namespace demo-apps
415418
- name: "nmap Integration Tests"
416419
run: |
417420
helm -n integration-tests install nmap ./scanners/nmap/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
@@ -432,6 +435,11 @@ jobs:
432435
helm -n integration-tests install ssh-scan ./scanners/ssh_scan/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
433436
cd tests/integration/
434437
npx jest --ci --color ssh-scan
438+
- name: "zap Integration Tests"
439+
run: |
440+
helm -n integration-tests install zap ./scanners/zap/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
441+
cd tests/integration/
442+
npx jest --ci --color zap
435443
- name: Inspect Post Failure
436444
if: failure()
437445
run: |

scanners/amass/templates/amass-scan-type.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ spec:
1010
location: "/home/securecodebox/amass-results.jsonl"
1111
jobTemplate:
1212
spec:
13-
ttlSecondsAfterFinished: 10
13+
{{- if .Values.scannerJob.ttlSecondsAfterFinished }}
14+
ttlSecondsAfterFinished: {{ .Values.scannerJob.ttlSecondsAfterFinished }}
15+
{{- end }}
1416
template:
1517
spec:
1618
restartPolicy: OnFailure

scanners/amass/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ parserImage:
44
tag: null
55

66
scannerJob:
7+
ttlSecondsAfterFinished: null
78
resources: {}
89
# scannerJob:
910
# resources:

scanners/kube-hunter/templates/kubehunter-scan-type.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ spec:
88
location: '/home/securecodebox/kube-hunter-results.json'
99
jobTemplate:
1010
spec:
11-
ttlSecondsAfterFinished: 10
11+
{{- if .Values.scannerJob.ttlSecondsAfterFinished }}
12+
ttlSecondsAfterFinished: {{ .Values.scannerJob.ttlSecondsAfterFinished }}
13+
{{- end }}
1214
template:
1315
spec:
1416
restartPolicy: Never

scanners/kube-hunter/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ parserImage:
44
tag: null
55

66
scannerJob:
7+
ttlSecondsAfterFinished: null
78
resources: {}

scanners/ncrack/templates/ncrack-scan-type.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ spec:
88
location: "/home/securecodebox/ncrack-results.xml"
99
jobTemplate:
1010
spec:
11-
ttlSecondsAfterFinished: 10
11+
{{- if .Values.scannerJob.ttlSecondsAfterFinished }}
12+
ttlSecondsAfterFinished: {{ .Values.scannerJob.ttlSecondsAfterFinished }}
13+
{{- end }}
1214
backoffLimit: 3
1315
template:
1416
spec:

scanners/ncrack/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ parserImage:
44
tag: null
55

66
scannerJob:
7+
ttlSecondsAfterFinished: null
78
resources: {}
89
extraVolumes: []
910
extraVolumeMounts: []

scanners/nikto/templates/nikto-scan-type.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ spec:
88
location: '/home/securecodebox/nikto-results.json'
99
jobTemplate:
1010
spec:
11-
ttlSecondsAfterFinished: 10
11+
{{- if .Values.scannerJob.ttlSecondsAfterFinished }}
12+
ttlSecondsAfterFinished: {{ .Values.scannerJob.ttlSecondsAfterFinished }}
13+
{{- end }}
1214
template:
1315
spec:
1416
restartPolicy: Never

scanners/nikto/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ parserImage:
44
tag: null
55

66
scannerJob:
7+
ttlSecondsAfterFinished: null
78
resources: {}
89
# scannerJob:
910
# resources:

scanners/nmap/templates/nmap-scan-type.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ spec:
88
location: "/home/securecodebox/nmap-results.xml"
99
jobTemplate:
1010
spec:
11-
ttlSecondsAfterFinished: 10
11+
{{- if .Values.scannerJob.ttlSecondsAfterFinished }}
12+
ttlSecondsAfterFinished: {{ .Values.scannerJob.ttlSecondsAfterFinished }}
13+
{{- end }}
1214
backoffLimit: 3
1315
template:
1416
spec:

0 commit comments

Comments
 (0)