mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Fix disruptive action flow while RuleEngine is in DetectionOnly
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "modsecurity/assay.h"
|
||||
#include "src/rule.h"
|
||||
#include "modsecurity/intervention.h"
|
||||
|
||||
namespace ModSecurity {
|
||||
namespace actions {
|
||||
@@ -32,6 +33,7 @@ Block::Block(std::string action)
|
||||
|
||||
|
||||
bool Block::evaluate(Rule *rule, Assay *assay) {
|
||||
assay->debug(8, "Running action block");
|
||||
for (Action *a : rule->actions_runtime_pos) {
|
||||
if (a->isDisruptive() == true) {
|
||||
assay->actions.push_back(a);
|
||||
@@ -41,7 +43,7 @@ bool Block::evaluate(Rule *rule, Assay *assay) {
|
||||
}
|
||||
|
||||
void Block::fill_intervention(ModSecurityIntervention *i) {
|
||||
|
||||
i->disruptive = true;
|
||||
}
|
||||
|
||||
} // namespace actions
|
||||
|
@@ -31,13 +31,17 @@ Deny::Deny(std::string action)
|
||||
|
||||
|
||||
bool Deny::evaluate(Rule *rule, Assay *assay) {
|
||||
assay->debug(8, "Running action deny");
|
||||
assay->actions.push_back(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Deny::fill_intervention(ModSecurityIntervention *i) {
|
||||
i->status = 403;
|
||||
if (i->status == 200) {
|
||||
i->status = 403;
|
||||
}
|
||||
i->log = "Deny action";
|
||||
i->disruptive = true;
|
||||
}
|
||||
|
||||
} // namespace actions
|
||||
|
Reference in New Issue
Block a user