I am trying to implement Owasp Zap scan. But I am unable to find script for header authentication
How to add header authentication for the key value pair e.g key =api-key value = 123
docker run --rm -v $(Agent.ReleaseDirectory)/docker:/zap/wrk/:rw -t ictu/zap2docker-weekly zap-
baseline.py \
-t https://www.example.com/ProductDetails/v1/details?productId=123456 \
-I -x governreport.xml \
-r testreport.html \
--hook=/zap/auth_hook.py \
-z "auth.loginurl=https://www.example.com/ProductDetails/v1/details?productId=123456" \
I am following this article:
To add the header you want you can include the following options in your
-z
So your command would look something like
With this you will have the header
api-key: 123
added to all of your requests.Reference: https://www.zaproxy.org/blog/2017-06-19-scanning-apis-with-zap/