Refactoring on the Rule class

This commit is contained in:
Felipe Zimmerle
2018-09-28 10:28:02 -03:00
parent 74841779f8
commit 554251bade
17 changed files with 474 additions and 630 deletions

View File

@@ -4,7 +4,7 @@
"version_min":300000,
"title":"Testing CtlRuleRemoveTargetById (1)",
"expected":{
"debug_log": "Variable: ARGS:pwd was excluded by ruleRemoveTargetById..."
"http_code": 200
},
"client":{
"ip":"200.249.12.31",
@@ -27,8 +27,9 @@
"port":80
},
"rules":[
"SecRuleEngine On",
"SecRule REQUEST_FILENAME \"@endsWith /wp-login.php\" \"id:9002100,phase:2,t:none,nolog,pass,ctl:ruleRemoveTargetById=1;ARGS:pwd\"",
"SecRule ARGS \"@contais whe\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS'\""
"SecRule ARGS \"@contains lhebs\" \"id:1,phase:3,t:none,status:202,block,deny,tag:'CRS'\""
]
},
{
@@ -68,7 +69,7 @@
"version_min":300000,
"title":"Testing CtlRuleRemoveTargetById (3)",
"expected":{
"debug_log": "Variable: ARGS was excluded by ruleRemoveTargetById..."
"http_code": 200
},
"client":{
"ip":"200.249.12.31",
@@ -92,7 +93,7 @@
},
"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'\""
"SecRule ARGS \"@contains lhebs\" \"id:1,phase:3,t:none,status:202,block,deny,tag:'CRS'\""
]
}
]

View File

@@ -4,7 +4,7 @@
"version_min":300000,
"title":"Testing CtlRuleRemoteTargetByTag (1)",
"expected":{
"debug_log": "Variable: ARGS:pwd was excluded by ruleRemoteTargetByTag..."
"http_code": 200
},
"client":{
"ip":"200.249.12.31",
@@ -27,8 +27,9 @@
"port":80
},
"rules":[
"SecRuleEngine On",
"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:'CRS'\""
"SecRule ARGS \"@contains lhebs\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS',deny\""
]
},
{

View File

@@ -31,11 +31,11 @@
]
},
"expected":{
"debug_log":"ARGS:key is part of the exclusion list \\(from update by ID\\), skipping"
"http_code": 200
},
"rules":[
"SecRuleUpdateTargetById 1 !ARGS",
"SecRule ARGS \"@contains test\" \"id:1,pass,t:trim,tag:'test'\""
"SecRule ARGS \"@contains value\" \"id:1,pass,t:trim,tag:'test',deny\""
]
}
]

View File

@@ -31,11 +31,12 @@
]
},
"expected":{
"debug_log":"ARGS:key is part of the exclusion list \\(from update by msg\\), skipping"
"http_code": 200
},
"rules":[
"SecRuleEngine On",
"SecRuleUpdateTargetByMsg test !ARGS",
"SecRule ARGS \"@contains test\" \"id:1,pass,t:trim,msg:'test'\""
"SecRule ARGS \"@contains value\" \"id:1,pass,t:trim,msg:'test',deny\""
]
}
]

View File

@@ -31,11 +31,12 @@
]
},
"expected":{
"debug_log":"ARGS:key is part of the exclusion list \\(from update by tag\\), skipping"
"http_code": 200
},
"rules":[
"SecRuleEngine On",
"SecRuleUpdateTargetByTag test !ARGS",
"SecRule ARGS \"@contains test\" \"id:1,pass,t:trim,tag:'test'\""
"SecRule ARGS \"@contains value\" \"id:1,pass,t:trim,tag:'test',deny\""
]
}
]