Fix some name handling for ARGS_*NAMES: regex SecRuleUpdateTargetById, etc.

This commit is contained in:
Martin Vierula
2022-01-04 11:47:18 -08:00
parent 76ce6739bf
commit 1a965a49ad
6 changed files with 127 additions and 5 deletions

View File

@@ -118,5 +118,85 @@
"SecRuleUpdateTargetById 1 !ARGS:mixpanel",
"SecRule ARGS \"@contains value\" \"id:1,t:trim,tag:'test',deny\""
]
},
{
"enabled":1,
"version_min":300000,
"title":"SecRuleUpdateTargetById - exclude from ARGS_NAMES using regex (match)",
"client":{
"ip":"200.249.12.31",
"port":123
},
"server":{
"ip":"200.249.12.31",
"port":80
},
"request":{
"headers":{
"Host":"localhost",
"User-Agent":"curl/7.38.0",
"Accept":"*/*"
},
"uri":"/?xxxyyy=value",
"method":"GET"
},
"response":{
"headers":{
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
"Content-Type":"text/html"
},
"body":[
"no need."
]
},
"expected":{
"http_code": 200
},
"rules":[
"SecRuleEngine On",
"SecRuleUpdateTargetById 1 \"!ARGS:/xxx/\"",
"SecRule ARGS_NAMES \"@contains yyy\" \"id:1,phase:2,deny,status:403\""
]
},
{
"enabled":1,
"version_min":300000,
"title":"SecRuleUpdateTargetById - exclude from ARGS_NAMES using regex (no match)",
"client":{
"ip":"200.249.12.31",
"port":123
},
"server":{
"ip":"200.249.12.31",
"port":80
},
"request":{
"headers":{
"Host":"localhost",
"User-Agent":"curl/7.38.0",
"Accept":"*/*"
},
"uri":"/?xxyyy=value",
"method":"GET"
},
"response":{
"headers":{
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
"Content-Type":"text/html"
},
"body":[
"no need."
]
},
"expected":{
"http_code": 403
},
"rules":[
"SecRuleEngine On",
"SecRuleUpdateTargetById 1 \"!ARGS:/xxx/\"",
"SecRule ARGS_NAMES \"@contains yyy\" \"id:1,phase:2,deny,status:403\""
]
}
]