This is the command I run to scan my api
sudo docker run --env ZAP_AUTH_HEADER_VALUE="AUTHENTICATION TOKEN" -v $(pwd):/zap/wrk/:rw softwaresecurityproject/zap-stable zap-api-scan.py -t openapi.json -f openapi \
-r report.html
It works but I want it to stop scanning certain urls so i created a context in the gui with an url regex to include in context and one to exclude. I then exported this context and linked it in the docker scan with -n My.context
When running the now modified command I get the error:
WARN API - Bad request to API endpoint [/JSON/ascan/action/scan/] from [127.0.0.1]:
org.zaproxy.zap.extension.api.ApiException: URL_NOT_IN_CONTEXT (url)
I assumed that excluding an url would stop any requests to that url. Am I doing this wrong or is the scan not working as intended?
Thanks in advance :)