I'm trying to use Owasp Zap(V2.11.1) within jenkins pipeline.
I need to scan a simple Url for this example: https: //MyHost:MyPort/ANY_PATH
After downloading the Jenkins Zap plugin, I executed the build, but it seems that the scan doesn't start.
This is the my Jenkins pipeline:
pipeline {
agent any
stages {
stage('Zap Test') {
steps {
script {
startZap(host: "127.0.0.1", port: 8080, timeout:30000, zapHome: "C:\\Program Files\\OWASP\\Zed Attack Proxy", allowedHosts:['https://igfscg.netsw.it:18080/IGFS_CG_WEB/app/cc/main/show?referenceData=B6345DAEC2AFF5A1FD8E84F8FC745E50'])
}
}
}
}
post {
always {
script {
archiveZap(failAllAlerts: 10, failHighAlerts: 0, failMediumAlerts: 0, failLowAlerts: 0, falsePositivesFilePath: "zapFalsePositives.json")
}
}
}
}
This is the Jenkins log file where it show that Zap is started, but seems also to attempt to connect to Zap
10027 [ZAP-daemon] INFO org.zaproxy.addon.oast.services.callback.CallbackService - Started callback service on 0.0.0.0:62554
10031 [ZAP-daemon] INFO org.zaproxy.zap.extension.dynssl.ExtensionDynSSL - Creating new root CA certificate
11205 [ZAP-daemon] INFO org.zaproxy.zap.extension.dynssl.ExtensionDynSSL - New root CA certificate created
11209 [ZAP-daemon] INFO org.zaproxy.zap.DaemonBootstrap - ZAP is now listening on
127.0.0.1:8080
11624 [ZAP-cfu] INFO org.zaproxy.zap.extension.autoupdate.ExtensionAutoUpdate - There is/are 24 newer addons
zap: Attempting to connect to ZAP at 127.0.0.1:8080
zap: Archiving results... zap: Checking results... zap: Deleting temp directory: C:\Users\a.carnevali.jenkins\workspace\igfs_cg_testing\zaptemp.tmp3371682578955130815
zap: Failed to delete temp directory. Unable to delete 'C:\Users\xxxxxx.jenkins\workspace\igfs_cg_testing\zaptemp.tmp3371682578955130815'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts. (Discarded 15 additional exceptions)
Moreover there are some additional messages coming from the windows console where I start Jenkins
INFO o.a.h.impl.execchain.RetryExec#execute: Retrying request to {}->http://127.0.0.1:8080
INFO o.a.h.impl.execchain.RetryExec#execute: I/O exception (java.net.SocketException) caught when processing request to {}-> http://127.0.0.1:8080: Software caused connection abort: recv failed
Could you please help on this?