Hi there,
I am trying to automate a ZAP scan for a REST API that does not provide a Swagger, OpenAPI or GraphQL specification.
Ideally active scan, but passive scan fine as a starting point.
I have some Node.js Javascript integration tests that are executed as a command and involve HTTPS requests to this REST API.
The closest I got to some automated process is via the command "proxychains" (sudo apt install proxychains4) to divert the HTTP traffic from these Node.js integration tests to the ZAP GUI.
I made sure I added "http 127.0.0.1 8080" (the host/port where the ZAP GUI is listening) to "/etc/proxychains.conf".
This is the command: "NODE_TLS_REJECT_UNAUTHORIZED='0' proxychains4 npm run my-integration-test"
However, the output I see in the Alert tab for the ZAP GUI should come from a command like the docker container instead.
I need to take the exit code of this hypothetical command like "echo $?" and make sure there are no errors - this way I can drive a CI (Continuous Integration) job to show red/green with logs.
I know the Continuous Integration automation can be done with the ZAP docker container, but that needs to see some Swagger, OpenAPI or GraphQL specification that I cannot provide.
Is there a way to automate the process with the Node.js integration tests combining them to some sort of ZAP command line thing?
Either Docker or anything else that does not involve human interaction like the ZAP GUI.
I installed ZAP 2.9.0 via snap on Linux like this:
$ snap find zaproxy
Name Version Publisher Notes Summary
zaproxy 2.9.0 psiinon classic OWASP ZAP, a tool for finding vulnerabilities in web applications
$ snap install zaproxy --classic
zaproxy 2.9.0 from Simon Bennetts (psiinon) installed
Thank you