Skip to content

Commit 25bb1f1

Browse files
author
Felipe Zimmerle
committed
Changes ENV test case to read the default MODSECURTIY env var
1 parent b736f02 commit 25bb1f1

File tree

2 files changed

+52
-5
lines changed

2 files changed

+52
-5
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
v3.0.4 - YYYY-MMM-DD (to be released)
22
-------------------------------------
33

4+
- Changes ENV test case to read the default MODSECURTIY env var
5+
[@zimmerle]
46
- Regression: Sets MODSECURITY env var during the tests execution
57
[@zimmerle]
68
- Fix setenv action to strdup key=variable

test/test-cases/regression/variable-ENV.json

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"enabled":1,
44
"version_min":300000,
5-
"title":"Testing Variables :: ENV (1/3)",
5+
"title":"Testing Variables :: ENV (1/4)",
66
"client":{
77
"ip":"200.249.12.31",
88
"port":123
@@ -46,7 +46,7 @@
4646
{
4747
"enabled":1,
4848
"version_min":300000,
49-
"title":"Testing Variables :: ENV (2/3)",
49+
"title":"Testing Variables :: ENV (2/4)",
5050
"client":{
5151
"ip":"200.249.12.31",
5252
"port":123
@@ -80,17 +80,62 @@
8080
]
8181
},
8282
"expected":{
83-
"debug_log":"Variable: ENV:TERM"
83+
"debug_log":"regression tests\" .Variable: ENV:MODSECURITY."
8484
},
8585
"rules":[
8686
"SecRuleEngine On",
87-
"SecRule ENV:TERM \"@contains test\" \"id:1,phase:3,pass,t:trim\""
87+
"SecRule ENV:MODSECURITY \"@contains test\" \"id:1,phase:3,pass,t:trim\""
8888
]
8989
},
9090
{
9191
"enabled":1,
9292
"version_min":300000,
93-
"title":"Testing Variables :: ENV (3/3)",
93+
"title":"Testing Variables :: ENV (3/4)",
94+
"client":{
95+
"ip":"200.249.12.31",
96+
"port":123
97+
},
98+
"server":{
99+
"ip":"200.249.12.31",
100+
"port":80
101+
},
102+
"request":{
103+
"headers":{
104+
"Host":"localhost",
105+
"User-Agent":"curl/7.38.0",
106+
"Accept":"*/*",
107+
"Content-Length": "27",
108+
"Content-Type": "application/x-www-form-urlencoded"
109+
},
110+
"uri":"/",
111+
"method":"POST",
112+
"body": [
113+
"param1=value1&param2=value2"
114+
]
115+
},
116+
"response":{
117+
"headers":{
118+
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
119+
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
120+
"Content-Type":"text/html"
121+
},
122+
"body":[
123+
"no need."
124+
]
125+
},
126+
"expected":{
127+
"debug_log":"Target value: \"bar\" .Variable: ENV:modfoo."
128+
},
129+
"rules":[
130+
"SecRuleEngine On",
131+
"SecRule ARGS \"@contains value\" \"id:1,phase:3,pass,t:trim,setenv:modfoo=bar\"",
132+
"SecRule ENV:modfoo \"@contains test\" \"id:2,phase:3,pass,t:trim\""
133+
]
134+
},
135+
{
136+
"enabled":1,
137+
"version_min":300000,
138+
"title":"Testing Variables :: ENV (4/4)",
94139
"client":{
95140
"ip":"200.249.12.31",
96141
"port":123

0 commit comments

Comments
 (0)