1[
2  {
3    "enabled":1,
4    "version_min":300000,
5    "title":"Testing Variables :: REQBODY_PROCESSOR (1/3)",
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-Type": "text/xml"
20      },
21      "uri":"/?key=value&key=other_value",
22      "http_version":1.1,
23      "method":"POST",
24      "body": [
25        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
26        "<bookstore>",
27        "<book category=\"COOKING\">",
28          "<title lang=\"en\">Everyday Italian</title>",
29          "<author>Giada De Laurentiis</author>",
30          "<year>2005</year>",
31          "<price>30.00</price>",
32        "</book>",
33
34        "<book category=\"CHILDREN\">",
35          "<title lang=\"en\">Harry Potter</title>",
36          "<author>J K. Rowling</author>",
37          "<year>2005</year>",
38          "<price>29.99</price>",
39        "</book>",
40
41        "<book category=\"WEB\">",
42          "<title lang=\"en\">XQuery Kick Start</title>",
43          "<author>James McGovern</author>",
44          "<author>Per Bothner</author>",
45          "<author>Kurt Cagle</author>",
46          "<author>James Linn</author>",
47          "<author>Vaidyanathan Nagarajan</author>",
48          "<year>2003</year>",
49          "<price>49.99</price>",
50        "</book>",
51
52        "<book category=\"WEB\">",
53          "<title lang=\"en\">Learning XML</title>",
54          "<author>Erik T. Ray</author>",
55          "<year>2003</year>",
56          "<price>39.95</price>",
57        "</book>",
58        "</bookstore>"
59      ]
60    },
61    "response":{
62      "headers":{
63        "Date":"Mon, 13 Jul 2015 20:02:41 GMT",
64        "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
65        "Content-Type":"text/html"
66      },
67      "body":[
68        "no need."
69      ]
70    },
71    "expected":{
72      "debug_log":"Target value: \"XML\" \\(Variable: REQBODY_PROCESSOR\\)"
73    },
74    "rules":[
75      "SecRuleEngine On",
76      "SecRule REQUEST_HEADERS:Content-Type \"^text/xml$\" \"id:500005,phase:1,t:none,t:lowercase,nolog,pass,ctl:requestBodyProcessor=XML\"",
77      "SecRule REQBODY_PROCESSOR \"@contains test\" \"id:1,pass,phase:2,t:trim\""
78    ]
79  },
80  {
81    "enabled":1,
82    "version_min":300000,
83    "title":"Testing Variables :: REQBODY_PROCESSOR (2/3)",
84    "client":{
85      "ip":"200.249.12.31",
86      "port":123
87    },
88    "server":{
89      "ip":"200.249.12.31",
90      "port":80
91    },
92    "request":{
93      "headers":{
94        "Host":"localhost",
95        "User-Agent":"curl/7.38.0",
96        "Accept":"*/*",
97        "Content-Type": "multipart/form-data; boundary=--------------------------756b6d74fa1a8ee2"
98      },
99      "uri":"/?key=value&key=other_value",
100      "http_version":1.1,
101      "method":"POST",
102      "body": [
103        "--------------------------756b6d74fa1a8ee2",
104        "Content-Disposition: form-data; name=\"name\"",
105        "",
106        "test",
107        "--------------------------756b6d74fa1a8ee2",
108        "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"",
109        "Content-Type: text/plain",
110        "",
111        "This is a very small test file..",
112        "--------------------------756b6d74fa1a8ee2",
113        "Content-Disposition: form-data; name=\"filedata\"; filename=\"small_text_file.txt\"",
114        "Content-Type: text/plain",
115        "",
116        "This is another very small test file..",
117        "--------------------------756b6d74fa1a8ee2--"
118      ]
119    },
120    "response":{
121      "headers":{
122        "Date":"Mon, 13 Jul 2015 20:02:41 GMT",
123        "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
124        "Content-Type":"text/html"
125      },
126      "body":[
127        "no need."
128      ]
129    },
130    "expected":{
131      "debug_log":"Target value: \"MULTIPART\" \\(Variable: REQBODY_PROCESSOR\\)"
132    },
133    "rules":[
134      "SecRuleEngine On",
135      "SecRule REQBODY_PROCESSOR \"@contains test\" \"id:1,pass,t:trim\""
136    ]
137  },
138  {
139    "enabled":1,
140    "version_min":300000,
141    "title":"Testing Variables :: REQBODY_PROCESSOR (3/3)",
142    "client":{
143      "ip":"200.249.12.31",
144      "port":123
145    },
146    "server":{
147      "ip":"200.249.12.31",
148      "port":80
149    },
150    "request":{
151      "headers":{
152        "Host":"localhost",
153        "User-Agent":"curl/7.38.0",
154        "Accept":"*/*",
155        "Content-Type": "application/x-www-form-urlencoded"
156      },
157      "uri":"/?key=value&key=other_value",
158      "http_version":1.1,
159      "method":"POST",
160      "body": [
161        "param1=value1&param2=value2"
162      ]
163    },
164    "response":{
165      "headers":{
166        "Date":"Mon, 13 Jul 2015 20:02:41 GMT",
167        "Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
168        "Content-Type":"text/html"
169      },
170      "body":[
171        "no need."
172      ]
173    },
174    "expected":{
175      "debug_log":"Target value: \"URLENCODED\" \\(Variable: REQBODY_PROCESSOR\\)"
176    },
177    "rules":[
178      "SecRuleEngine On",
179      "SecRule REQBODY_PROCESSOR \"@contains test\" \"id:1,pass,t:trim\""
180    ]
181  }
182]
183
184