wargio / naxsi

NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Whitelists don't work

Bit-Warrior-X opened this issue · comments

Hi, there

I tried to test naxsi with below command.
curl 'http://127.0.0.1:8080/?a=<>'

Then I could see logs in the log file.
2024/03/20 14:18:39 [error] 29706#0: *1 NAXSI_FMT: ip=127.0.0.1&server=127.0.0.1&uri=/&config=block&rid=c65265b0abb646c1cd1264c4ec1c43db&cscore0=$XSS&score0=8&zone0=ARGS&id0=1302&var_name0=a, client: 127.0.0.1, server: , request: "GET /?a=<> HTTP/1.1", host: "127.0.0.1:8080"

To ignore rule 1032, 1033, I added whitelist rule in nginx.conf file.
image

After restarting nginx, I expcted to see no error logs whilte using same command curl 'http://127.0.0.1:8080/?a=<>'

But there was still same error logs.

If I did something wrong, please tell me.

Thanks.

you whitelisted 1032 and 1033 but it gets blocked by 1302

NAXSI_FMT: ip=127.0.0.1
server=127.0.0.1
uri=/
config=block
rid=c65265b0abb646c1cd1264c4ec1c43db
cscore0=$XSS
score0=8
zone0=ARGS
id0=1302
var_name0=a

i strongly suggest to switch to the json output. enable it via set $naxsi_json_log 1; within the server{} context.

Yeah, that's right. Current request is blocked by 1032. How can I disable 1032 using whitelist rule ?

Whitelist what actually gets blocked. in your example you need to whitelist 1302 not 1032

Oh, shame. I am sorry. It works correctly now.
Thanks.