Closed J12934 closed 5 years ago
I think we might actually be missing the replacer plugin in our docker container.
Maybe we must install it via commandline in the dockerfile as we already do with the OpenAPI Plugin (see init.sh)
zap/zap.sh -Xmx3G -daemon -dir /home/zap/ -port 8090 -host 0.0.0.0 -config api.disablekey=true -config api.addrs.addr.name=.* -config api.addrs.addr.regex=true -addoninstall soap -addoninstall openapi
Appears to be installed... Zap logs all installed plugins on startup...
Installed add-ons: [[id=alertFilters, version=6.0.0], ... [id=replacer, version=4.0.0], ... [id=zest, version=26.0.0]]
You are right! I testest the ZAP bare docker image, but it already contains the replacer API:
docker run -it --rm -p 8090:8090 owasp/zap2docker-bare zap.sh -daemon -port 8090 -host 0.0.0.0 -config api.disablekey=true -config 'api.addrs.addr.name=.*' -config api.addrs.addr.regex=true
The problem is not the missing API, it's already existing... The problem is that the replacer plugin API parameter "replacement" is mandatory (in the ZAP UI it's not). So if you try to start a process with an replacer configuration that contains a empty string as value for the replacement parameter, this will fail :(
A configuration that completes:
[{
"attributes":{
"ZAP_BASE_URL": "http://bodgeit:8080/bodgeit",
"ZAP_REPLACER_RULES":[{
"matchType": "REQ_HEADER",
"description": "Add a special Authentication Header",
"matchString": "Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l",
"initiators": "",
"matchRegex": "false",
"replacement": "Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l",
"enabled": "true"}],
"ZAP_SPIDER_MAX_DEPTH": 2,
"ZAP_SPIDER_INCLUDE_REGEX":[],
"ZAP_SPIDER_EXCLUDE_REGEX":[],
"ZAP_SCANNER_INCLUDE_REGEX":[],
"ZAP_SCANNER_EXCLUDE_REGEX":[]
}]
A configuration that fails:
[{
"attributes":{
"ZAP_BASE_URL": "http://bodgeit:8080/bodgeit",
"ZAP_REPLACER_RULES":[{
"matchType": "RESP_HEADER",
"description": "Remove HSTS",
"matchString": "Strict-Transport-Security",
"initiators": "",
"matchRegex": "false",
"replacement": "",
"enabled": "true"}],
"ZAP_SPIDER_MAX_DEPTH": 2,
"ZAP_SPIDER_INCLUDE_REGEX":[],
"ZAP_SPIDER_EXCLUDE_REGEX":[],
"ZAP_SCANNER_INCLUDE_REGEX":[],
"ZAP_SCANNER_EXCLUDE_REGEX":[]
}]
i created an ZAP issue regarding the mandatory replacement value: https://github.com/zaproxy/zaproxy/issues/5080
The fix for this issue was just released in v7 of the Replacer addon. I believe this issue can be closed.
I started a Zap Process with an advanced scanner configuration but did not set any replacer rules. The scanner wrapper failed too start the scan, see exception.