Skip to content

Test: target tests 007 & 008 - ARGS_POST & ARGS_POST_NAMES #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions config_tests/CONF_007_TARGET_ARGS_POST.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
target: ARGS_POST
rulefile: MRTS_007_ARGS_POST.conf
testfile: MRTS_007_ARGS_POST.yaml
templates:
- SecRule for TARGETS
colkey:
- - ''
- - arg1
- - arg1
- arg2
- - /^arg_.*$/
operator:
- '@contains'
oparg:
- attack
phase:
- 2
- 3
- 4
testdata:
phase_methods:
2: post
3: post
4: post
targets:
- target: ''
test:
data:
foo: attack
- target: arg1
test:
data:
arg1: attack
- target: arg2
test:
data:
arg2: attack
- target: /^arg_.*$/
test:
data:
arg_foo: attack
41 changes: 41 additions & 0 deletions config_tests/CONF_008_TARGET_ARGS_POST_NAMES.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
target: ARGS_POST_NAMES
rulefile: MRTS_008_ARGS_POST_NAMES.conf
testfile: MRTS_008_ARGS_POST_NAMES.yaml
templates:
- SecRule for TARGETS
colkey:
- - ''
- - attack1
- - attack1
- attack2
- - /^attack_.*$/
operator:
- '@contains'
oparg:
- attack
phase:
- 2
- 3
- 4
testdata:
phase_methods:
2: post
3: post
4: post
targets:
- target: ''
test:
data:
attack: test
- target: attack1
test:
data:
attack1: test
- target: attack2
test:
data:
attack2: test
- target: /^attack_.*$/
test:
data:
attack_foo: test
108 changes: 108 additions & 0 deletions generated/rules/MRTS_007_ARGS_POST.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
SecRule ARGS_POST "@contains attack" \
"id:100092,\
phase:2,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
ver:'MRTS/0.1'"

SecRule ARGS_POST "@contains attack" \
"id:100093,\
phase:3,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
ver:'MRTS/0.1'"

SecRule ARGS_POST "@contains attack" \
"id:100094,\
phase:4,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
ver:'MRTS/0.1'"

SecRule ARGS_POST:arg1 "@contains attack" \
"id:100095,\
phase:2,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
ver:'MRTS/0.1'"

SecRule ARGS_POST:arg1 "@contains attack" \
"id:100096,\
phase:3,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
ver:'MRTS/0.1'"

SecRule ARGS_POST:arg1 "@contains attack" \
"id:100097,\
phase:4,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
ver:'MRTS/0.1'"

SecRule ARGS_POST:arg1|ARGS_POST:arg2 "@contains attack" \
"id:100098,\
phase:2,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
ver:'MRTS/0.1'"

SecRule ARGS_POST:arg1|ARGS_POST:arg2 "@contains attack" \
"id:100099,\
phase:3,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
ver:'MRTS/0.1'"

SecRule ARGS_POST:arg1|ARGS_POST:arg2 "@contains attack" \
"id:100100,\
phase:4,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
ver:'MRTS/0.1'"

SecRule ARGS_POST:/^arg_.*$/ "@contains attack" \
"id:100101,\
phase:2,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
ver:'MRTS/0.1'"

SecRule ARGS_POST:/^arg_.*$/ "@contains attack" \
"id:100102,\
phase:3,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
ver:'MRTS/0.1'"

SecRule ARGS_POST:/^arg_.*$/ "@contains attack" \
"id:100103,\
phase:4,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
ver:'MRTS/0.1'"

108 changes: 108 additions & 0 deletions generated/rules/MRTS_008_ARGS_POST_NAMES.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
SecRule ARGS_POST_NAMES "@contains attack" \
"id:100104,\
phase:2,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
ver:'MRTS/0.1'"

SecRule ARGS_POST_NAMES "@contains attack" \
"id:100105,\
phase:3,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
ver:'MRTS/0.1'"

SecRule ARGS_POST_NAMES "@contains attack" \
"id:100106,\
phase:4,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
ver:'MRTS/0.1'"

SecRule ARGS_POST_NAMES:attack1 "@contains attack" \
"id:100107,\
phase:2,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
ver:'MRTS/0.1'"

SecRule ARGS_POST_NAMES:attack1 "@contains attack" \
"id:100108,\
phase:3,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
ver:'MRTS/0.1'"

SecRule ARGS_POST_NAMES:attack1 "@contains attack" \
"id:100109,\
phase:4,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
ver:'MRTS/0.1'"

SecRule ARGS_POST_NAMES:attack1|ARGS_POST_NAMES:attack2 "@contains attack" \
"id:100110,\
phase:2,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
ver:'MRTS/0.1'"

SecRule ARGS_POST_NAMES:attack1|ARGS_POST_NAMES:attack2 "@contains attack" \
"id:100111,\
phase:3,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
ver:'MRTS/0.1'"

SecRule ARGS_POST_NAMES:attack1|ARGS_POST_NAMES:attack2 "@contains attack" \
"id:100112,\
phase:4,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
ver:'MRTS/0.1'"

SecRule ARGS_POST_NAMES:/^attack_.*$/ "@contains attack" \
"id:100113,\
phase:2,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:2',\
ver:'MRTS/0.1'"

SecRule ARGS_POST_NAMES:/^attack_.*$/ "@contains attack" \
"id:100114,\
phase:3,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:3',\
ver:'MRTS/0.1'"

SecRule ARGS_POST_NAMES:/^attack_.*$/ "@contains attack" \
"id:100115,\
phase:4,\
deny,\
t:none,\
log,\
msg:'%{MATCHED_VAR_NAME} was caught in phase:4',\
ver:'MRTS/0.1'"

6 changes: 3 additions & 3 deletions generated/rules/MRTS_110_XML.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SecRule XML:/* "@beginsWith foo" \
"id:100092,\
"id:100116,\
phase:2,\
deny,\
t:none,\
Expand All @@ -8,7 +8,7 @@ SecRule XML:/* "@beginsWith foo" \
ver:'MRTS/0.1'"

SecRule XML:/* "@beginsWith foo" \
"id:100093,\
"id:100117,\
phase:3,\
deny,\
t:none,\
Expand All @@ -17,7 +17,7 @@ SecRule XML:/* "@beginsWith foo" \
ver:'MRTS/0.1'"

SecRule XML:/* "@beginsWith foo" \
"id:100094,\
"id:100118,\
phase:4,\
deny,\
t:none,\
Expand Down
Loading