mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-18 18:30:35 +03:00
Computes auditlog during rules load time
This commit is contained in:
committed by
Felipe Zimmerle
parent
bf3a1d84ff
commit
c38051324d
@@ -15,20 +15,10 @@
|
||||
|
||||
#include "src/actions/audit_log.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "modsecurity/transaction.h"
|
||||
|
||||
|
||||
namespace modsecurity {
|
||||
namespace actions {
|
||||
|
||||
|
||||
bool AuditLog::execute(Transaction *transaction) noexcept {
|
||||
transaction->messageSetNoAuditLog(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // namespace actions
|
||||
} // namespace modsecurity
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
|
||||
#include "src/actions/action_allowed_in_sec_default_action.h"
|
||||
|
||||
#include "src/actions/action_type_rule_metadata.h"
|
||||
#include "src/actions/action_allowed_in_sec_default_action.h"
|
||||
|
||||
|
||||
#ifndef SRC_ACTIONS_AUDIT_LOG_H_
|
||||
#define SRC_ACTIONS_AUDIT_LOG_H_
|
||||
|
||||
@@ -24,13 +28,16 @@ namespace modsecurity {
|
||||
namespace actions {
|
||||
|
||||
|
||||
class AuditLog : public ActionAllowedAsSecDefaultAction {
|
||||
class AuditLog : public ActionTypeRuleMetaData,
|
||||
public ActionAllowedAsSecDefaultAction {
|
||||
public:
|
||||
AuditLog()
|
||||
: Action("auditLog")
|
||||
{ }
|
||||
|
||||
bool execute(Transaction *transaction) noexcept override;
|
||||
void configure(RuleWithActions *rule) override {
|
||||
rule->setHasAuditLogAction(true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -16,18 +16,10 @@
|
||||
|
||||
#include "src/actions/no_audit_log.h"
|
||||
|
||||
#include "modsecurity/transaction.h"
|
||||
|
||||
|
||||
namespace modsecurity {
|
||||
namespace actions {
|
||||
|
||||
|
||||
bool NoAuditLog::execute(Transaction *transaction) noexcept {
|
||||
transaction->messageSetNoAuditLog(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // namespace actions
|
||||
} // namespace modsecurity
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
|
||||
|
||||
#include "modsecurity/actions/action.h"
|
||||
#include "modsecurity/transaction.h"
|
||||
|
||||
#include "src/actions/action_type_rule_metadata.h"
|
||||
#include "src/actions/action_allowed_in_sec_default_action.h"
|
||||
|
||||
|
||||
@@ -27,13 +28,16 @@ namespace modsecurity {
|
||||
namespace actions {
|
||||
|
||||
|
||||
class NoAuditLog : public ActionAllowedAsSecDefaultAction {
|
||||
class NoAuditLog : public ActionTypeRuleMetaData,
|
||||
public ActionAllowedAsSecDefaultAction {
|
||||
public:
|
||||
NoAuditLog()
|
||||
: Action("noAuditLog")
|
||||
{ }
|
||||
|
||||
bool execute(Transaction *transaction) noexcept override;
|
||||
void configure(RuleWithActions *rule) override {
|
||||
rule->setHasNoAuditLogAction(true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user