General improvements on audit logs information

Making actions: msg, logdata, tag and others to work in the same
fashion that they work on ModSecurity v2.x
This commit is contained in:
Felipe Zimmerle
2016-02-05 15:12:20 -03:00
parent 31117d7577
commit 9474373264
7 changed files with 157 additions and 14 deletions

View File

@@ -22,6 +22,7 @@
#include "modsecurity/transaction.h"
#include "src/utils.h"
#include "src/macro_expansion.h"
#include "modsecurity/rule.h"
namespace modsecurity {
namespace actions {
@@ -35,14 +36,11 @@ LogData::LogData(std::string action)
bool LogData::evaluate(Rule *rule, Transaction *transaction) {
std::string msg = MacroExpansion::expand(m_data, transaction);
#ifndef NO_LOGS
transaction->debug(9, "Saving msg: " + msg);
#endif
transaction->m_rulesMessages.push_back(msg);
transaction->serverLog(msg);
return true;
std::string data = MacroExpansion::expand(m_data, transaction);
rule->m_log_data = data;
}
} // namespace actions
} // namespace modsecurity