From 6ab88472b106f50a744ae6ad481814dd2ae08d87 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Wed, 2 Sep 2015 18:50:19 -0300 Subject: [PATCH] Adds a simple regression test for the operator @rx --- test/test-cases/regression/operator-rx.json | 48 +++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 test/test-cases/regression/operator-rx.json diff --git a/test/test-cases/regression/operator-rx.json b/test/test-cases/regression/operator-rx.json new file mode 100644 index 00000000..8e864a49 --- /dev/null +++ b/test/test-cases/regression/operator-rx.json @@ -0,0 +1,48 @@ +[ + { + "enabled":1, + "version_min":300000, + "title":"Testing Operator :: @rx", + "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":"/", + "protocol":"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":"Executing operator \"@rx" + }, + "rules":[ + "SecRuleEngine On", + "SecDebugLog \/tmp\/modsec_debug.log", + "SecDebugLogLevel 9", + "SecRule ARGS \"@rx (value1)\" \"id:1,phase:2,pass,t:trim\"" + ] + } +] \ No newline at end of file