This repository was archived by the owner on Nov 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 606
This repository was archived by the owner on Nov 8, 2023. It is now read-only.
IgnoreIP and IgnoreCIDR not whitelisting correctly #534
Copy link
Copy link
Closed
Labels
Description
Just updated to Nginx 1.18.0 & NAXSI 1.1, and am not able to use the IP whitelisting feature.
I compile naxsi/nginx from source on this system. This particular server runs Ubuntu 16.04, but have also tested this on 18.04 with the same install procedure.
Config snippets
/etc/nginx/rules/naxsi.rules
#LearningMode;
SecRulesEnabled;
DeniedRule "/RequestDenied";
IgnoreIP "1.1.1.1"; #my actual IPv4
CheckRule "$SQL >= 8" BLOCK;
CheckRule "$RFI >= 8" BLOCK;
CheckRule "$TRAVERSAL >= 4" BLOCK;
CheckRule "$XSS >= 8" BLOCK;
...
/etc/nginx/sites-enabled/my-site.conf
include /etc/nginx/rules/naxsi_core.rules;
server {
listen 443 ssl;
server_name mycoolsite.com;
##ssl stuff here
location / {
include /etc/nginx/rules/naxsi.rules;
include /etc/nginx/rules/foo.rules; #specific to my app
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://my-cool-server:1337/;
}
location /RequestDenied {
return 418;
}
}
Nginx versions
$ nginx -V
nginx version: nginx/1.18.0
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)
built with OpenSSL 1.1.1h 22 Sep 2020
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --user=www-data --group=www-data --add-module=/usr/src/naxsi/naxsi-1.1a/naxsi_src --add-module=/usr/src/nginx_cookie_flag_module --with-http_ssl_module --with-http_v2_module --with-openssl=/usr/local/src/openssl --without-mail_pop3_module --without-mail_smtp_module --without-mail_imap_module --without-http_uwsgi_module --without-http_scgi_module --with-http_realip_module --prefix=/usr
Let me know if I made an obvious mistake, or if this is a real bug... Thanks all!