|
2 | 2 | {
|
3 | 3 | "enabled":1,
|
4 | 4 | "version_min":300000,
|
5 |
| - "title":"Testing JSON request body parser 1/1", |
| 5 | + "title":"Testing JSON request body parser 1/2", |
6 | 6 | "expected":{
|
7 | 7 | "debug_log": "Target value: \"bar\" \\(Variable: ARGS:json.foo\\)"
|
8 | 8 | },
|
|
41 | 41 | {
|
42 | 42 | "enabled":1,
|
43 | 43 | "version_min":300000,
|
44 |
| - "title":"Testing JSON request body parser 1/1", |
| 44 | + "title":"Testing JSON request body parser 2/2", |
45 | 45 | "expected":{
|
46 | 46 | "debug_log": "Target value: \"bar\" \\(Variable: ARGS:json.first_level.first_key\\)"
|
47 | 47 | },
|
|
79 | 79 | "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"",
|
80 | 80 | "SecRule ARGS \"bar\" \"id:'200441',phase:3,log\""
|
81 | 81 | ]
|
| 82 | + }, |
| 83 | + { |
| 84 | + "enabled":1, |
| 85 | + "version_min":300000, |
| 86 | + "title":"Testing JSON request body parser - issue #1822 (1/2)", |
| 87 | + "expected":{ |
| 88 | + "debug_log": "Target value: \"0\" .Variable: REQBODY_ERROR." |
| 89 | + }, |
| 90 | + "client":{ |
| 91 | + "ip":"200.249.12.31", |
| 92 | + "port":123 |
| 93 | + }, |
| 94 | + "request":{ |
| 95 | + "headers":{ |
| 96 | + "Host":"localhost", |
| 97 | + "User-Agent":"curl/7.38.0", |
| 98 | + "Accept":"*/*", |
| 99 | + "Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120", |
| 100 | + "Content-Type": "application/json" |
| 101 | + }, |
| 102 | + "uri":"/?key=value&key=other_value", |
| 103 | + "method":"POST", |
| 104 | + "body": [ |
| 105 | + ] |
| 106 | + }, |
| 107 | + "server":{ |
| 108 | + "ip":"200.249.12.31", |
| 109 | + "port":80 |
| 110 | + }, |
| 111 | + "rules":[ |
| 112 | + "SecRuleEngine On", |
| 113 | + "SecRequestBodyAccess On", |
| 114 | + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", |
| 115 | + "SecRule REQBODY_ERROR \"0\" \"id:'200441',phase:3,log\"" |
| 116 | + ] |
| 117 | + }, |
| 118 | + { |
| 119 | + "enabled":1, |
| 120 | + "version_min":300000, |
| 121 | + "title":"Testing JSON request body parser - issue #1822 (2/2)", |
| 122 | + "expected":{ |
| 123 | + "debug_log": "Target value: \"1\" .Variable: REQBODY_ERROR." |
| 124 | + }, |
| 125 | + "client":{ |
| 126 | + "ip":"200.249.12.31", |
| 127 | + "port":123 |
| 128 | + }, |
| 129 | + "request":{ |
| 130 | + "headers":{ |
| 131 | + "Host":"localhost", |
| 132 | + "User-Agent":"curl/7.38.0", |
| 133 | + "Accept":"*/*", |
| 134 | + "Cookie": "PHPSESSID=rAAAAAAA2t5uvjq435r4q7ib3vtdjq120", |
| 135 | + "Content-Type": "application/json" |
| 136 | + }, |
| 137 | + "uri":"/?key=value&key=other_value", |
| 138 | + "method":"POST", |
| 139 | + "body": [ |
| 140 | + "a" |
| 141 | + ] |
| 142 | + }, |
| 143 | + "server":{ |
| 144 | + "ip":"200.249.12.31", |
| 145 | + "port":80 |
| 146 | + }, |
| 147 | + "rules":[ |
| 148 | + "SecRuleEngine On", |
| 149 | + "SecRequestBodyAccess On", |
| 150 | + "SecRule REQUEST_HEADERS:Content-Type \"application/json\" \"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON\"", |
| 151 | + "SecRule REQBODY_ERROR \"0\" \"id:'200441',phase:3,log\"" |
| 152 | + ] |
82 | 153 | }
|
83 | 154 | ]
|
84 | 155 |
|
0 commit comments