fix: remove target by {id,tag} are now considering collections

Fix issue #1409
This commit is contained in:
Felipe Zimmerle
2017-07-25 09:19:21 -03:00
parent 7c2dbf48cf
commit 337216fd87
4 changed files with 95 additions and 5 deletions

View File

@@ -2,9 +2,9 @@
{
"enabled":1,
"version_min":300000,
"title":"Testing CtlRuleRemoteTargetById (1)",
"title":"Testing CtlRuleRemoveTargetById (1)",
"expected":{
"debug_log": "Variable: ARGS:pwd was excluded by ruleRemoteTargetById..."
"debug_log": "Variable: ARGS:pwd was excluded by ruleRemoveTargetById..."
},
"client":{
"ip":"200.249.12.31",
@@ -34,7 +34,7 @@
{
"enabled":1,
"version_min":300000,
"title":"Testing CtlRuleRemoteTargetById (2)",
"title":"Testing CtlRuleRemoveTargetById (2)",
"expected":{
"debug_log": "Target value: .*Variable: ARGS:pwd"
},
@@ -62,5 +62,37 @@
"SecRule REQUEST_FILENAME \"@endsWith /wp-login.php\" \"id:9002100,phase:2,t:none,nolog,pass,ctl:ruleRemoveTargetById=123;ARGS:pwd\"",
"SecRule ARGS \"@contais whe\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS2'\""
]
},
{
"enabled":1,
"version_min":300000,
"title":"Testing CtlRuleRemoveTargetById (3)",
"expected":{
"debug_log": "Variable: ARGS was excluded by ruleRemoveTargetById..."
},
"client":{
"ip":"200.249.12.31",
"port":123
},
"request":{
"headers":{
"Host":"localhost",
"User-Agent":"curl/7.38.0",
"Accept":"*/*",
"Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120",
"Content-Type": "text/xml"
},
"uri":"/wp-login.php?whee&pwd=lhebs",
"method":"GET",
"body": [ ]
},
"server":{
"ip":"200.249.12.31",
"port":80
},
"rules":[
"SecRule REQUEST_FILENAME \"@endsWith /wp-login.php\" \"id:9002100,phase:2,t:none,nolog,pass,ctl:ruleRemoveTargetById=1;ARGS\"",
"SecRule ARGS \"@contais whe\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS'\""
]
}
]

View File

@@ -62,5 +62,37 @@
"SecRule REQUEST_FILENAME \"@endsWith /wp-login.php\" \"id:9002100,phase:2,t:none,nolog,pass,ctl:ruleRemoveTargetByTag=CRS;ARGS:pwd\"",
"SecRule ARGS \"@contais whe\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS2'\""
]
},
{
"enabled":1,
"version_min":300000,
"title":"Testing CtlRuleRemoteTargetByTag (3)",
"expected":{
"debug_log": "Target value: .*Variable: ARGS:pwd"
},
"client":{
"ip":"200.249.12.31",
"port":123
},
"request":{
"headers":{
"Host":"localhost",
"User-Agent":"curl/7.38.0",
"Accept":"*/*",
"Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120",
"Content-Type": "text/xml"
},
"uri":"/wp-login.php?whee&pwd=lhebs",
"method":"GET",
"body": [ ]
},
"server":{
"ip":"200.249.12.31",
"port":80
},
"rules":[
"SecRule REQUEST_FILENAME \"@endsWith /wp-login.php\" \"id:9002100,phase:2,t:none,nolog,pass,ctl:ruleRemoveTargetByTag=CRS;ARGS\"",
"SecRule ARGS \"@contais whe\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS2'\""
]
}
]