mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
136 lines
3.4 KiB
JSON
136 lines
3.4 KiB
JSON
[
|
|
{
|
|
"enabled":1,
|
|
"version_min":300000,
|
|
"title":"Testing Operator :: @ipMatchFromFile",
|
|
"client":{
|
|
"ip":"200.249.12.31",
|
|
"port":123
|
|
},
|
|
"server":{
|
|
"ip":"200.249.12.31",
|
|
"port":80
|
|
},
|
|
"request":{
|
|
"headers":{
|
|
"Host":"localhost",
|
|
"User-Agent":"curl/7.38.0",
|
|
"Accept":"*/*",
|
|
"Content-Length": "27",
|
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
},
|
|
"uri":"/",
|
|
"method":"POST",
|
|
"body": [
|
|
"param1=value1¶m2=value2"
|
|
]
|
|
},
|
|
"response":{
|
|
"headers":{
|
|
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
|
|
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
|
|
"Content-Type":"text/html"
|
|
},
|
|
"body":[
|
|
"no need."
|
|
]
|
|
},
|
|
"expected":{
|
|
"debug_log":"Rule returned 1"
|
|
},
|
|
"rules":[
|
|
"SecRuleEngine On",
|
|
"SecRule REMOTE_ADDR \"@ipMatchFromFile test-cases\/data\/ipMatchFromFile.txt\" \"id:1,phase:3,pass,t:trim\""
|
|
]
|
|
},
|
|
{
|
|
"enabled":1,
|
|
"version_min":300000,
|
|
"title":"Testing Operator :: @ipMatchFromFile - file not found",
|
|
"client":{
|
|
"ip":"200.249.12.31",
|
|
"port":123
|
|
},
|
|
"server":{
|
|
"ip":"200.249.12.31",
|
|
"port":80
|
|
},
|
|
"request":{
|
|
"headers":{
|
|
"Host":"localhost",
|
|
"User-Agent":"curl/7.38.0",
|
|
"Accept":"*/*",
|
|
"Content-Length": "27",
|
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
},
|
|
"uri":"/",
|
|
"method":"POST",
|
|
"body": [
|
|
"param1=value1¶m2=value2"
|
|
]
|
|
},
|
|
"response":{
|
|
"headers":{
|
|
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
|
|
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
|
|
"Content-Type":"text/html"
|
|
},
|
|
"body":[
|
|
"no need."
|
|
]
|
|
},
|
|
"expected":{
|
|
"parser_error":"Rules error. File: operator-ipMatchFromFile.json. Line: 2. Column: 19. Looking at: 'file-not-found.txt', 'file-not-found.txt', 'operator-ipMatchFromFile.json/file-not-found.txt', 'operator-ipMatchFromFile.json/file-not-found.txt'."
|
|
},
|
|
"rules":[
|
|
"SecRuleEngine On",
|
|
"SecRule REMOTE_ADDR \"@ipMatchFromFile file-not-found.txt\" \"id:1,phase:3,pass,t:trim\""
|
|
]
|
|
},
|
|
{
|
|
"enabled":1,
|
|
"version_min":300000,
|
|
"resource": "curl",
|
|
"title":"Testing Operator :: @ipMatchFromFile - https",
|
|
"client":{
|
|
"ip":"8.8.4.4",
|
|
"port":123
|
|
},
|
|
"server":{
|
|
"ip":"200.249.12.31",
|
|
"port":80
|
|
},
|
|
"request":{
|
|
"headers":{
|
|
"Host":"localhost",
|
|
"User-Agent":"curl/7.38.0",
|
|
"Accept":"*/*",
|
|
"Content-Length": "27",
|
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
},
|
|
"uri":"/",
|
|
"method":"POST",
|
|
"body": [
|
|
"param1=value1¶m2=value2"
|
|
]
|
|
},
|
|
"response":{
|
|
"headers":{
|
|
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
|
|
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
|
|
"Content-Type":"text/html"
|
|
},
|
|
"body":[
|
|
"no need."
|
|
]
|
|
},
|
|
"expected":{
|
|
"debug_log":"Rule returned 1."
|
|
},
|
|
"rules":[
|
|
"SecRuleEngine On",
|
|
"SecRule REMOTE_ADDR \"@ipMatchFromFile https://gist.githubusercontent.com/martinhsv/20705a36b7cfa8ff6d0dee0d4efce7e7/raw/b9321f190eb0e81b98cb65a56db3d7e0a4f59314/modsecurity-regression-ip-list.txt\" \"id:1,phase:3,pass,t:trim\""
|
|
]
|
|
}
|
|
]
|