File: 20-status-engine.pl

package info (click to toggle)
modsecurity-apache 2.8.0-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,492 kB
  • ctags: 2,899
  • sloc: ansic: 48,034; sh: 11,506; perl: 2,038; cpp: 1,929; makefile: 530; xml: 6
file content (49 lines) | stat: -rw-r--r-- 1,152 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
### Test the SecStatusEngine

# On
{
	type => "misc",
	comment => "Setting SecStatusEngine to On",
	conf => qq(
		SecRuleEngine On
		SecStatusEngine On
	),
	match_log => {
		error => [ qr/ModSecurity: StatusEngine call successfully sent/, 1],
		-error => [ qr/Status engine is currently disabled, enable it by set SecStatusEngine to On/, 1],
	},
	match_response => {
		status => qr/^200$/,
	},
	request => new HTTP::Request(
		POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
		[
			"Content-Type" => "application/x-www-form-urlencoded",
		],
		"arg1=val1&arg2=val2",
	),
},
# Off
{
	type => "misc",
	comment => "Setting SecStatusEngine to Off",
	conf => qq(
		SecRuleEngine On
		SecStatusEngine Off
	),
	match_log => {
		-error => [ qr/ModSecurity: StatusEngine call successfully sent/, 1],
		error => [ qr/Status engine is currently disabled, enable it by set SecStatusEngine to On/, 1],
	},
	match_response => {
		status => qr/^200$/,
	},
	request => new HTTP::Request(
		POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
		[
			"Content-Type" => "application/x-www-form-urlencoded",
		],
		"arg1=val1&arg2=val2",
	),
},