Adds AuditLog class

The properties related to the Audit Log were saved into the classes
Rules and Dirver, now all those properties will be saved into the
AuditLog class.
This commit is contained in:
Felipe Zimmerle
2015-07-03 13:28:14 -03:00
parent 7ea9ff8836
commit 616a2ae6de
9 changed files with 335 additions and 9 deletions

View File

@@ -18,7 +18,9 @@
#include "parser/seclang-parser.hh"
Driver::Driver()
: trace_scanning(false), trace_parsing(false) {
: trace_scanning(false),
trace_parsing(false),
audit_log(new ModSecurity::AuditLog()) {
}
@@ -46,6 +48,11 @@ int Driver::parse(const std::string &f) {
int res = parser.parse();
if (this->audit_log->init() == false)
{
return false;
}
scan_end();
return res;
}

View File

@@ -25,6 +25,7 @@
#include "modsecurity/modsecurity.h"
#include "src/rule.h"
#include "src/audit_log.h"
#include "parser/seclang-parser.hh"
@@ -85,9 +86,11 @@ class Driver {
bool sec_audit_engine;
bool sec_request_body_access;
bool sec_response_body_access;
std::string audit_log_path;
std::string audit_log_parts;
std::string debug_log_path;
ModSecurity::AuditLog *audit_log;
int debug_level;
};

View File

@@ -147,11 +147,11 @@ expression:
}
| CONFIG_DIR_AUDIT_LOG
{
driver.audit_log_path = $1;
//driver.audit_log_path = $1;
}
| CONFIG_DIR_AUDIT_LOG_P
{
driver.audit_log_parts = $1;
//driver.audit_log_parts = $1;
}
| CONFIG_DIR_DEBUG_LVL
{