docker run -p 8080:8080 \
-v $(pwd):/zap/wrk/:rw \
-t owasp/zap2docker-stable \
zap-full-scan.py \
-t https://domain.example.com/ \
-z "-config script.scripts.name=ExampleAuthentication.js -config script.scripts.engine=Graal.js -config script.scripts.type=authentication -config script.scripts.enabled=true -config script.scripts.file=/zap/wrk/scripts/authentication/ExampleAuthentication.js" \
-P 8080 \
-c /zap/wrk/zap-casa-config.conf \
-x results-full.xml \
-n /zap/wrk/contexts/Example.context \
-U Fede
18151 [ZAP-IO-Server-1-1] ERROR org.zaproxy.zap.extension.api.ContextAPI - null
java.util.ConcurrentModificationException: null
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1043) ~[?:?]
at java.util.ArrayList$Itr.next(ArrayList.java:997) ~[?:?]
at org.parosproxy.paros.model.Model.importContext(Model.java:575) ~[zap-2.14.0.jar:2.14.0]
at org.parosproxy.paros.model.Session.importContext(Session.java:1632) ~[zap-2.14.0.jar:2.14.0]
at org.parosproxy.paros.model.Session.importContext(Session.java:1537) ~[zap-2.14.0.jar:2.14.0]
docker run -p 8080:8080 \
-v $(pwd):/zap/wrk/:rw \
-t owasp/zap2docker-stable \
zap-full-scan.py \
-t https://domain.example.com/ \
-z "-config script.scripts.name=ExampleAuthentication.js -config script.scripts.engine=Graal.js -config script.scripts.type=authentication -config script.scripts.enabled=true -config script.scripts.file=/zap/wrk/scripts/authentication/ExampleAuthentication.js -config script.scripts.name=ExampleSession.js -config script.scripts.engine=Graal.js -config script.scripts.type=session -config script.scripts.enabled=true -config script.scripts.file=/zap/wrk/scripts/authentication/ExampleSession.js" \
-P 8080 \
-c /zap/wrk/zap-casa-config.conf \
-x results-full.xml \
-n /zap/wrk/contexts/Example.context \
-U Fede
but if I were the creator of it I believe I would have wanted people to tell me where things are not working very well.
We are kind of running against the clock here to get Google's approval on one of our products by getting clean scan results as specified by https://appdefensealliance.dev/casa/tier-2/ast-guide/dynamic-scan. This page even covers the usage of the traditional authentication features, and I believe from there, I followed the rabbit hole that got me into the ADDO videos..
I get your recommendation on the auto-detection, so I'll focus on that. I am more than happy going into a different channel to debug this if it helps the project. In my previous excersise, I didn't specify somithing such thing as a Verification URL. In my previous context I used the script-based authentication and that field appears grayed out. I configured the request and parsed the response in my script using JS, and then I configured the regexp to detect the scanner logged out. What is it that the scanner expects to have there configured (in the Verif. URL)?
Finally, if I get this context to work with browser-based auth configured, do you think I can export it and apply it in docker as it is?
20073 [ZAP-IO-Server-1-1] ERROR org.zaproxy.zap.users.User - An error occured while decoding user from: 2059;true;ZmVkZQ==;6;USER_IN_BASE64~PASS_IN_BASE64~
Hi Simon,
I am giving details for the sake of completeness that may not be relevant to reproduce the error but this is how I got the contexts file. Although this is a testing environment and a read-only user I am still hesitant to share creds in a public forum so I'll send them to you by email Simon.
Steps to Reproduce
- Run the Authentication Tester on ZAP 2.14.0 on MacOS X Ventura 13.6.
- Use the following configs:
- Login URL: https://sdpen.strikedeck.com/login
- Context: Authentication Test
- Username: shared-on-separate-email
- Password: shared-on-separate-email
- Browser: Firefox Headless
- Test and save the context into a file named test.context inside a folder named contexts.
- In a terminal, change into the directory that has the contexts folder.
- Download the file https://appdefensealliance.dev/static/casa/tier-2/files/zap-casa-config.zip in that folder and decompress the zip file to get zap-casa-config.conf for the scan configuration.
- Use the casa config and the contexts folder with the context file in the following docker command:
docker run -p 8080:8080 \
-v $(pwd):/zap/wrk/:rw \
-t owasp/zap2docker-stable \
zap-full-scan.py \
-t https://sdpen.strikedeck.com/ \
-P 8080 \
-c /zap/wrk/zap-casa-config.conf \
-x results-full.xml \
-n /zap/wrk/contexts/test.context \
-U "shared-on-separate-email"
26056 [ZAP-IO-Server-1-1] WARN org.zaproxy.zap.extension.authentication.ExtensionAuthentication - No authentication method type found for ID: 6
26061 [ZAP-IO-Server-1-1] ERROR org.zaproxy.zap.users.User - An error occured while decoding user from: 0;true;REDACTED;6;REDACTED~REDACTED~
owasp/zap2docker-stable latest 37613a7e2865 8 days ago 1.99GB
owasp/zap2docker-stable <none> 547a4a270adb 5 weeks ago 1.97GB