I'm trying to evaluate and block GET/POST requests that don't have a given ARG for a certain URIs.
The following rule doesn't validate the "!@eq 1" line
(REQUEST_URI and REQUEST_HEADERS work as expected when tested individually)
SecRule REQUEST_URI "(?i:(jwtpoc))" "phase:1,id:999955,block,log,deny,status:508,msg:'IP: %{REMOTE_ADDR} GET/POST test URI',chain"
SecRule &ARGS:cualquiera "!@eq 1" "chain"
SecRule &REQUEST_HEADERS:Referer "@eq 0"
I can validate both "@eq1" and "!@eq1" if I write a SecRule like the following one:
SecRule &ARGS:cualquiera "@eq 1" "id:999957,phase:2,pass,log,capture,msg:'param cualquiera found: %{MATCHED_VAR}'"
How can rule id 999955 achieve this goal?
Examples
SecRule REQUEST_URI "(?i:(jwtpoc))" "phase:2,id:999955,block,log,deny,status:508,msg:'IP: %{REMOTE_ADDR} GET/POST test URI',chain"
SecRule &ARGS:cualquiera "@eq 1" "chain"
SecRule &REQUEST_HEADERS:Referer "@eq 0"
curl --form cualquiera=ANY http://foo.bar/jwtpoc.showcaller [ OK ]
[22/Mar/2017:17:23:50 --0400] [foo.bar/sid#1ab39b8][rid#7f518c014e60][/jwtpoc.showcaller][1] Access denied with code 508 (phase 2). Operator EQ matched 0 at REQUEST_HEADERS. [file "/moduleconf/myrules/test/cp_rules.conf"] [line "2"] [id "999955"] [msg "IP: 10.10.10.145 GET/POST test URI"]
But for this one:
curl --referer myReferer http://beta.reservhotel.com/win/owa/jwtpoc.showcaller [ NOTOK ]
the rule SecRule &ARGS:cualquiera "@eq 1" "chain" is not considered and this action is not being blocked
Thanks!