Ran the jenkins zap automation job today with following arguments:
+ docker run -e BUILD_TAG -e JOB_BASE_NAME -t -p 8092:8092 -v /home/ubuntu/workspace/Notification/Notification ZAP Scan/SyncGateway:/zap/wrk/ owasp/zap2docker-weekly /bin/bash -c sed -i -e "s/zap.ascan.scan(target.*/zap.ascan.scan_as_user(target, contextid=2, userid=36, recurse=True, scanpolicyname='Default Policy', method=None, postdata=None)/" zap_common.py ;
./zap-api-scan.py -t NS_swagger.json -f openapi -g gen.conf -r api-scan-Jul-01-2021::22:26.html -n /zap/wrk/Notification.context -d -z " -Xmx20480m -addoninstall exportreport -newsession /zap/wrk/newSession-"01-07-2021-22-26".session" --hook=/zap/wrk/scan-hook.py -P 8092
We are still seeing the issue with importing the opnapi swagger file:
2021-07-01 16:56:25,818 Trigger hook: importing_openapi, args: 2
2021-07-01 16:56:25,818 Import OpenAPI File NS_swagger.json
2021-07-01 16:56:25,819 Starting new HTTP connection (1): localhost:8092
2021-07-01 16:56:26,085
http://localhost:8092 "GET
http://zap/JSON/openapi/action/importFile/?file=%2Fzap%2Fwrk%2FNS_swagger.json&apikey= HTTP/1.1" 200 17
2021-07-01 16:56:26,086 Starting new HTTP connection (1): localhost:8092
2021-07-01 16:56:26,087
http://localhost:8092 "GET
http://zap/JSON/core/view/urls/ HTTP/1.1" 200 11
2021-07-01 16:56:26,088 Number of Imported URLs: 0
2021-07-01 16:56:26,088 Import warnings: []
2021-07-01 16:56:26,088 Failed to import any URLs
Traceback (most recent call last):
File "./zap-api-scan.py", line 456, in main
raise NoUrlsException()
NoUrlsException
Found Java version 11.0.11
Available memory: 31317 MB
On my local ZAP UI it worked ok after updating the addon.