Im automating security scans by proxying my UI tests via Zap. For each security scan run, new zap session is created and requests are proxied.
In our App, access token from login api's response is set in authentication
header for authentication purpose. When I proxy my tests via zap, headers are also recorded and stored in ZAP along with request payload, url etc.
If
- token recorded by zap along with request is still valid during active scan (not expired or not invalidated)
- headers are excluded from ascan attack vectors (which is the default setting)
I was assuming I can get active scan work on apis (which require authentication also) without setting authentication, users, forced users, session management etc in Context.
Im not sure how to validate this!
Can anyone help with below
- Is my above assumption of "header recorded is good enough for ZAP to ascan" correct in my scenario ? (only payload, params etc will be tampered)
- Whats the advantage of setting authentication, users, forced users, session management etc in Context for automated security scan?
Thank you in advance.