ZAP API scripts import

43 views
Skip to first unread message

Amelia Gherdan

unread,
Sep 5, 2024, 7:08:18 AM9/5/24
to ZAP Scripts
Hello,

Is there a way to add custom scripts with API requests to a remote ZAP Instance?

Simon Bennetts

unread,
Sep 5, 2024, 7:10:07 AM9/5/24
to ZAP Scripts

Amelia Gherdan

unread,
Sep 5, 2024, 7:36:15 AM9/5/24
to ZAP Scripts
Hi Simon
Thank you for your fast reply.
I have a folder with ZAP scripts with passive/active folders inside.
Is there a way to import them from REST API and to enable them? Solution provided is for a file, right?

Simon Bennetts

unread,
Sep 5, 2024, 7:46:11 AM9/5/24
to ZAP Scripts
The REST API only supports uploading one file at a time.
To handle folders of scripts there are 2 other options:
  • Manually copying them to the target (or building into the container) and then start ZAP with the option to load all of the files in a specific directory
  • Putting the folders in a shared drive that can be accessed by the ZAP instances, and then loading them as above.
You cant currently specify which directories to loads scripts from via the API, but you can set them via the command line as per https://www.zaproxy.org/faq/how-do-you-find-out-what-key-to-use-to-set-a-config-value-on-the-command-line/

Cheers,

Simon
Reply all
Reply to author
Forward
0 new messages