Open a-h opened 2 years ago
@a-h - I've spent the morning looking at the same issue (site behind basic auth) and have configured the below (which draws the basic auth base64 hash from a github secret).
Building on your posted solution from last year, this is a slightly different tact in that it doesn't require a config file (as the args are all supplied through command options).
It's a little ugly - but in positive news - it does work with the ZAP Github actions out of the box and avoids secrets needing to be stored in files 👍
uses: zaproxy/action-baseline@v0.6.1
with:
target: 'https://xyz.com'
token: ${{ secrets.GH_ACCESS_TOKEN }}
cmd_options: '-z "-config replacer.full_list(0).description=auth1 -config replacer.full_list(0).enabled=true -config replacer.full_list(0).matchtype=REQ_HEADER -config replacer.full_list(0).matchstr=Authorization -config replacer.full_list(0).regex=false -config replacer.full_list(0).replacement=\"Basic ${{ secrets.<<github-repo-secret-name-for-base64-auth-hash>>}}\"'
I'm using the ZAP baseline action to scan an application that, in the testing environment, is protected by basic auth.
I documented how to do this here: https://adrianhesketh.com/2020/07/07/owasp-baseline-scan-with-basic-auth-in-docker-github-actions/
It requires the use of a config file:
And setting the parameter to use it.
When I tried out the same approach this year, I got the following errors:
However, bypassing the Automation Framework with the
--autooff
flag got me the expected results - a working scan.Not sure how to proceed....