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

How to whitelist everything except a specific path like /rest? #346

Closed danlsgiga closed 7 years ago

danlsgiga commented 7 years ago

I'm looking into a way to whitelist everything except a specific path list /rest.

So far I've tried setting this unique rule: BasicRule wl:0 "mz:$URL_X:^!/rest/.*$|URL"

But I don't think it is being effective.

Is there any way to do that?

buixor commented 7 years ago

Hello,

Doing a negative rule should do the trick : https://github.com/nbs-system/naxsi/wiki/rules-examples#negative-rule