Imported Upstream version 2.5.11
[libapache-mod-security.git] / apache2 / t / regression / action / 10-ctl.t
1 ### ctl
2
3 ### ruleRemoveById
4 {
5         type => "action",
6         comment => "ruleRemoveById existing rule across phases",
7         conf => qq(
8                 SecRuleEngine On
9                 SecAction "phase:2,id:666,deny"
10                 SecAction "phase:1,pass,ctl:ruleRemoveById=666"
11         ),
12         match_log => {
13         },
14         match_response => {
15                 status => qr/^200$/,
16         },
17         request => new HTTP::Request(
18                 GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
19         ),
20 },
21 {
22         type => "action",
23         comment => "ruleRemoveById future rule across phases",
24         conf => qq(
25                 SecRuleEngine On
26                 SecAction "phase:1,pass,ctl:ruleRemoveById=666"
27                 SecAction "phase:2,id:666,deny"
28         ),
29         match_log => {
30         },
31         match_response => {
32                 status => qr/^200$/,
33         },
34         request => new HTTP::Request(
35                 GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
36         ),
37 },
38 {
39         type => "action",
40         comment => "ruleRemoveById future rule same phase",
41         conf => qq(
42                 SecRuleEngine On
43                 SecAction "phase:1,pass,ctl:ruleRemoveById=666"
44                 SecAction "phase:1,id:666,deny"
45         ),
46         match_log => {
47         },
48         match_response => {
49                 status => qr/^200$/,
50         },
51         request => new HTTP::Request(
52                 GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
53         ),
54 },
55
56