nbs-system / naxsi

NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX
GNU General Public License v3.0
4.8k stars 606 forks source link

Refactoring code. #522

Closed wargio closed 4 years ago

wargio commented 4 years ago

This is a major refactoring to optimize the code.

Removed:

Introduced:

Support also for IPv6 (IPs and CIDR)

Added support for json value escaping supporting non printable chars.

Before to whitelist ips to not be blocked by NAXSI

WhitelistFile "/path/to/whitelist.txt"

Now:

IgnoreIP   "1.2.3.4"
IgnoreIP   "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
IgnoreCIDR "192.168.0.0/24"
IgnoreCIDR "2002::1234:abcd:ffff:c0a8:101/64"

You can use the include directive to achieve the same effect as WhitelistFile "/path/to/whitelist.txt"

wargio commented 4 years ago

@marcinguy i decided to refactor your code to simplify by using the include instead of your solution. it's more nginx-like