Ivan Djorgon
unread,Jan 21, 2022, 3:13:43 PM1/21/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to OWASP ZAP User Group
Docker image version used: owasp/zap2docker-stable.
Hello there! I believe this has been brought up before but I received "Could not find custom hooks file at /zap/wrk/my-hooks.py" when running zap-baseline.py or zap-full-scan.py from within docker container. The message of interest is:
2022-01-20 20:13:21,378 Could not find custom hooks file at /zap/wrk/my-hooks.py
2022-01-20 20:13:21,378 A file based option has been specified but the directory '/zap/wrk' is not mounted
In another thread, it was said that this is an Info Message and not an Error / Warning.
I will try to explain my scenario and provide details/steps as best as I can, considering I can't share any of the Project information. I tried to follow the best practices, such as ensuring to test locally with desktop client first and then to move on to testing locally via automation.
Let me just say that the app is behind basic auth, and scanning it using desktop client works perfectly fine (both spider and active scan). I was able to set up and configure authentication correctly, and I've been running the scans periodically against a couple of different test environments and I get consistent results every time.
Once I made sure that is stable I proceeded to explore zap automation. I pulled latest stable docker image, and ensured I did all of the prep work from configuring the docker container as well as the context preparation (exporting/saving the context file), and exporting/saving the selected URLs. [I have moved the required context file and others to the docker container; also have a simple bash script that opens/reads the 'selected URLs', which is run before the baseline script.]
As a result, when I attempt to trigger either zap-baseline.py or zap-full-scan.py from within docker container nothing happens and the "Could not find custom hooks file..." message is thrown immediately. Tests were triggered as follows:
zap-baseline.py -t https://......com -n my.context -U loginuser -I
As a comparison, I was able to set up, configure and trigger successful scans using ZAP CLI for both spider baseline and active-scan options. I've gotten solid results which are the same as the "manual desktop app" results. I'm not sure why I would need to mount/specify custom hooks file(s), as the "same" approach works for ZAP CLI.
I've tried running ZAP CLI from within docker, and the active-scan errors out due to unrelated errors (I get kicked out of the docker container before scan completion - don't think it's related to ZAP, i.e. JavaScript error: resource://pdf.js/PdfStreamConverter.jsm, line 1115: NS_ERROR_FAILURE: Ignore PDF.js for this download.). But, I might have to write another email for that.
Any insight or suggestions would be much appreciated!
Thank you,
Ivan