-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjenkinsfile-owasp
33 lines (32 loc) · 922 Bytes
/
jenkinsfile-owasp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pipeline {
agent any
environment {
PATH = "$PATH:/usr/local/bin/"
IMAGETAG = ""
}
stages {
stage('DAST Using OWASP ZAP') {
steps {
script {
def currentDate = sh(script: 'date +%Y%m%d%H%M%S', returnStdout: true).trim()
env.reportFileName = "OWASP_${currentDate}.html"
sh "docker exec owasp zap-baseline.py -t http://watri.site:30001 -r ${reportFileName} -I"
}
}
}
stage('Copy Report to Workspace') {
steps {
script {
sh """
docker cp owasp:/zap/wrk/${env.reportFileName} ${WORKSPACE}/${env.reportFileName}
"""
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'OWASP_*.html', followSymlinks: false
}
}
}