So the zap install dir is /usr/share/owasp-zap which is correctly setup as an environmental variable in jenkins
The ZAP Home dir is /home/.ZAP
So here is what the scripts portion of config.xml in /home/.ZAP/config.xml looks like:
<script>
<scripts>
<name>"authtest.zst"</name>
<engine>"Mozilla Zest"</engine>
<enabled>false</enabled>
<file>"/home/.ZAP/scripts/scripts/authentication/authtest.zst"</file>
<type>"authentication"</type>
</scripts>
</script>
From Jenkins, everything initializes okay, but I get 'Unable to find script while loading Script Based Authentication Method for name: authtest.zst"
Here is the contents of authtest.zst:
{
"zestVersion": "0.8",
"title": "authtest.zst",
"description": "",
"prefix": "",
"type": "authentication",
"parameters": {
"tokenStart": "{{",
"tokenEnd": "}}",
"tokens": {
"LoginURL": "",
"Username": "",
"Password": ""
},
"elementType": "ZestVariables"
},
"statements": [
{
"url": {{LoginURL}}",
"data": "{\"password\":{{Password}},\"username\":{{Username}}}",
"method": "POST",
"headers": "Content-Type: application/json;charset\u003dutf-8\r\nwithCredentials: true\r\nContent-Length: 45\r\nDNT: 1\r\n",
"assertions": [],
"followRedirects": false,
"cookies": [],
"index": 1,
"enabled": true,
"elementType": "ZestRequest"
}
],
"authentication": [],
"index": 0,
"enabled": true,
"elementType": "ZestScript"
}
ZAPROXY_HOME = /usr/share/owasp-zap/
Installation Method: System Installed ZAP Installation Directory which is set to ZAPROXY_HOME
ZAP Home Directory (which I assume is ZAP Settings) is set to /home/.ZAP
I checked the authentication box, selected Script-based Authentication, and authtest.zst shows right up in the dropdown, so I selected it and passed in the variables for the script.