0
votes

I have installed ZAP plugin on Jenkins and downloaded ZAP-Proxy WAR file in Jenkins Server(ubuntu) and configured as jenkins job but its giving error when I execute the Job


4051 [ZAP-ProxyThread-15] WARN org.zaproxy.zap.extension.api.API  - Bad request to API endpoint [/xml/spider/action/scanAsUser/] from [127.0.0.1]:
The provided url is not in the required context (url_not_in_context) : url
    at org.zaproxy.zap.extension.spider.SpiderAPI.scanURL(SpiderAPI.java:508)
    at org.zaproxy.zap.extension.spider.SpiderAPI.handleApiAction(SpiderAPI.java:283)
    at org.zaproxy.zap.extension.api.API.handleApiRequest(API.java:506)
    at org.parosproxy.paros.core.proxy.ProxyThread.processHttp(ProxyThread.java:499)
    at org.parosproxy.paros.core.proxy.ProxyThread.run(ProxyThread.java:335)
    at java.lang.Thread.run(Thread.java:748)
ERROR: org.zaproxy.clientapi.core.ClientApiException: The provided url is not in the required context
1

1 Answers

0
votes

There is a property named Include in Context in job.

Found under: Build > Session Properties > Include in Context

If you have your starting point like

http://<IP/Host>:port/context1/context2/ 

under attack mode.

Keep Include in Context configured as

http://<IP/Host>:port/.*

so as to consider that URL as valid context with anything changing after /.