1[
2  {
3    "enabled":1,
4    "version_min":300000,
5    "title":"Testing Operator :: @ipMatchFromFile",
6    "client":{
7      "ip":"200.249.12.31",
8      "port":123
9    },
10    "server":{
11      "ip":"200.249.12.31",
12      "port":80
13    },
14    "request":{
15      "headers":{
16        "Host":"localhost",
17        "User-Agent":"curl/7.38.0",
18        "Accept":"*/*",
19        "Content-Length": "27",
20        "Content-Type": "application/x-www-form-urlencoded"
21      },
22      "uri":"/",
23      "method":"POST",
24      "body": [
25        "param1=value1&param2=value2"
26      ]
27    },
28    "response":{
29      "headers":{
30        "Date":"Mon, 13 Jul 2015 20:02:41 GMT",
31        "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
32        "Content-Type":"text/html"
33      },
34      "body":[
35        "no need."
36      ]
37    },
38    "expected":{
39      "debug_log":"Rule returned 1"
40    },
41    "rules":[
42      "SecRuleEngine On",
43      "SecRule REMOTE_ADDR \"@ipMatchFromFile test-cases\/data\/ipMatchFromFile.txt\" \"id:1,phase:3,pass,t:trim\""
44    ]
45  },
46  {
47    "enabled":1,
48    "version_min":300000,
49    "title":"Testing Operator :: @ipMatchFromFile - file not found",
50    "client":{
51      "ip":"200.249.12.31",
52      "port":123
53    },
54    "server":{
55      "ip":"200.249.12.31",
56      "port":80
57    },
58    "request":{
59      "headers":{
60        "Host":"localhost",
61        "User-Agent":"curl/7.38.0",
62        "Accept":"*/*",
63        "Content-Length": "27",
64        "Content-Type": "application/x-www-form-urlencoded"
65      },
66      "uri":"/",
67      "method":"POST",
68      "body": [
69        "param1=value1&param2=value2"
70      ]
71    },
72    "response":{
73      "headers":{
74        "Date":"Mon, 13 Jul 2015 20:02:41 GMT",
75        "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
76        "Content-Type":"text/html"
77      },
78      "body":[
79        "no need."
80      ]
81    },
82    "expected":{
83      "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'."
84    },
85    "rules":[
86      "SecRuleEngine On",
87      "SecRule REMOTE_ADDR \"@ipMatchFromFile file-not-found.txt\" \"id:1,phase:3,pass,t:trim\""
88    ]
89  },
90  {
91    "enabled":1,
92    "version_min":300000,
93    "resource": "curl",
94    "title":"Testing Operator :: @ipMatchFromFile - https",
95    "client":{
96      "ip":"8.8.4.4",
97      "port":123
98    },
99    "server":{
100      "ip":"200.249.12.31",
101      "port":80
102    },
103    "request":{
104      "headers":{
105        "Host":"localhost",
106        "User-Agent":"curl/7.38.0",
107        "Accept":"*/*",
108        "Content-Length": "27",
109        "Content-Type": "application/x-www-form-urlencoded"
110      },
111      "uri":"/",
112      "method":"POST",
113      "body": [
114        "param1=value1&param2=value2"
115      ]
116    },
117    "response":{
118      "headers":{
119        "Date":"Mon, 13 Jul 2015 20:02:41 GMT",
120        "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
121        "Content-Type":"text/html"
122      },
123      "body":[
124        "no need."
125      ]
126    },
127    "expected":{
128      "debug_log":"Rule returned 1."
129    },
130    "rules":[
131      "SecRuleEngine On",
132      "SecRule REMOTE_ADDR \"@ipMatchFromFile https://www.modsecurity.org/modsecurity-regression-test.txt\" \"id:1,phase:3,pass,t:trim\""
133    ]
134  }
135]
136