Adds support to severity action and HIGHEST_SEVERITY variable

This commit is contained in:
Felipe Zimmerle
2015-07-21 01:09:13 -03:00
parent e189055ec3
commit 95c2fed89c
11 changed files with 337 additions and 2 deletions

View File

@@ -24,6 +24,7 @@
#include "actions/status.h"
#include "actions/rule_id.h"
#include "actions/phase.h"
#include "actions/severity.h"
#define IF_MATCH(a) \
@@ -58,6 +59,7 @@ Action *Action::instantiate(std::string name) {
std::string block("block");
std::string phase("phase:");
std::string rule_id("id:");
std::string severity("severity:");
if (name.compare(0, status.length(), status) == 0) {
return new Status(name);
@@ -74,6 +76,9 @@ Action *Action::instantiate(std::string name) {
if (name.compare(0, rule_id.length(), rule_id) == 0) {
return new RuleId(name);
}
if (name.compare(0, severity.length(), severity) == 0) {
return new Severity(name);
}
return new Action(name);
}