|
64 | 64 | modsecurity on; |
65 | 65 | modsecurity_rules ' |
66 | 66 | SecRuleEngine On |
| 67 | + SecDefaultAction "phase:1,log,deny,status:403" |
67 | 68 | SecRule ARGS "@streq redirect301" "id:1,phase:1,status:301,redirect:http://www.modsecurity.org" |
68 | 69 | SecRule ARGS "@streq redirect302" "id:2,phase:1,status:302,redirect:http://www.modsecurity.org" |
69 | 70 | SecRule ARGS "@streq block401" "id:3,phase:1,status:401,block" |
|
74 | 75 | modsecurity on; |
75 | 76 | modsecurity_rules ' |
76 | 77 | SecRuleEngine On |
| 78 | + SecDefaultAction "phase:2,log,deny,status:403" |
77 | 79 | SecRule ARGS "@streq redirect301" "id:1,phase:2,status:301,redirect:http://www.modsecurity.org" |
78 | 80 | SecRule ARGS "@streq redirect302" "id:2,phase:2,status:302,redirect:http://www.modsecurity.org" |
79 | 81 | SecRule ARGS "@streq block401" "id:3,phase:2,status:401,block" |
|
84 | 86 | modsecurity on; |
85 | 87 | modsecurity_rules ' |
86 | 88 | SecRuleEngine On |
| 89 | + SecDefaultAction "phase:3,log,deny,status:403" |
87 | 90 | SecRule ARGS "@streq redirect301" "id:1,phase:3,status:301,redirect:http://www.modsecurity.org" |
88 | 91 | SecRule ARGS "@streq redirect302" "id:2,phase:3,status:302,redirect:http://www.modsecurity.org" |
89 | 92 | SecRule ARGS "@streq block401" "id:3,phase:3,status:401,block" |
|
94 | 97 | modsecurity on; |
95 | 98 | modsecurity_rules ' |
96 | 99 | SecRuleEngine On |
| 100 | + SecDefaultAction "phase:4,log,deny,status:403" |
97 | 101 | SecRule ARGS "@streq redirect301" "id:1,phase:4,status:301,redirect:http://www.modsecurity.org" |
98 | 102 | SecRule ARGS "@streq redirect302" "id:2,phase:4,status:302,redirect:http://www.modsecurity.org" |
99 | 103 | SecRule ARGS "@streq block401" "id:3,phase:4,status:401,block" |
@@ -129,15 +133,15 @@ is(http_get('/phase4?what=redirect301'), '', 'redirect 301 - phase 4'); |
129 | 133 |
|
130 | 134 | # Block (401) |
131 | 135 | like(http_get('/phase1?what=block401'), qr/401 Unauthorized/, 'block 401 - phase 1'); |
132 | | -like(http_get('/phase2?what=block401'), qr/401 Unauthorized/, 'block 401 - phase 2'); |
133 | | -like(http_get('/phase3?what=block401'), qr/401 Unauthorized/, 'block 401 - phase 3'); |
134 | | -is(http_get('/phase4?what=block401'), '', 'block 401 - phase 4'); |
| 136 | +like(http_get('/phase2?what=block401'), qr/401 Unauthorized/, 'block 401 - phase 2'); |
| 137 | +like(http_get('/phase3?what=block401'), qr/401 Unauthorized/, 'block 401 - phase 3'); |
| 138 | +is(http_get('/phase4?what=block401'), '', 'block 401 - phase 4'); |
135 | 139 |
|
136 | 140 | # Block (403) |
137 | 141 | like(http_get('/phase1?what=block403'), qr/403 Forbidden/, 'block 403 - phase 1'); |
138 | | -like(http_get('/phase2?what=block403'), qr/403 Forbidden/, 'block 403- phase 2'); |
139 | | -like(http_get('/phase3?what=block403'), qr/403 Forbidden/, 'block 403 - phase 3'); |
140 | | -is(http_get('/phase4?what=block403'), '', 'block 403 - phase 4'); |
| 142 | +like(http_get('/phase2?what=block403'), qr/403 Forbidden/, 'block 403 - phase 2'); |
| 143 | +like(http_get('/phase3?what=block403'), qr/403 Forbidden/, 'block 403 - phase 3'); |
| 144 | +is(http_get('/phase4?what=block403'), '', 'block 403 - phase 4'); |
141 | 145 |
|
142 | 146 | # Nothing to detect |
143 | 147 | like(http_get('/phase1?what=nothing'), qr/should be moved\/blocked before this./, 'nothing phase 1'); |
|
0 commit comments