Skip to content

Commit 8b9af6d

Browse files
authored
Merge pull request #22 from Sebitosh/args_test_rewrite
Test; ARGS test rewrite - test GET and POST on phases 1-4 and 2-4
2 parents 71c3f99 + e098bde commit 8b9af6d

File tree

82 files changed

+1652
-915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1652
-915
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
target: ARGS
2+
rulefile: MRTS_002_ARGS_A-GET.conf
3+
testfile: MRTS_002_ARGS_A-GET.yaml
4+
templates:
5+
- SecRule for TARGETS
6+
colkey:
7+
- - ''
8+
- - arg1
9+
- - arg1
10+
- arg2
11+
- - /^arg_.*$/
12+
operator:
13+
- '@contains'
14+
oparg:
15+
- attack
16+
phase:
17+
- 1
18+
- 2
19+
- 3
20+
- 4
21+
testdata:
22+
phase_methods:
23+
1: get
24+
2: get
25+
3: get
26+
4: get
27+
targets:
28+
- target: ''
29+
test:
30+
data:
31+
foo: attack
32+
- target: arg1
33+
test:
34+
data:
35+
arg1: attack
36+
- target: arg2
37+
test:
38+
data:
39+
arg2: attack
40+
- target: /^arg_.*$/
41+
test:
42+
data:
43+
arg_foo: attack

config_tests/CONF_002_TARGET_ARGS.yaml renamed to config_tests/CONF_002_TARGET_ARGS_B-POST.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
target: ARGS
2-
rulefile: MRTS_002_ARGS.conf
3-
testfile: MRTS_002_ARGS.yaml
2+
rulefile: MRTS_002_ARGS_B-POST.conf
3+
testfile: MRTS_002_ARGS_B-POST.yaml
44
templates:
55
- SecRule for TARGETS
66
colkey:
@@ -14,13 +14,11 @@ operator:
1414
oparg:
1515
- attack
1616
phase:
17-
- 1
1817
- 2
1918
- 3
2019
- 4
2120
testdata:
2221
phase_methods:
23-
1: get
2422
2: post
2523
3: post
2624
4: post
File renamed without changes.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
SecRule ARGS "@contains attack" \
2+
"id:100016,\
3+
phase:2,\
4+
deny,\
5+
t:none,\
6+
log,\
7+
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
8+
ver:'MRTS/0.1'"
9+
10+
SecRule ARGS "@contains attack" \
11+
"id:100017,\
12+
phase:3,\
13+
deny,\
14+
t:none,\
15+
log,\
16+
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
17+
ver:'MRTS/0.1'"
18+
19+
SecRule ARGS "@contains attack" \
20+
"id:100018,\
21+
phase:4,\
22+
deny,\
23+
t:none,\
24+
log,\
25+
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
26+
ver:'MRTS/0.1'"
27+
28+
SecRule ARGS:arg1 "@contains attack" \
29+
"id:100019,\
30+
phase:2,\
31+
deny,\
32+
t:none,\
33+
log,\
34+
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
35+
ver:'MRTS/0.1'"
36+
37+
SecRule ARGS:arg1 "@contains attack" \
38+
"id:100020,\
39+
phase:3,\
40+
deny,\
41+
t:none,\
42+
log,\
43+
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
44+
ver:'MRTS/0.1'"
45+
46+
SecRule ARGS:arg1 "@contains attack" \
47+
"id:100021,\
48+
phase:4,\
49+
deny,\
50+
t:none,\
51+
log,\
52+
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
53+
ver:'MRTS/0.1'"
54+
55+
SecRule ARGS:arg1|ARGS:arg2 "@contains attack" \
56+
"id:100022,\
57+
phase:2,\
58+
deny,\
59+
t:none,\
60+
log,\
61+
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
62+
ver:'MRTS/0.1'"
63+
64+
SecRule ARGS:arg1|ARGS:arg2 "@contains attack" \
65+
"id:100023,\
66+
phase:3,\
67+
deny,\
68+
t:none,\
69+
log,\
70+
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
71+
ver:'MRTS/0.1'"
72+
73+
SecRule ARGS:arg1|ARGS:arg2 "@contains attack" \
74+
"id:100024,\
75+
phase:4,\
76+
deny,\
77+
t:none,\
78+
log,\
79+
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
80+
ver:'MRTS/0.1'"
81+
82+
SecRule ARGS:/^arg_.*$/ "@contains attack" \
83+
"id:100025,\
84+
phase:2,\
85+
deny,\
86+
t:none,\
87+
log,\
88+
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
89+
ver:'MRTS/0.1'"
90+
91+
SecRule ARGS:/^arg_.*$/ "@contains attack" \
92+
"id:100026,\
93+
phase:3,\
94+
deny,\
95+
t:none,\
96+
log,\
97+
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
98+
ver:'MRTS/0.1'"
99+
100+
SecRule ARGS:/^arg_.*$/ "@contains attack" \
101+
"id:100027,\
102+
phase:4,\
103+
deny,\
104+
t:none,\
105+
log,\
106+
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
107+
ver:'MRTS/0.1'"
108+

generated/rules/MRTS_003_ARGS_COMBINED_SIZE.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SecRule ARGS_COMBINED_SIZE "@lt 2" \
2-
"id:100016,\
2+
"id:100028,\
33
phase:1,\
44
deny,\
55
t:none,\
@@ -8,7 +8,7 @@ SecRule ARGS_COMBINED_SIZE "@lt 2" \
88
ver:'MRTS/0.1'"
99

1010
SecRule ARGS_COMBINED_SIZE "@lt 2" \
11-
"id:100017,\
11+
"id:100029,\
1212
phase:2,\
1313
deny,\
1414
t:none,\
@@ -17,7 +17,7 @@ SecRule ARGS_COMBINED_SIZE "@lt 2" \
1717
ver:'MRTS/0.1'"
1818

1919
SecRule ARGS_COMBINED_SIZE "@lt 2" \
20-
"id:100018,\
20+
"id:100030,\
2121
phase:3,\
2222
deny,\
2323
t:none,\
@@ -26,7 +26,7 @@ SecRule ARGS_COMBINED_SIZE "@lt 2" \
2626
ver:'MRTS/0.1'"
2727

2828
SecRule ARGS_COMBINED_SIZE "@lt 2" \
29-
"id:100019,\
29+
"id:100031,\
3030
phase:4,\
3131
deny,\
3232
t:none,\

generated/rules/MRTS_004_ARGS_GET.conf

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SecRule ARGS_GET "@contains attack" \
2-
"id:100020,\
2+
"id:100032,\
33
phase:1,\
44
deny,\
55
t:none,\
@@ -8,7 +8,7 @@ SecRule ARGS_GET "@contains attack" \
88
ver:'MRTS/0.1'"
99

1010
SecRule ARGS_GET "@contains attack" \
11-
"id:100021,\
11+
"id:100033,\
1212
phase:2,\
1313
deny,\
1414
t:none,\
@@ -17,7 +17,7 @@ SecRule ARGS_GET "@contains attack" \
1717
ver:'MRTS/0.1'"
1818

1919
SecRule ARGS_GET "@contains attack" \
20-
"id:100022,\
20+
"id:100034,\
2121
phase:3,\
2222
deny,\
2323
t:none,\
@@ -26,7 +26,7 @@ SecRule ARGS_GET "@contains attack" \
2626
ver:'MRTS/0.1'"
2727

2828
SecRule ARGS_GET "@contains attack" \
29-
"id:100023,\
29+
"id:100035,\
3030
phase:4,\
3131
deny,\
3232
t:none,\
@@ -35,7 +35,7 @@ SecRule ARGS_GET "@contains attack" \
3535
ver:'MRTS/0.1'"
3636

3737
SecRule ARGS_GET:arg1 "@contains attack" \
38-
"id:100024,\
38+
"id:100036,\
3939
phase:1,\
4040
deny,\
4141
t:none,\
@@ -44,7 +44,7 @@ SecRule ARGS_GET:arg1 "@contains attack" \
4444
ver:'MRTS/0.1'"
4545

4646
SecRule ARGS_GET:arg1 "@contains attack" \
47-
"id:100025,\
47+
"id:100037,\
4848
phase:2,\
4949
deny,\
5050
t:none,\
@@ -53,7 +53,7 @@ SecRule ARGS_GET:arg1 "@contains attack" \
5353
ver:'MRTS/0.1'"
5454

5555
SecRule ARGS_GET:arg1 "@contains attack" \
56-
"id:100026,\
56+
"id:100038,\
5757
phase:3,\
5858
deny,\
5959
t:none,\
@@ -62,7 +62,7 @@ SecRule ARGS_GET:arg1 "@contains attack" \
6262
ver:'MRTS/0.1'"
6363

6464
SecRule ARGS_GET:arg1 "@contains attack" \
65-
"id:100027,\
65+
"id:100039,\
6666
phase:4,\
6767
deny,\
6868
t:none,\
@@ -71,7 +71,7 @@ SecRule ARGS_GET:arg1 "@contains attack" \
7171
ver:'MRTS/0.1'"
7272

7373
SecRule ARGS_GET:arg1|ARGS_GET:arg2 "@contains attack" \
74-
"id:100028,\
74+
"id:100040,\
7575
phase:1,\
7676
deny,\
7777
t:none,\
@@ -80,7 +80,7 @@ SecRule ARGS_GET:arg1|ARGS_GET:arg2 "@contains attack" \
8080
ver:'MRTS/0.1'"
8181

8282
SecRule ARGS_GET:arg1|ARGS_GET:arg2 "@contains attack" \
83-
"id:100029,\
83+
"id:100041,\
8484
phase:2,\
8585
deny,\
8686
t:none,\
@@ -89,7 +89,7 @@ SecRule ARGS_GET:arg1|ARGS_GET:arg2 "@contains attack" \
8989
ver:'MRTS/0.1'"
9090

9191
SecRule ARGS_GET:arg1|ARGS_GET:arg2 "@contains attack" \
92-
"id:100030,\
92+
"id:100042,\
9393
phase:3,\
9494
deny,\
9595
t:none,\
@@ -98,7 +98,7 @@ SecRule ARGS_GET:arg1|ARGS_GET:arg2 "@contains attack" \
9898
ver:'MRTS/0.1'"
9999

100100
SecRule ARGS_GET:arg1|ARGS_GET:arg2 "@contains attack" \
101-
"id:100031,\
101+
"id:100043,\
102102
phase:4,\
103103
deny,\
104104
t:none,\
@@ -107,7 +107,7 @@ SecRule ARGS_GET:arg1|ARGS_GET:arg2 "@contains attack" \
107107
ver:'MRTS/0.1'"
108108

109109
SecRule ARGS_GET:/^arg_.*$/ "@contains attack" \
110-
"id:100032,\
110+
"id:100044,\
111111
phase:1,\
112112
deny,\
113113
t:none,\
@@ -116,7 +116,7 @@ SecRule ARGS_GET:/^arg_.*$/ "@contains attack" \
116116
ver:'MRTS/0.1'"
117117

118118
SecRule ARGS_GET:/^arg_.*$/ "@contains attack" \
119-
"id:100033,\
119+
"id:100045,\
120120
phase:2,\
121121
deny,\
122122
t:none,\
@@ -125,7 +125,7 @@ SecRule ARGS_GET:/^arg_.*$/ "@contains attack" \
125125
ver:'MRTS/0.1'"
126126

127127
SecRule ARGS_GET:/^arg_.*$/ "@contains attack" \
128-
"id:100034,\
128+
"id:100046,\
129129
phase:3,\
130130
deny,\
131131
t:none,\
@@ -134,7 +134,7 @@ SecRule ARGS_GET:/^arg_.*$/ "@contains attack" \
134134
ver:'MRTS/0.1'"
135135

136136
SecRule ARGS_GET:/^arg_.*$/ "@contains attack" \
137-
"id:100035,\
137+
"id:100047,\
138138
phase:4,\
139139
deny,\
140140
t:none,\

0 commit comments

Comments
 (0)