Running ZAP in a local deployment with the following configuration:
{
"readOnlyFileShareMounts": [
{
"fileShareName": "specifications",
"mountPath": "/specifications"
}
],
"testTasks": {
"targetConfiguration": {
"apiSpecifications": [
"/specifications/openapi.json"
],
"endpoint": "https://<endpoint-url>/managementserver/rest"
},
"tasks": [
{
"toolName": "ZAP",
"outputFolder": "zap",
"keyVaultSecrets": [
"TOKEN"
],
"authenticationMethod": {
"Token": "Token"
}
}
]
}
}
The openapi.json specification contains the following:
"servers": [
{
"url": "https://localhost/ManagementServer/rest",
"description": "Management Server entry point"
}
]
Execution runs tests against URL from specification instead of endpoint in configuration, causing many errors like:
14529 [ZAP-Import-OpenAPI-1] WARN org.zaproxy.zap.extension.openapi.ExtensionOpenApi - Failed to access URL: https://localhost/ManagementServer/rest/cameras : java.net.ConnectException : Connection refused (Connection refused)
14529 [ZAP-Import-OpenAPI-1] WARN org.zaproxy.zap.extension.openapi.ExtensionOpenApi - Failed to access URL: https://localhost/ManagementServer/rest/cameras/id?tasks=tasks : java.net.ConnectException : Connection refused (Connection refused)
14529 [ZAP-Import-OpenAPI-1] WARN org.zaproxy.zap.extension.openapi.ExtensionOpenApi - Failed to access URL: https://localhost/ManagementServer/rest/cameras/id?task=task : java.net.ConnectException : Connection refused (Connection refused)
This happens only when using a mounted file path for the specification.
Running a local python http.server on the host and changing the URL in the configuration to:
"apiSpecifications": [ "http://host.docker.internal:8000/openapi.json" ]
returns expected result.
Lastly, all other tools work with:
"apiSpecifications": [ "/specifications/openapi.json" ]
Running ZAP in a local deployment with the following configuration:
{ "readOnlyFileShareMounts": [ { "fileShareName": "specifications", "mountPath": "/specifications" } ], "testTasks": { "targetConfiguration": { "apiSpecifications": [ "/specifications/openapi.json" ], "endpoint": "https://<endpoint-url>/managementserver/rest" }, "tasks": [ { "toolName": "ZAP", "outputFolder": "zap", "keyVaultSecrets": [ "TOKEN" ], "authenticationMethod": { "Token": "Token" } } ] } }The
openapi.jsonspecification contains the following:Execution runs tests against URL from specification instead of endpoint in configuration, causing many errors like:
This happens only when using a mounted file path for the specification.
Running a local python http.server on the host and changing the URL in the configuration to:
returns expected result.
Lastly, all other tools work with: