Adds support for SecRuleRemoveByTag

This commit is contained in:
Felipe Zimmerle
2017-11-07 14:51:38 -03:00
parent 381cf8ac21
commit ec667a4609
12 changed files with 5509 additions and 5229 deletions

View File

@@ -574,6 +574,7 @@ using modsecurity::operators::Operator;
CONFIG_SEC_REMOTE_RULES_FAIL_ACTION "CONFIG_SEC_REMOTE_RULES_FAIL_ACTION"
CONFIG_SEC_RULE_REMOVE_BY_ID "CONFIG_SEC_RULE_REMOVE_BY_ID"
CONFIG_SEC_RULE_REMOVE_BY_MSG "CONFIG_SEC_RULE_REMOVE_BY_MSG"
CONFIG_SEC_RULE_REMOVE_BY_TAG "CONFIG_SEC_RULE_REMOVE_BY_TAG"
CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG "CONFIG_SEC_RULE_UPDATE_TARGET_BY_TAG"
CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG "CONFIG_SEC_RULE_UPDATE_TARGET_BY_MSG"
CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID "CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID"
@@ -1264,6 +1265,19 @@ expression:
YYERROR;
}
}
| CONFIG_SEC_RULE_REMOVE_BY_TAG
{
std::string error;
if (driver.m_exceptions.loadRemoveRuleByTag($1, &error) == false) {
std::stringstream ss;
ss << "SecRuleRemoveByTag: failed to load:";
ss << $1;
ss << ". ";
ss << error;
driver.error(@0, ss.str());
YYERROR;
}
}
| CONFIG_SEC_RULE_REMOVE_BY_MSG
{
std::string error;