mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds support to the allow action
This commit is contained in:
101
test/test-cases/regression/action-allow.json
Normal file
101
test/test-cases/regression/action-allow.json
Normal file
@@ -0,0 +1,101 @@
|
||||
[
|
||||
{
|
||||
"enabled":1,
|
||||
"version_min":300000,
|
||||
"title":"Testing allow action 1/3",
|
||||
"expected":{
|
||||
"debug_log": "Skipped rule id '500066' as request trough the utilization of an `allow' action",
|
||||
"http_code": 200
|
||||
},
|
||||
"client":{
|
||||
"ip":"200.249.12.31",
|
||||
"port":123
|
||||
},
|
||||
"request":{
|
||||
"headers":{
|
||||
"Host":"localhost",
|
||||
"User-Agent":"curl/7.38.0",
|
||||
"Accept":"*/*",
|
||||
"User-Agent":"My sweet little browser",
|
||||
"Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120"
|
||||
},
|
||||
"uri":"/?key=value&key=other_value",
|
||||
"method":"GET"
|
||||
},
|
||||
"server":{
|
||||
"ip":"200.249.12.31",
|
||||
"port":80
|
||||
},
|
||||
"rules":[
|
||||
"SecRuleEngine On",
|
||||
"SecAction \"phase:1,allow,msg:'ALLOWED',id:500065\"",
|
||||
"SecAction \"phase:1,deny,msg:'DENIED',id:500066\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"enabled":1,
|
||||
"version_min":300000,
|
||||
"title":"Testing allow action 1/3",
|
||||
"expected":{
|
||||
"debug_log": "",
|
||||
"http_code": 500
|
||||
},
|
||||
"client":{
|
||||
"ip":"200.249.12.31",
|
||||
"port":123
|
||||
},
|
||||
"request":{
|
||||
"headers":{
|
||||
"Host":"localhost",
|
||||
"User-Agent":"curl/7.38.0",
|
||||
"Accept":"*/*",
|
||||
"User-Agent":"My sweet little browser",
|
||||
"Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120"
|
||||
},
|
||||
"uri":"/?key=value&key=other_value",
|
||||
"method":"GET"
|
||||
},
|
||||
"server":{
|
||||
"ip":"200.249.12.31",
|
||||
"port":80
|
||||
},
|
||||
"rules":[
|
||||
"SecRuleEngine On",
|
||||
"SecAction \"phase:1,allow:request,msg:'ALLOWED',id:500065\"",
|
||||
"SecRule ARGS \"@contains value\" \"id:1,t:trim,status:500,deny,phase:3\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"enabled":1,
|
||||
"version_min":300000,
|
||||
"title":"Testing allow action 1/3",
|
||||
"expected":{
|
||||
"debug_log": "",
|
||||
"http_code": 500
|
||||
},
|
||||
"client":{
|
||||
"ip":"200.249.12.31",
|
||||
"port":123
|
||||
},
|
||||
"request":{
|
||||
"headers":{
|
||||
"Host":"localhost",
|
||||
"User-Agent":"curl/7.38.0",
|
||||
"Accept":"*/*",
|
||||
"User-Agent":"My sweet little browser",
|
||||
"Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120"
|
||||
},
|
||||
"uri":"/?key=value&key=other_value",
|
||||
"method":"GET"
|
||||
},
|
||||
"server":{
|
||||
"ip":"200.249.12.31",
|
||||
"port":80
|
||||
},
|
||||
"rules":[
|
||||
"SecRuleEngine On",
|
||||
"SecAction \"phase:1,allow:phase,msg:'ALLOWED',id:500065\"",
|
||||
"SecRule ARGS \"@contains value\" \"id:1,t:trim,status:500,deny,phase:3\""
|
||||
]
|
||||
}
|
||||
]
|
@@ -4,7 +4,7 @@
|
||||
"version_min":300000,
|
||||
"title":"Testing skip action 1/3",
|
||||
"expected":{
|
||||
"debug_log": "\\[9\\] Skipped rule id \\'2\\' due to \\`skip\\' action."
|
||||
"debug_log": "\\[9\\] Skipped rule id \\'2\\' due to a \\`skip\\' action."
|
||||
},
|
||||
"client":{
|
||||
"ip":"200.249.12.31",
|
||||
@@ -74,7 +74,7 @@
|
||||
"version_min":300000,
|
||||
"title":"Testing skip action 3/3",
|
||||
"expected":{
|
||||
"debug_log": "\\[9\\] Skipped rule id \\'3\\' due to \\`skip\\' action."
|
||||
"debug_log": "\\[9\\] Skipped rule id \\'3\\' due to a \\`skip\\' action."
|
||||
},
|
||||
"client":{
|
||||
"ip":"200.249.12.31",
|
||||
|
Reference in New Issue
Block a user