This repository was archived by the owner on Oct 14, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
tests/integration/scanner Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -403,6 +403,9 @@ jobs:
403403 run : |
404404 # Install dummy-ssh app
405405 helm -n demo-apps install dummy-ssh ./demo-apps/dummy-ssh/ --wait
406+ # Install plain nginx server
407+ kubectl create deployment --image nginx:alpine nginx --namespace demo-apps
408+ kubectl expose deployment nginx --port 80 --namespace demo-apps
406409 - name : " nmap Integration Tests"
407410 run : |
408411 helm -n integration-tests install nmap ./scanners/nmap/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
@@ -423,6 +426,11 @@ jobs:
423426 helm -n integration-tests install ssh-scan ./scanners/ssh_scan/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
424427 cd tests/integration/
425428 npx jest --ci --color ssh-scan
429+ - name : " ssh-scan Integration Tests"
430+ run : |
431+ helm -n integration-tests install zap ./scanners/zap/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
432+ cd tests/integration/
433+ npx jest --ci --color zap
426434 - name : Inspect Post Failure
427435 if : failure()
428436 run : |
Original file line number Diff line number Diff line change 1+ const { scan } = require ( "../helpers" ) ;
2+
3+ test (
4+ "zap baseline scan against a plain nginx container should only find couple findings" ,
5+ async ( ) => {
6+ const { categories, severities } = await scan (
7+ "zap-nginx-baseline" ,
8+ "zap-baseline" ,
9+ [ "-t" , "http://nginx.demo-apps.svc" ] ,
10+ 60 * 4
11+ ) ;
12+
13+ expect ( categories ) . toMatchObject ( {
14+ "Content Security Policy (CSP) Header Not Set" : 1 ,
15+ 'Server Leaks Version Information via "Server" HTTP Response Header Field' : 1 ,
16+ "X-Content-Type-Options Header Missing" : 1 ,
17+ "X-Frame-Options Header Not Set" : 1 ,
18+ } ) ;
19+ expect ( severities ) . toMatchObject ( {
20+ low : 3 ,
21+ medium : 1 ,
22+ } ) ;
23+ } ,
24+ 5 * 60 * 1000
25+ ) ;
You can’t perform that action at this time.
0 commit comments