Fix dict element regular expression selection on SecRuleUpdateTargetByTag

This commit is contained in:
Felipe Zimmerle 2019-05-31 01:40:08 -03:00
parent 5472362313
commit 1b8d69da02
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
3 changed files with 252 additions and 245 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1051,6 +1051,7 @@ EQUALS_MINUS (?i:=\-)
<EXPECTING_VAR_PARAMETER>{
[\/]{DICT_ELEMENT_NO_PIPE}[\/] { BEGIN_PREVIOUS(); yyless(yyleng); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); }
[\/]{DICT_ELEMENT_NO_PIPE}[\/][ ] { BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); }
[\/]{DICT_ELEMENT_NO_PIPE}[\/][|] { BEGIN_PREVIOUS(); yyless(yyleng - 1); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 1, yyleng-2), *driver.loc.back()); }
['][\/]{DICT_ELEMENT_WITH_PIPE}[\/]['] { BEGIN_PREVIOUS(); yyless(yyleng - 0); return p::make_DICT_ELEMENT_REGEXP(std::string(yytext, 2, yyleng-4), *driver.loc.back()); }

View File

@ -155,7 +155,7 @@
},
"rules":[
"SecRuleEngine On",
"SecRuleUpdateTargetByTag test !ARGS:'/ke/'",
"SecRuleUpdateTargetByTag test !ARGS:/ke/",
"SecRule ARGS \"@contains value\" \"id:1,pass,t:trim,tag:'test',deny\""
]
}