我正在尝试评估和阻止某些 URI 没有给定 ARG 的 GET/POST 请求。
以下规则不验证“!@eq 1”行
(REQUEST_URI 和 REQUEST_HEADERS 在单独测试时按预期工作)
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"
如果我编写如下所示的 SecRule,我可以同时验证“@eq1”和“!@eq1” :
SecRule &ARGS:cualquiera "@eq 1" "id:999957,phase:2,pass,log,capture,msg:'param cualquiera found: %{MATCHED_VAR}'"
规则 id 999955 如何实现这一目标?
例子
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 [好]
[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"]
但是对于这个:
curl --referer myReferer http://beta.reservhotel.com/win/owa/jwtpoc.showcaller [ NOTOK ]
不考虑规则SecRule &ARGS:cualquiera "@eq 1" "chain"并且此操作未被阻止
谢谢!