Uses an enumeration to determine the state of the SecRuleEngine

This commit is contained in:
Felipe Zimmerle
2015-07-09 16:10:32 -03:00
parent cb8d6249a8
commit 75a9cfa273
4 changed files with 43 additions and 7 deletions

View File

@@ -74,7 +74,43 @@ class Rules {
std::vector<Rule *> rules[7]; // Number of Phases.
int sec_rule_engine;
/**
*
* The RuleEngine enumerator consists in mapping the different states
* of the rule engine.
*
*/
enum RuleEngine {
/**
* Rules won't be evaluated if Rule Engine is set to DisabledRuleEngine
*
*/
DisabledRuleEngine,
/**
* Rules will be evaluated and disturb actions will take place if needed.
*
*/
EnabledRuleEngine,
/**
* Rules will be evaluated but it won't generate any disruptive action.
*
*/
DetectionOnlyRuleEngine
};
static const char *ruleEngineStateString(RuleEngine i) {
switch (i) {
case DisabledRuleEngine:
return "Disabled";
case EnabledRuleEngine:
return "Enabled";
case DetectionOnlyRuleEngine:
return "DetectionOnly";
}
return NULL;
}
RuleEngine secRuleEngine;
int sec_audit_type;
bool sec_audit_engine;
bool sec_request_body_access;