mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds support for the exec action
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -51,6 +51,7 @@ class Driver;
|
||||
}
|
||||
}
|
||||
|
||||
#include "src/rule_script.h"
|
||||
|
||||
#include "src/actions/accuracy.h"
|
||||
#include "src/actions/audit_log.h"
|
||||
@@ -71,6 +72,7 @@ class Driver;
|
||||
#include "src/actions/disruptive/pass.h"
|
||||
#include "src/actions/disruptive/redirect.h"
|
||||
#include "src/actions/init_col.h"
|
||||
#include "src/actions/exec.h"
|
||||
#include "src/actions/log_data.h"
|
||||
#include "src/actions/log.h"
|
||||
#include "src/actions/maturity.h"
|
||||
@@ -368,7 +370,7 @@ using modsecurity::operators::Operator;
|
||||
|
||||
|
||||
|
||||
#line 372 "seclang-parser.hh" // lalr1.cc:377
|
||||
#line 374 "seclang-parser.hh" // lalr1.cc:377
|
||||
|
||||
# include <cassert>
|
||||
# include <cstdlib> // std::abort
|
||||
@@ -445,7 +447,7 @@ using modsecurity::operators::Operator;
|
||||
|
||||
|
||||
namespace yy {
|
||||
#line 449 "seclang-parser.hh" // lalr1.cc:377
|
||||
#line 451 "seclang-parser.hh" // lalr1.cc:377
|
||||
|
||||
|
||||
|
||||
@@ -5768,7 +5770,7 @@ namespace yy {
|
||||
|
||||
|
||||
} // yy
|
||||
#line 5772 "seclang-parser.hh" // lalr1.cc:377
|
||||
#line 5774 "seclang-parser.hh" // lalr1.cc:377
|
||||
|
||||
|
||||
|
||||
|
@@ -17,6 +17,7 @@ class Driver;
|
||||
}
|
||||
}
|
||||
|
||||
#include "src/rule_script.h"
|
||||
|
||||
#include "src/actions/accuracy.h"
|
||||
#include "src/actions/audit_log.h"
|
||||
@@ -37,6 +38,7 @@ class Driver;
|
||||
#include "src/actions/disruptive/pass.h"
|
||||
#include "src/actions/disruptive/redirect.h"
|
||||
#include "src/actions/init_col.h"
|
||||
#include "src/actions/exec.h"
|
||||
#include "src/actions/log_data.h"
|
||||
#include "src/actions/log.h"
|
||||
#include "src/actions/maturity.h"
|
||||
@@ -1109,8 +1111,27 @@ expression:
|
||||
}
|
||||
| DIRECTIVE_SECRULESCRIPT actions
|
||||
{
|
||||
driver.error(@0, "SecRuleScript is not yet supported.");
|
||||
YYERROR;
|
||||
std::vector<actions::Action *> *a = new std::vector<actions::Action *>();
|
||||
for (auto &i : *$2.get()) {
|
||||
a->push_back(i.release());
|
||||
}
|
||||
|
||||
RuleScript *r = new RuleScript(
|
||||
/* path to script */ $1,
|
||||
/* actions */ a,
|
||||
/* file name */ driver.ref.back(),
|
||||
/* line number */ @0.end.line
|
||||
);
|
||||
std::string err;
|
||||
if (r->init(&err) == false) {
|
||||
driver.error(@0, "Failed to load script: " + err);
|
||||
delete r;
|
||||
YYERROR;
|
||||
}
|
||||
if (driver.addSecRuleScript(r) == false) {
|
||||
delete r;
|
||||
YYERROR;
|
||||
}
|
||||
}
|
||||
| CONFIG_DIR_SEC_DEFAULT_ACTION actions
|
||||
{
|
||||
@@ -2296,7 +2317,7 @@ act:
|
||||
}
|
||||
| ACTION_EXEC
|
||||
{
|
||||
//ACTION_CONTAINER($$, new actions::Exec($1));
|
||||
ACTION_CONTAINER($$, new actions::Exec($1));
|
||||
}
|
||||
| ACTION_EXPIRE_VAR
|
||||
{
|
||||
|
Reference in New Issue
Block a user