mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Fix disruptive actions execution
This commit is contained in:
74
test/test-cases/regression/action-disruptive.json
Normal file
74
test/test-cases/regression/action-disruptive.json
Normal file
@@ -0,0 +1,74 @@
|
||||
[
|
||||
{
|
||||
"enabled":1,
|
||||
"version_min":300000,
|
||||
"title":"Testing Disruptive actions (1/n)",
|
||||
"expected":{
|
||||
"debug_log": " Running action: deny",
|
||||
"http_code":403
|
||||
},
|
||||
"rules":[
|
||||
"SecRuleEngine On",
|
||||
"SecDebugLog \/tmp\/modsec_debug.log",
|
||||
"SecDefaultAction \"phase:2,deny,status:404\"",
|
||||
"SecAction \"id:'900001',phase:request,nolog,status:403,t:none\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"enabled":1,
|
||||
"version_min":300000,
|
||||
"title":"Testing Disruptive actions (2/n)",
|
||||
"expected":{
|
||||
"debug_log": " Running action: deny",
|
||||
"http_code":404
|
||||
},
|
||||
"rules":[
|
||||
"SecRuleEngine On",
|
||||
"SecDebugLog \/tmp\/modsec_debug.log",
|
||||
"SecDefaultAction \"phase:2,deny,status:404\"",
|
||||
"SecAction \"'id:'1',phase:request,nolog,t:none\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"enabled":1,
|
||||
"version_min":300000,
|
||||
"title":"Testing Disruptive actions (3/n)",
|
||||
"expected":{
|
||||
"debug_log": " Running action: deny",
|
||||
"http_code":404
|
||||
},
|
||||
"rules":[
|
||||
"SecRuleEngine On",
|
||||
"SecDebugLog \/tmp\/modsec_debug.log",
|
||||
"SecDefaultAction \"phase:2,deny,status:404\"",
|
||||
"SecAction \"id:'1',phase:request,nolog,block,t:none\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"enabled":1,
|
||||
"version_min":300000,
|
||||
"title":"Testing Disruptive actions (4/n)",
|
||||
"expected":{
|
||||
"http_code":200
|
||||
},
|
||||
"rules":[
|
||||
"SecRuleEngine On",
|
||||
"SecDebugLog \/tmp\/modsec_debug.log",
|
||||
"SecAction \"id:'1',phase:request,nolog,t:none\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"enabled":1,
|
||||
"version_min":300000,
|
||||
"title":"Testing Disruptive actions (5/n)",
|
||||
"expected":{
|
||||
"http_code":200
|
||||
},
|
||||
"rules":[
|
||||
"SecRuleEngine On",
|
||||
"SecDebugLog \/tmp\/modsec_debug.log",
|
||||
"SecDefaultAction \"phase:2,deny,status:404\"",
|
||||
"SecAction \"id:'1',phase:request,nolog,pass,t:none\""
|
||||
]
|
||||
}
|
||||
]
|
@@ -3,7 +3,7 @@
|
||||
"enabled": 1,
|
||||
"version_min": 300000,
|
||||
"version_max": 0,
|
||||
"title": "actions :: trim,block",
|
||||
"title": "actions :: trim,deny",
|
||||
"client": {
|
||||
"ip": "200.249.12.31",
|
||||
"port": 2313
|
||||
@@ -57,7 +57,7 @@
|
||||
"SecRuleEngine On",
|
||||
"SecDebugLog \/tmp\/modsec_debug.log",
|
||||
"SecDebugLogLevel 9",
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,block\""
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,deny\""
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@@ -48,7 +48,7 @@
|
||||
"SecRuleEngine On",
|
||||
"SecDebugLog \/tmp\/modsec_debug.log",
|
||||
"SecDebugLogLevel 9",
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,block,auditlog\"",
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,deny,auditlog\"",
|
||||
"SecAuditEngine RelevantOnly",
|
||||
"SecAuditLogParts ABCFHZ",
|
||||
"SecAuditLogStorageDir /tmp/test",
|
||||
@@ -107,7 +107,7 @@
|
||||
"SecRuleEngine On",
|
||||
"SecDebugLog \/tmp\/modsec_debug.log",
|
||||
"SecDebugLogLevel 9",
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,block,auditlog\"",
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,deny,auditlog\"",
|
||||
"SecAuditEngine RelevantOnly",
|
||||
"SecAuditLogParts ABCFHZ",
|
||||
"SecAuditLogStorageDir /tmp/test",
|
||||
@@ -167,7 +167,7 @@
|
||||
"SecRuleEngine On",
|
||||
"SecDebugLog \/tmp\/modsec_debug.log",
|
||||
"SecDebugLogLevel 9",
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,block,auditlog\"",
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,deny,auditlog\"",
|
||||
"SecAuditEngine RelevantOnly",
|
||||
"SecAuditLogParts ABCFHZ",
|
||||
"SecAuditLogStorageDir /tmp/test",
|
||||
|
@@ -49,7 +49,7 @@
|
||||
"SecDebugLog \/tmp\/modsec_debug.log",
|
||||
"SecDebugLogLevel 9",
|
||||
"SecComponentSignature \"OWASP_CRS/2.2.9\"",
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,block,auditlog\""
|
||||
"SecRule ARGS \"@contains test\" \"id:1,t:trim,deny,status:403,auditlog\""
|
||||
]
|
||||
}
|
||||
]
|
Reference in New Issue
Block a user