Skip to content

Instantly share code, notes, and snippets.

@jwkidd3
Created October 8, 2019 20:06
Show Gist options
  • Save jwkidd3/30010634ddcbda92046eed25be2d78c3 to your computer and use it in GitHub Desktop.
Save jwkidd3/30010634ddcbda92046eed25be2d78c3 to your computer and use it in GitHub Desktop.
node {
script {
try {
// Context import fails if it already exists
sh 'zap-cli --zap-url zap -p 8000 --api-key 5364864132243598723485 --port 8000 context import /zap/data/WebGoat.context'
}
catch (Exception e) {
}
}
script {
try {
// If it finds results, returns error code, but we still want to publish the report
sh 'zap-cli --zap-url zap -p 8000 --api-key 5364864132243598723485 quick-scan -c WebGoat -u tester -s all --spider -r http://webgoat:8080/WebGoat'
}
catch (Exception e) {
}
}
sh 'zap-cli --zap-url zap -p 8000 --api-key 5364864132243598723485 report -o zap_report.html -f html'
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: false,
reportDir: '',
reportFiles: 'zap_report.html',
reportName: 'ZAP DAST Report',
reportTitles: ''
])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment