Skip to content

Commit c97da87

Browse files
authored
Merge branch 'coreruleset:main' into fix-use-correct-anomaly-variable
2 parents 74f9170 + 3ff3590 commit c97da87

File tree

9 files changed

+414
-17
lines changed

9 files changed

+414
-17
lines changed

tests/regression/referer-hardening-plugin/9524110.yaml

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,40 @@
22
meta:
33
author: "azurit"
44
description: "Referer Hardening Plugin"
5-
rule_id: 9524110
5+
enabled: true
6+
name: 9524110.yaml
67
tests:
7-
- test_id: 1
8-
desc: "Ivalid Referer header"
8+
- test_title: 9524110-1
9+
desc: "Invalid Referer header"
910
stages:
10-
- input:
11-
dest_addr: "127.0.0.1"
12-
method: "GET"
13-
port: 80
14-
headers:
15-
Host: "localhost"
16-
User-Agent: "OWASP CRS test agent"
17-
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
18-
Referer: "This is invalid header"
19-
uri: "/get"
20-
version: "HTTP/1.1"
21-
output:
22-
log:
23-
expect_ids: [9524110]
11+
- stage:
12+
input:
13+
dest_addr: 127.0.0.1
14+
headers:
15+
Host: localhost
16+
User-Agent: OWASP CRS test agent
17+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
18+
Referer: "This is invalid header"
19+
port: 80
20+
method: "GET"
21+
uri: "/get"
22+
version: "HTTP/1.1"
23+
output:
24+
log_contains: id "9524110"
25+
- test_title: 9524110-2
26+
desc: "Empty referer is whitelisted for this rule"
27+
stages:
28+
- stage:
29+
input:
30+
dest_addr: 127.0.0.1
31+
headers:
32+
Host: localhost
33+
User-Agent: OWASP CRS test agent
34+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
35+
Referer: ""
36+
port: 80
37+
method: "GET"
38+
uri: "/get"
39+
version: "HTTP/1.1"
40+
output:
41+
no_log_contains: id "9524110"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
meta:
3+
author: "azurit"
4+
description: "Referer Hardening Plugin"
5+
enabled: true
6+
name: 9524120.yaml
7+
tests:
8+
- test_title: 9524120-1
9+
desc: "Fragment component"
10+
stages:
11+
- stage:
12+
input:
13+
dest_addr: 127.0.0.1
14+
headers:
15+
Host: localhost
16+
User-Agent: OWASP CRS test agent
17+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
18+
Referer: "http://example.com/#Fragment-component"
19+
port: 80
20+
method: "GET"
21+
uri: "/get"
22+
version: "HTTP/1.1"
23+
output:
24+
log_contains: id "9524120"
25+
- test_title: 9524120-2
26+
desc: "Missing fragment component"
27+
stages:
28+
- stage:
29+
input:
30+
dest_addr: 127.0.0.1
31+
headers:
32+
Host: localhost
33+
User-Agent: OWASP CRS test agent
34+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
35+
Referer: "http://example.com"
36+
port: 80
37+
method: "GET"
38+
uri: "/get"
39+
version: "HTTP/1.1"
40+
output:
41+
no_log_contains: id "9524120"
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
meta:
3+
author: "azurit"
4+
description: "Referer Hardening Plugin"
5+
enabled: true
6+
name: 9524130.yaml
7+
tests:
8+
- test_title: 9524130-1
9+
desc: "Userinfo component"
10+
stages:
11+
- stage:
12+
input:
13+
dest_addr: 127.0.0.1
14+
headers:
15+
Host: localhost
16+
User-Agent: OWASP CRS test agent
17+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
18+
Referer: "http://login:password@example.com"
19+
port: 80
20+
method: "GET"
21+
uri: "/get"
22+
version: "HTTP/1.1"
23+
output:
24+
log_contains: id "9524130"
25+
- test_title: 9524130-2
26+
desc: "Userinfo component"
27+
stages:
28+
- stage:
29+
input:
30+
dest_addr: 127.0.0.1
31+
headers:
32+
Host: localhost
33+
User-Agent: OWASP CRS test agent
34+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
35+
Referer: "http://login@example.com"
36+
port: 80
37+
method: "GET"
38+
uri: "/get"
39+
version: "HTTP/1.1"
40+
output:
41+
log_contains: id "9524130"
42+
- test_title: 9524130-3
43+
desc: "Userinfo component"
44+
stages:
45+
- stage:
46+
input:
47+
dest_addr: 127.0.0.1
48+
headers:
49+
Host: localhost
50+
User-Agent: OWASP CRS test agent
51+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
52+
Referer: "http://@example.com"
53+
port: 80
54+
method: "GET"
55+
uri: "/get"
56+
version: "HTTP/1.1"
57+
output:
58+
log_contains: id "9524130"
59+
- test_title: 9524130-4
60+
desc: "Missing userinfo component"
61+
stages:
62+
- stage:
63+
input:
64+
dest_addr: 127.0.0.1
65+
headers:
66+
Host: localhost
67+
User-Agent: OWASP CRS test agent
68+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
69+
Referer: "http://example.com"
70+
port: 80
71+
method: "GET"
72+
uri: "/get"
73+
version: "HTTP/1.1"
74+
output:
75+
no_log_contains: id "9524130"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
meta:
3+
author: "azurit"
4+
description: "Referer Hardening Plugin"
5+
enabled: true
6+
name: 9524150.yaml
7+
tests:
8+
- test_title: 9524150-1
9+
desc: "Data URL"
10+
stages:
11+
- stage:
12+
input:
13+
dest_addr: 127.0.0.1
14+
headers:
15+
Host: localhost
16+
User-Agent: OWASP CRS test agent
17+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
18+
Referer: "data:,Hello%2C%20World%21"
19+
port: 80
20+
method: "GET"
21+
uri: "/get"
22+
version: "HTTP/1.1"
23+
output:
24+
log_contains: id "9524150"
25+
- test_title: 9524150-2
26+
desc: "Non-data URL"
27+
stages:
28+
- stage:
29+
input:
30+
dest_addr: 127.0.0.1
31+
headers:
32+
Host: localhost
33+
User-Agent: OWASP CRS test agent
34+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
35+
Referer: "http://example.com"
36+
port: 80
37+
method: "GET"
38+
uri: "/get"
39+
version: "HTTP/1.1"
40+
output:
41+
no_log_contains: id "9524150"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
meta:
3+
author: "azurit"
4+
description: "Referer Hardening Plugin"
5+
enabled: true
6+
name: 9524160.yaml
7+
tests:
8+
- test_title: 9524160-1
9+
desc: "Domain too long"
10+
stages:
11+
- stage:
12+
input:
13+
dest_addr: 127.0.0.1
14+
headers:
15+
Host: localhost
16+
User-Agent: OWASP CRS test agent
17+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
18+
Referer: "http://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com"
19+
port: 80
20+
method: "GET"
21+
uri: "/get"
22+
version: "HTTP/1.1"
23+
output:
24+
log_contains: id "9524160"
25+
- test_title: 9524160-2
26+
desc: "Valid domain"
27+
stages:
28+
- stage:
29+
input:
30+
dest_addr: 127.0.0.1
31+
headers:
32+
Host: localhost
33+
User-Agent: OWASP CRS test agent
34+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
35+
Referer: "http://example.com"
36+
port: 80
37+
method: "GET"
38+
uri: "/get"
39+
version: "HTTP/1.1"
40+
output:
41+
no_log_contains: id "9524160"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
meta:
3+
author: "azurit"
4+
description: "Referer Hardening Plugin"
5+
enabled: true
6+
name: 9524170.yaml
7+
tests:
8+
- test_title: 9524170-1
9+
desc: "Valid domain"
10+
stages:
11+
- stage:
12+
input:
13+
dest_addr: 127.0.0.1
14+
headers:
15+
Host: localhost
16+
User-Agent: OWASP CRS test agent
17+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
18+
Referer: "http://example.com/"
19+
port: 80
20+
method: "GET"
21+
uri: "/get"
22+
version: "HTTP/1.1"
23+
output:
24+
no_log_contains: id "9524170"
25+
- test_title: 9524170-2
26+
desc: "Invalid domain"
27+
stages:
28+
- stage:
29+
input:
30+
dest_addr: 127.0.0.1
31+
headers:
32+
Host: localhost
33+
User-Agent: OWASP CRS test agent
34+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
35+
Referer: "http://exa*mple.com/"
36+
port: 80
37+
method: "GET"
38+
uri: "/get"
39+
version: "HTTP/1.1"
40+
output:
41+
log_contains: id "9524170"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
meta:
3+
author: "azurit"
4+
description: "Referer Hardening Plugin"
5+
enabled: true
6+
name: 9524180.yaml
7+
tests:
8+
- test_title: 9524120-1
9+
desc: "Valid port"
10+
stages:
11+
- stage:
12+
input:
13+
dest_addr: 127.0.0.1
14+
headers:
15+
Host: localhost
16+
User-Agent: OWASP CRS test agent
17+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
18+
Referer: "http://example.com:80"
19+
port: 80
20+
method: "GET"
21+
uri: "/get"
22+
version: "HTTP/1.1"
23+
output:
24+
no_log_contains: id "9524180"
25+
- test_title: 9524120-2
26+
desc: "Missing port"
27+
stages:
28+
- stage:
29+
input:
30+
dest_addr: 127.0.0.1
31+
headers:
32+
Host: localhost
33+
User-Agent: OWASP CRS test agent
34+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
35+
Referer: "http://example.com"
36+
port: 80
37+
method: "GET"
38+
uri: "/get"
39+
version: "HTTP/1.1"
40+
output:
41+
no_log_contains: id "9524180"
42+
- test_title: 9524180-3
43+
desc: "Invalid port"
44+
stages:
45+
- stage:
46+
input:
47+
dest_addr: 127.0.0.1
48+
headers:
49+
Host: localhost
50+
User-Agent: OWASP CRS test agent
51+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
52+
Referer: "http://example.com:abc"
53+
port: 80
54+
method: "GET"
55+
uri: "/get"
56+
version: "HTTP/1.1"
57+
output:
58+
log_contains: id "9524180"

0 commit comments

Comments
 (0)