Changes ENV test case to read the default MODSECURTIY env var

This commit is contained in:
Felipe Zimmerle 2018-11-29 15:20:25 -03:00
parent b736f0292d
commit 25bb1f1bcc
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
2 changed files with 52 additions and 5 deletions

View File

@ -1,6 +1,8 @@
v3.0.4 - YYYY-MMM-DD (to be released)
-------------------------------------
- Changes ENV test case to read the default MODSECURTIY env var
[@zimmerle]
- Regression: Sets MODSECURITY env var during the tests execution
[@zimmerle]
- Fix setenv action to strdup key=variable

View File

@ -2,7 +2,7 @@
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: ENV (1/3)",
"title":"Testing Variables :: ENV (1/4)",
"client":{
"ip":"200.249.12.31",
"port":123
@ -46,7 +46,7 @@
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: ENV (2/3)",
"title":"Testing Variables :: ENV (2/4)",
"client":{
"ip":"200.249.12.31",
"port":123
@ -80,17 +80,62 @@
]
},
"expected":{
"debug_log":"Variable: ENV:TERM"
"debug_log":"regression tests\" .Variable: ENV:MODSECURITY."
},
"rules":[
"SecRuleEngine On",
"SecRule ENV:TERM \"@contains test\" \"id:1,phase:3,pass,t:trim\""
"SecRule ENV:MODSECURITY \"@contains test\" \"id:1,phase:3,pass,t:trim\""
]
},
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: ENV (3/3)",
"title":"Testing Variables :: ENV (3/4)",
"client":{
"ip":"200.249.12.31",
"port":123
},
"server":{
"ip":"200.249.12.31",
"port":80
},
"request":{
"headers":{
"Host":"localhost",
"User-Agent":"curl/7.38.0",
"Accept":"*/*",
"Content-Length": "27",
"Content-Type": "application/x-www-form-urlencoded"
},
"uri":"/",
"method":"POST",
"body": [
"param1=value1&param2=value2"
]
},
"response":{
"headers":{
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
"Content-Type":"text/html"
},
"body":[
"no need."
]
},
"expected":{
"debug_log":"Target value: \"bar\" .Variable: ENV:modfoo."
},
"rules":[
"SecRuleEngine On",
"SecRule ARGS \"@contains value\" \"id:1,phase:3,pass,t:trim,setenv:modfoo=bar\"",
"SecRule ENV:modfoo \"@contains test\" \"id:2,phase:3,pass,t:trim\""
]
},
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: ENV (4/4)",
"client":{
"ip":"200.249.12.31",
"port":123