{ "name": "nginx-modsecurity", "version": "1.0.4", "summary": "ModSecurity-nginx, the connector that runs libmodsecurity in nginx, as a dynamic module for the prefix's nginx", "category": "server", "license": "Apache-2.0", "homepage": "https://github.com/owasp-modsecurity/ModSecurity-nginx", "source": { "url": "https://github.com/owasp-modsecurity/ModSecurity-nginx/releases/download/v1.0.4/ModSecurity-nginx-v1.0.4.tar.gz", "sha256": "6bdc7570911be884c1e43aaf85046137f9fde0cfa0dd4a55b853c81c45a13313" }, "watch": {"kind": "github-release", "repo": "owasp-modsecurity/ModSecurity-nginx", "tag_regex": "^v([0-9]+(?:\\.[0-9]+)+)$"}, "deps": [ "nginx", "libmodsecurity" ], "env_packages": [], "static": false, "nss": false, "vendor": "vendor.txt", "check": "v=$(sbin/nginx -v 2>&1 | sed -n 's/^nginx version: nginx\\///p') && [ -s lib/nginx/modules/ngx_http_modsecurity_module.so ] && readelf -d lib/nginx/modules/ngx_http_modsecurity_module.so | has 'NEEDED.*\\[libmodsecurity\\.so' && t=$(mktemp -d) && p=$(free_port) && d=$(free_port) && { while [ \"$d\" = \"$p\" ]; do d=$(free_port) || exit 1; done; } && cat > \"$t/n.conf\" < \"$t/stderr.log\" 2>&1 & pid=$!; } && wait_port \"$p\" && wait_port \"$d\" && c() { /usr/bin/curl -sS -m 10 -o /dev/null -w '%{http_code}' \"$1\"; } && [ \"$(c \"http://127.0.0.1:$p/x?q=attack\")\" = 403 ] && [ \"$(c \"http://127.0.0.1:$p/x?q=hello\")\" = 200 ] && [ \"$(c \"http://127.0.0.1:$p/allowed?q=attack\")\" = 200 ] && [ \"$(c \"http://127.0.0.1:$d/x?q=attack\")\" = 200 ] && has -F '\"ruleId\":\"2\"' < \"$t/audit.log\" && has -F '\"uri\":\"/x?q=attack\"' < \"$t/audit.log\" && has -F 'ModSecurity-nginx v1.0.4' < \"$t/audit.log\"; r=$?; [ -n \"${pid:-}\" ] && kill \"$pid\" 2> /dev/null && wait \"$pid\" 2> /dev/null; [ $r = 0 ] || cat \"$t/stderr.log\" \"$t/e.log\" \"$t/audit.log\" >&2 2> /dev/null; rm -rf -- \"${t:?}\"; [ $r = 0 ] && echo \"ModSecurity-nginx 1.0.4 for nginx $v: loaded with load_module; blocked by an http-level rule (403), the same rule taken off one path by a server's own rule before it (200), detection only answers 200 and writes the JSON audit log\"; exit $r" }