Adds support to unconditional rules

This commit is contained in:
Felipe Zimmerle
2015-09-04 14:52:18 -03:00
parent 4e8bb276b8
commit b048794f4e
7 changed files with 168 additions and 1 deletions

View File

@@ -190,6 +190,7 @@ using ModSecurity::Variables::Variable;
%token <std::string> CONFIG_DIR_DEBUG_LOG
%token <std::string> CONFIG_DIR_DEBUG_LVL
%token <std::string> CONFIG_DIR_SEC_ACTION
%token <std::string> CONFIG_DIR_SEC_DEFAULT_ACTION
%token <std::string> VARIABLE
@@ -356,6 +357,24 @@ expression:
);
driver.addSecRule(rule);
}
| CONFIG_DIR_SEC_ACTION SPACE QUOTATION_MARK actions QUOTATION_MARK
{
Rule *rule = new Rule(
/* op */ NULL,
/* variables */ NULL,
/* actions */ $4
);
driver.addSecAction(rule);
}
| CONFIG_DIR_SEC_ACTION SPACE actions
{
Rule *rule = new Rule(
/* op */ NULL,
/* variables */ NULL,
/* actions */ $3
);
driver.addSecAction(rule);
}
| CONFIG_DIR_SEC_DEFAULT_ACTION SPACE QUOTATION_MARK actions QUOTATION_MARK
{
std::vector<Action *> *actions = $4;