Skip to content

Commit 4e4f329

Browse files
author
Marc Stern
authored
Merge pull request #3080 from airween/v3/testfixes
test: Logical, syntax and cosmetic fixes on test cases
2 parents ca5f516 + 16c899f commit 4e4f329

7 files changed

+18
-18
lines changed

test/test-cases/regression/action-ctl_rule_remove_by_id.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120",
1919
"Content-Type": "text/xml"
2020
},
21-
"uri":"/wp-login.php?whee&pwd=lhebs",
21+
"uri":"/wp-login.php?whee=something&pwd=lhebs",
2222
"method":"GET",
2323
"body": [ ]
2424
},
@@ -28,15 +28,15 @@
2828
},
2929
"rules":[
3030
"SecRule REQUEST_FILENAME \"@endsWith /wp-login.php\" \"id:9002100,phase:2,t:none,nolog,pass,ctl:ruleRemoveById=1\"",
31-
"SecRule ARGS \"@contais whe\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS'\""
31+
"SecRule ARGS_NAMES \"@contains whee\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS'\""
3232
]
3333
},
3434
{
3535
"enabled":1,
3636
"version_min":300000,
3737
"title":"Testing CtlRuleRemoteById (2)",
3838
"expected":{
39-
"debug_log": "Target value: .*Variable: ARGS:pwd"
39+
"debug_log": "Target value: .*Variable: ARGS_NAMES:whee"
4040
},
4141
"client":{
4242
"ip":"200.249.12.31",
@@ -50,7 +50,7 @@
5050
"Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120",
5151
"Content-Type": "text/xml"
5252
},
53-
"uri":"/wp-login.php?whee&pwd=lhebs",
53+
"uri":"/wp-login.php?whee=something&pwd=lhebs",
5454
"method":"GET",
5555
"body": [ ]
5656
},
@@ -60,7 +60,7 @@
6060
},
6161
"rules":[
6262
"SecRule REQUEST_FILENAME \"@endsWith /wp-login.php\" \"id:9002100,phase:2,t:none,nolog,pass,ctl:ruleRemoveById=123\"",
63-
"SecRule ARGS \"@contais whe\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS2'\""
63+
"SecRule ARGS_NAMES \"@contains whee\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS2'\""
6464
]
6565
}
6666
]

test/test-cases/regression/action-ctl_rule_remove_by_tag.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"debug_log":"Skipped rule id '2'. Skipped due to a ruleRemoveByTag action."
3535
},
3636
"rules":[
37-
"SecRule ARGS:key \".\" \"id:4,ctl:ruleRemoveByTag=tag123",
37+
"SecRule ARGS:key \".\" \"id:4,ctl:ruleRemoveByTag=tag123\"",
3838
"SecRule ARGS \"@contains test1\" \"id:1,pass,t:trim\"",
3939
"SecRule ARGS \"@contains test2\" \"id:2,pass,t:trim,tag:tag123\"",
4040
"SecRule ARGS \"@contains test3\" \"id:3,pass,t:trim\""

test/test-cases/regression/action-ctl_rule_remove_target_by_id.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"version_min":300000,
3838
"title":"Testing CtlRuleRemoveTargetById (2)",
3939
"expected":{
40-
"debug_log": "Target value: .*Variable: ARGS:pwd"
40+
"debug_log": "Target value: .*Variable: ARGS_NAMES:whee"
4141
},
4242
"client":{
4343
"ip":"200.249.12.31",
@@ -51,7 +51,7 @@
5151
"Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120",
5252
"Content-Type": "text/xml"
5353
},
54-
"uri":"/wp-login.php?whee&pwd=lhebs",
54+
"uri":"/wp-login.php?whee=something&pwd=lhebs",
5555
"method":"GET",
5656
"body": [ ]
5757
},
@@ -61,7 +61,7 @@
6161
},
6262
"rules":[
6363
"SecRule REQUEST_FILENAME \"@endsWith /wp-login.php\" \"id:9002100,phase:2,t:none,nolog,pass,ctl:ruleRemoveTargetById=123;ARGS:pwd\"",
64-
"SecRule ARGS \"@contais whe\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS2'\""
64+
"SecRule ARGS_NAMES \"@contains whee\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS2'\""
6565
]
6666
},
6767
{
@@ -83,7 +83,7 @@
8383
"Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120",
8484
"Content-Type": "text/xml"
8585
},
86-
"uri":"/wp-login.php?whee&pwd=lhebs",
86+
"uri":"/wp-login.php?whee=something&pwd=lhebs",
8787
"method":"GET",
8888
"body": [ ]
8989
},

test/test-cases/regression/action-ctl_rule_remove_target_by_tag.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"version_min":300000,
3838
"title":"Testing CtlRuleRemoteTargetByTag (2)",
3939
"expected":{
40-
"debug_log": "Target value: .*Variable: ARGS:pwd"
40+
"debug_log": "Target value: .*Variable: ARGS_NAMES:pwd"
4141
},
4242
"client":{
4343
"ip":"200.249.12.31",
@@ -61,15 +61,15 @@
6161
},
6262
"rules":[
6363
"SecRule REQUEST_FILENAME \"@endsWith /wp-login.php\" \"id:9002100,phase:2,t:none,nolog,pass,ctl:ruleRemoveTargetByTag=CRS;ARGS:pwd\"",
64-
"SecRule ARGS \"@contais whe\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS2'\""
64+
"SecRule ARGS_NAMES \"@contains pwd\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS2'\""
6565
]
6666
},
6767
{
6868
"enabled":1,
6969
"version_min":300000,
7070
"title":"Testing CtlRuleRemoteTargetByTag (3)",
7171
"expected":{
72-
"debug_log": "Target value: .*Variable: ARGS:pwd"
72+
"debug_log": "Target value: .*Variable: ARGS_NAMES:whee"
7373
},
7474
"client":{
7575
"ip":"200.249.12.31",
@@ -83,7 +83,7 @@
8383
"Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120",
8484
"Content-Type": "text/xml"
8585
},
86-
"uri":"/wp-login.php?whee&pwd=lhebs",
86+
"uri":"/wp-login.php?whee=something&pwd=lhebs",
8787
"method":"GET",
8888
"body": [ ]
8989
},
@@ -93,7 +93,7 @@
9393
},
9494
"rules":[
9595
"SecRule REQUEST_FILENAME \"@endsWith /wp-login.php\" \"id:9002100,phase:2,t:none,nolog,pass,ctl:ruleRemoveTargetByTag=CRS;ARGS\"",
96-
"SecRule ARGS \"@contais whe\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS2'\""
96+
"SecRule ARGS_NAMES \"@contains whee\" \"id:1,phase:3,t:none,nolog,pass,tag:'CRS2'\""
9797
]
9898
}
9999
]

test/test-cases/regression/issue-1850.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"rules": [
4545
"SecRuleEngine On",
4646
"SecDefaultAction \"phase:1,status:404,deny\"",
47-
"SecRule REQUEST_URI \"@contains /\" \"id:2000001,phase:1,log,redirect:'http://1.1.1.1/failed.html',t:none,msg:\"Unauthorized administrator request'\""
47+
"SecRule REQUEST_URI \"@contains /\" \"id:2000001,phase:1,log,redirect:'http://1.1.1.1/failed.html',t:none,msg:'Unauthorized administrator request'\""
4848
]
4949
}
5050
]

test/test-cases/regression/misc-variable-under-quotes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"debug_log":"t:lowercase:"
3535
},
3636
"rules":[
37-
"SecRule \"REQUEST_LINE\" \"@contains index.php/admin/cms/wysiwyg/directive/\" \"id:1,t:lowercase,ctl:auditLogParts=+E\""
37+
"SecRule \"REQUEST_LINE\" \"@contains index.php/admin/cms/wysiwyg/directive/\" \"id:1,phase:1,t:lowercase,ctl:auditLogParts=+E\""
3838
]
3939
},
4040
{

test/test-cases/regression/rule-920200.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"Accept-Language":"en-us,en;q=0.5",
1919
"Accept":"*/*",
2020
"Keep-Alive":"300",
21-
"Range": "bytes=1-10,11-20,21-30,31-40,41-50,51-60"
21+
"Range": "bytes=1-10,11-20,21-30,31-40,41-50,51-60"
2222
},
2323
"uri":"/",
2424
"method":"GET"

0 commit comments

Comments
 (0)