mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Adds support for SecRuleRemoveByTag
This commit is contained in:
25
src/rules.cc
25
src/rules.cc
@@ -202,14 +202,27 @@ int Rules::evaluate(int phase, Transaction *transaction) {
|
||||
} else if (m_exceptions.contains(rule->m_ruleId)) {
|
||||
debug(9, "Skipped rule id '" + std::to_string(rule->m_ruleId) \
|
||||
+ "'. Removed by an SecRuleRemove directive.");
|
||||
} else if (m_exceptions.m_remove_rule_by_msg.empty() == false) {
|
||||
for (auto &z : m_exceptions.m_remove_rule_by_msg) {
|
||||
if (rule->containsMsg(z, transaction) == true) {
|
||||
debug(9, "Skipped rule id '" + std::to_string(rule->m_ruleId) \
|
||||
+ "'. Removed by a SecRuleRemoveByMsg directive.");
|
||||
} else {
|
||||
if (m_exceptions.m_remove_rule_by_msg.empty() == false) {
|
||||
for (auto &z : m_exceptions.m_remove_rule_by_msg) {
|
||||
if (rule->containsMsg(z, transaction) == true) {
|
||||
debug(9, "Skipped rule id '" + std::to_string(rule->m_ruleId) \
|
||||
+ "'. Removed by a SecRuleRemoveByMsg directive.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
if (m_exceptions.m_remove_rule_by_tag.empty() == false) {
|
||||
for (auto &z : m_exceptions.m_remove_rule_by_tag) {
|
||||
if (rule->containsTag(z, transaction) == true) {
|
||||
debug(9, "Skipped rule id '" + std::to_string(rule->m_ruleId) \
|
||||
+ "'. Removed by a SecRuleRemoveByTag directive.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rule->evaluate(transaction, NULL);
|
||||
if (transaction->m_it.disruptive == true) {
|
||||
debug(8, "Skipping this phase as this " \
|
||||
|
Reference in New Issue
Block a user