mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
Adds support to ctl:ruleEngine
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -58,6 +58,7 @@ class Driver;
|
||||
#include "src/actions/chain.h"
|
||||
#include "src/actions/ctl/audit_log_parts.h"
|
||||
#include "src/actions/ctl/request_body_access.h"
|
||||
#include "src/actions/ctl/rule_engine.h"
|
||||
#include "src/actions/ctl/request_body_processor_json.h"
|
||||
#include "src/actions/ctl/request_body_processor_xml.h"
|
||||
#include "src/actions/ctl/rule_remove_by_id.h"
|
||||
@@ -367,7 +368,7 @@ using modsecurity::operators::Operator;
|
||||
|
||||
|
||||
|
||||
#line 371 "seclang-parser.hh" // lalr1.cc:377
|
||||
#line 372 "seclang-parser.hh" // lalr1.cc:377
|
||||
|
||||
# include <cassert>
|
||||
# include <cstdlib> // std::abort
|
||||
@@ -444,7 +445,7 @@ using modsecurity::operators::Operator;
|
||||
|
||||
|
||||
namespace yy {
|
||||
#line 448 "seclang-parser.hh" // lalr1.cc:377
|
||||
#line 449 "seclang-parser.hh" // lalr1.cc:377
|
||||
|
||||
|
||||
|
||||
@@ -624,7 +625,6 @@ namespace yy {
|
||||
// "ACTION_CTL_BDY_XML"
|
||||
// "ACTION_CTL_FORCE_REQ_BODY_VAR"
|
||||
// "ACTION_CTL_REQUEST_BODY_ACCESS"
|
||||
// "ACTION_CTL_RULE_ENGINE"
|
||||
// "ACTION_CTL_RULE_REMOVE_BY_ID"
|
||||
// "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID"
|
||||
// "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG"
|
||||
@@ -940,20 +940,20 @@ namespace yy {
|
||||
TOK_SETVAR_OPERATION_EQUALS_PLUS = 345,
|
||||
TOK_SETVAR_OPERATION_EQUALS_MINUS = 346,
|
||||
TOK_NOT = 347,
|
||||
TOK_ACTION_ACCURACY = 348,
|
||||
TOK_ACTION_ALLOW = 349,
|
||||
TOK_ACTION_APPEND = 350,
|
||||
TOK_ACTION_AUDIT_LOG = 351,
|
||||
TOK_ACTION_BLOCK = 352,
|
||||
TOK_ACTION_CAPTURE = 353,
|
||||
TOK_ACTION_CHAIN = 354,
|
||||
TOK_ACTION_CTL_AUDIT_ENGINE = 355,
|
||||
TOK_ACTION_CTL_AUDIT_LOG_PARTS = 356,
|
||||
TOK_ACTION_CTL_BDY_JSON = 357,
|
||||
TOK_ACTION_CTL_BDY_XML = 358,
|
||||
TOK_ACTION_CTL_FORCE_REQ_BODY_VAR = 359,
|
||||
TOK_ACTION_CTL_REQUEST_BODY_ACCESS = 360,
|
||||
TOK_ACTION_CTL_RULE_ENGINE = 361,
|
||||
TOK_ACTION_CTL_RULE_ENGINE = 348,
|
||||
TOK_ACTION_ACCURACY = 349,
|
||||
TOK_ACTION_ALLOW = 350,
|
||||
TOK_ACTION_APPEND = 351,
|
||||
TOK_ACTION_AUDIT_LOG = 352,
|
||||
TOK_ACTION_BLOCK = 353,
|
||||
TOK_ACTION_CAPTURE = 354,
|
||||
TOK_ACTION_CHAIN = 355,
|
||||
TOK_ACTION_CTL_AUDIT_ENGINE = 356,
|
||||
TOK_ACTION_CTL_AUDIT_LOG_PARTS = 357,
|
||||
TOK_ACTION_CTL_BDY_JSON = 358,
|
||||
TOK_ACTION_CTL_BDY_XML = 359,
|
||||
TOK_ACTION_CTL_FORCE_REQ_BODY_VAR = 360,
|
||||
TOK_ACTION_CTL_REQUEST_BODY_ACCESS = 361,
|
||||
TOK_ACTION_CTL_RULE_REMOVE_BY_ID = 362,
|
||||
TOK_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID = 363,
|
||||
TOK_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG = 364,
|
||||
@@ -1617,6 +1617,10 @@ namespace yy {
|
||||
symbol_type
|
||||
make_NOT (const location_type& l);
|
||||
|
||||
static inline
|
||||
symbol_type
|
||||
make_ACTION_CTL_RULE_ENGINE (const location_type& l);
|
||||
|
||||
static inline
|
||||
symbol_type
|
||||
make_ACTION_ACCURACY (const std::string& v, const location_type& l);
|
||||
@@ -1669,10 +1673,6 @@ namespace yy {
|
||||
symbol_type
|
||||
make_ACTION_CTL_REQUEST_BODY_ACCESS (const std::string& v, const location_type& l);
|
||||
|
||||
static inline
|
||||
symbol_type
|
||||
make_ACTION_CTL_RULE_ENGINE (const std::string& v, const location_type& l);
|
||||
|
||||
static inline
|
||||
symbol_type
|
||||
make_ACTION_CTL_RULE_REMOVE_BY_ID (const std::string& v, const location_type& l);
|
||||
@@ -2721,20 +2721,19 @@ namespace yy {
|
||||
{
|
||||
switch (other.type_get ())
|
||||
{
|
||||
case 93: // "Accuracy"
|
||||
case 94: // "Allow"
|
||||
case 95: // "Append"
|
||||
case 96: // "AuditLog"
|
||||
case 97: // "Block"
|
||||
case 98: // "Capture"
|
||||
case 99: // "Chain"
|
||||
case 100: // "ACTION_CTL_AUDIT_ENGINE"
|
||||
case 101: // "ACTION_CTL_AUDIT_LOG_PARTS"
|
||||
case 102: // "ACTION_CTL_BDY_JSON"
|
||||
case 103: // "ACTION_CTL_BDY_XML"
|
||||
case 104: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
|
||||
case 105: // "ACTION_CTL_REQUEST_BODY_ACCESS"
|
||||
case 106: // "ACTION_CTL_RULE_ENGINE"
|
||||
case 94: // "Accuracy"
|
||||
case 95: // "Allow"
|
||||
case 96: // "Append"
|
||||
case 97: // "AuditLog"
|
||||
case 98: // "Block"
|
||||
case 99: // "Capture"
|
||||
case 100: // "Chain"
|
||||
case 101: // "ACTION_CTL_AUDIT_ENGINE"
|
||||
case 102: // "ACTION_CTL_AUDIT_LOG_PARTS"
|
||||
case 103: // "ACTION_CTL_BDY_JSON"
|
||||
case 104: // "ACTION_CTL_BDY_XML"
|
||||
case 105: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
|
||||
case 106: // "ACTION_CTL_REQUEST_BODY_ACCESS"
|
||||
case 107: // "ACTION_CTL_RULE_REMOVE_BY_ID"
|
||||
case 108: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID"
|
||||
case 109: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG"
|
||||
@@ -2961,20 +2960,19 @@ namespace yy {
|
||||
(void) v;
|
||||
switch (this->type_get ())
|
||||
{
|
||||
case 93: // "Accuracy"
|
||||
case 94: // "Allow"
|
||||
case 95: // "Append"
|
||||
case 96: // "AuditLog"
|
||||
case 97: // "Block"
|
||||
case 98: // "Capture"
|
||||
case 99: // "Chain"
|
||||
case 100: // "ACTION_CTL_AUDIT_ENGINE"
|
||||
case 101: // "ACTION_CTL_AUDIT_LOG_PARTS"
|
||||
case 102: // "ACTION_CTL_BDY_JSON"
|
||||
case 103: // "ACTION_CTL_BDY_XML"
|
||||
case 104: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
|
||||
case 105: // "ACTION_CTL_REQUEST_BODY_ACCESS"
|
||||
case 106: // "ACTION_CTL_RULE_ENGINE"
|
||||
case 94: // "Accuracy"
|
||||
case 95: // "Allow"
|
||||
case 96: // "Append"
|
||||
case 97: // "AuditLog"
|
||||
case 98: // "Block"
|
||||
case 99: // "Capture"
|
||||
case 100: // "Chain"
|
||||
case 101: // "ACTION_CTL_AUDIT_ENGINE"
|
||||
case 102: // "ACTION_CTL_AUDIT_LOG_PARTS"
|
||||
case 103: // "ACTION_CTL_BDY_JSON"
|
||||
case 104: // "ACTION_CTL_BDY_XML"
|
||||
case 105: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
|
||||
case 106: // "ACTION_CTL_REQUEST_BODY_ACCESS"
|
||||
case 107: // "ACTION_CTL_RULE_REMOVE_BY_ID"
|
||||
case 108: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID"
|
||||
case 109: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG"
|
||||
@@ -3267,20 +3265,19 @@ namespace yy {
|
||||
// Type destructor.
|
||||
switch (yytype)
|
||||
{
|
||||
case 93: // "Accuracy"
|
||||
case 94: // "Allow"
|
||||
case 95: // "Append"
|
||||
case 96: // "AuditLog"
|
||||
case 97: // "Block"
|
||||
case 98: // "Capture"
|
||||
case 99: // "Chain"
|
||||
case 100: // "ACTION_CTL_AUDIT_ENGINE"
|
||||
case 101: // "ACTION_CTL_AUDIT_LOG_PARTS"
|
||||
case 102: // "ACTION_CTL_BDY_JSON"
|
||||
case 103: // "ACTION_CTL_BDY_XML"
|
||||
case 104: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
|
||||
case 105: // "ACTION_CTL_REQUEST_BODY_ACCESS"
|
||||
case 106: // "ACTION_CTL_RULE_ENGINE"
|
||||
case 94: // "Accuracy"
|
||||
case 95: // "Allow"
|
||||
case 96: // "Append"
|
||||
case 97: // "AuditLog"
|
||||
case 98: // "Block"
|
||||
case 99: // "Capture"
|
||||
case 100: // "Chain"
|
||||
case 101: // "ACTION_CTL_AUDIT_ENGINE"
|
||||
case 102: // "ACTION_CTL_AUDIT_LOG_PARTS"
|
||||
case 103: // "ACTION_CTL_BDY_JSON"
|
||||
case 104: // "ACTION_CTL_BDY_XML"
|
||||
case 105: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
|
||||
case 106: // "ACTION_CTL_REQUEST_BODY_ACCESS"
|
||||
case 107: // "ACTION_CTL_RULE_REMOVE_BY_ID"
|
||||
case 108: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID"
|
||||
case 109: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG"
|
||||
@@ -3513,20 +3510,19 @@ namespace yy {
|
||||
super_type::move(s);
|
||||
switch (this->type_get ())
|
||||
{
|
||||
case 93: // "Accuracy"
|
||||
case 94: // "Allow"
|
||||
case 95: // "Append"
|
||||
case 96: // "AuditLog"
|
||||
case 97: // "Block"
|
||||
case 98: // "Capture"
|
||||
case 99: // "Chain"
|
||||
case 100: // "ACTION_CTL_AUDIT_ENGINE"
|
||||
case 101: // "ACTION_CTL_AUDIT_LOG_PARTS"
|
||||
case 102: // "ACTION_CTL_BDY_JSON"
|
||||
case 103: // "ACTION_CTL_BDY_XML"
|
||||
case 104: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
|
||||
case 105: // "ACTION_CTL_REQUEST_BODY_ACCESS"
|
||||
case 106: // "ACTION_CTL_RULE_ENGINE"
|
||||
case 94: // "Accuracy"
|
||||
case 95: // "Allow"
|
||||
case 96: // "Append"
|
||||
case 97: // "AuditLog"
|
||||
case 98: // "Block"
|
||||
case 99: // "Capture"
|
||||
case 100: // "Chain"
|
||||
case 101: // "ACTION_CTL_AUDIT_ENGINE"
|
||||
case 102: // "ACTION_CTL_AUDIT_LOG_PARTS"
|
||||
case 103: // "ACTION_CTL_BDY_JSON"
|
||||
case 104: // "ACTION_CTL_BDY_XML"
|
||||
case 105: // "ACTION_CTL_FORCE_REQ_BODY_VAR"
|
||||
case 106: // "ACTION_CTL_REQUEST_BODY_ACCESS"
|
||||
case 107: // "ACTION_CTL_RULE_REMOVE_BY_ID"
|
||||
case 108: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID"
|
||||
case 109: // "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG"
|
||||
@@ -4370,6 +4366,12 @@ namespace yy {
|
||||
return symbol_type (token::TOK_NOT, l);
|
||||
}
|
||||
|
||||
seclang_parser::symbol_type
|
||||
seclang_parser::make_ACTION_CTL_RULE_ENGINE (const location_type& l)
|
||||
{
|
||||
return symbol_type (token::TOK_ACTION_CTL_RULE_ENGINE, l);
|
||||
}
|
||||
|
||||
seclang_parser::symbol_type
|
||||
seclang_parser::make_ACTION_ACCURACY (const std::string& v, const location_type& l)
|
||||
{
|
||||
@@ -4448,12 +4450,6 @@ namespace yy {
|
||||
return symbol_type (token::TOK_ACTION_CTL_REQUEST_BODY_ACCESS, v, l);
|
||||
}
|
||||
|
||||
seclang_parser::symbol_type
|
||||
seclang_parser::make_ACTION_CTL_RULE_ENGINE (const std::string& v, const location_type& l)
|
||||
{
|
||||
return symbol_type (token::TOK_ACTION_CTL_RULE_ENGINE, v, l);
|
||||
}
|
||||
|
||||
seclang_parser::symbol_type
|
||||
seclang_parser::make_ACTION_CTL_RULE_REMOVE_BY_ID (const std::string& v, const location_type& l)
|
||||
{
|
||||
@@ -5555,7 +5551,7 @@ namespace yy {
|
||||
|
||||
|
||||
} // yy
|
||||
#line 5559 "seclang-parser.hh" // lalr1.cc:377
|
||||
#line 5555 "seclang-parser.hh" // lalr1.cc:377
|
||||
|
||||
|
||||
|
||||
|
@@ -24,6 +24,7 @@ class Driver;
|
||||
#include "src/actions/chain.h"
|
||||
#include "src/actions/ctl/audit_log_parts.h"
|
||||
#include "src/actions/ctl/request_body_access.h"
|
||||
#include "src/actions/ctl/rule_engine.h"
|
||||
#include "src/actions/ctl/request_body_processor_json.h"
|
||||
#include "src/actions/ctl/request_body_processor_xml.h"
|
||||
#include "src/actions/ctl/rule_remove_by_id.h"
|
||||
@@ -441,7 +442,9 @@ using modsecurity::operators::Operator;
|
||||
SETVAR_OPERATION_EQUALS_PLUS
|
||||
SETVAR_OPERATION_EQUALS_MINUS
|
||||
NOT "NOT"
|
||||
;
|
||||
|
||||
ACTION_CTL_RULE_ENGINE "ACTION_CTL_RULE_ENGINE"
|
||||
;
|
||||
|
||||
%token <std::string>
|
||||
ACTION_ACCURACY "Accuracy"
|
||||
@@ -457,7 +460,6 @@ using modsecurity::operators::Operator;
|
||||
ACTION_CTL_BDY_XML "ACTION_CTL_BDY_XML"
|
||||
ACTION_CTL_FORCE_REQ_BODY_VAR "ACTION_CTL_FORCE_REQ_BODY_VAR"
|
||||
ACTION_CTL_REQUEST_BODY_ACCESS "ACTION_CTL_REQUEST_BODY_ACCESS"
|
||||
ACTION_CTL_RULE_ENGINE "ACTION_CTL_RULE_ENGINE"
|
||||
ACTION_CTL_RULE_REMOVE_BY_ID "ACTION_CTL_RULE_REMOVE_BY_ID"
|
||||
ACTION_CTL_RULE_REMOVE_TARGET_BY_ID "ACTION_CTL_RULE_REMOVE_TARGET_BY_ID"
|
||||
ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG "ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG"
|
||||
@@ -2087,18 +2089,15 @@ act:
|
||||
}
|
||||
| ACTION_CTL_RULE_ENGINE CONFIG_VALUE_ON
|
||||
{
|
||||
//ACTION_NOT_SUPPORTED("CtlRuleEngine", @0);
|
||||
ACTION_CONTAINER($$, new actions::Action($1));
|
||||
ACTION_CONTAINER($$, new actions::ctl::RuleEngine("ctl:RuleEngine=on"));
|
||||
}
|
||||
| ACTION_CTL_RULE_ENGINE CONFIG_VALUE_OFF
|
||||
{
|
||||
//ACTION_NOT_SUPPORTED("CtlRuleEngine", @0);
|
||||
ACTION_CONTAINER($$, new actions::Action($1));
|
||||
ACTION_CONTAINER($$, new actions::ctl::RuleEngine("ctl:RuleEngine=off"));
|
||||
}
|
||||
| ACTION_CTL_RULE_ENGINE CONFIG_VALUE_DETC
|
||||
{
|
||||
//ACTION_NOT_SUPPORTED("CtlRuleEngine", @0);
|
||||
ACTION_CONTAINER($$, new actions::Action($1));
|
||||
ACTION_CONTAINER($$, new actions::ctl::RuleEngine("ctl:RuleEngine=detectiononly"));
|
||||
}
|
||||
| ACTION_CTL_RULE_REMOVE_BY_ID
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -415,7 +415,7 @@ EQUALS_MINUS (?i:=\-)
|
||||
{ACTION_CTL_BDY_XML} { return p::make_ACTION_CTL_BDY_XML(yytext, *driver.loc.back()); }
|
||||
{ACTION_CTL_FORCE_REQ_BODY_VAR}= { return p::make_ACTION_CTL_FORCE_REQ_BODY_VAR(yytext, *driver.loc.back()); }
|
||||
{ACTION_CTL_REQUEST_BODY_ACCESS}= { return p::make_ACTION_CTL_REQUEST_BODY_ACCESS(yytext, *driver.loc.back()); }
|
||||
{ACTION_CTL_RULE_ENGINE}= { return p::make_ACTION_CTL_RULE_ENGINE(yytext, *driver.loc.back()); }
|
||||
{ACTION_CTL_RULE_ENGINE}= { return p::make_ACTION_CTL_RULE_ENGINE(*driver.loc.back()); }
|
||||
{ACTION_CTL_RULE_REMOVE_BY_ID}[=]{REMOVE_RULE_BY} { return p::make_ACTION_CTL_RULE_REMOVE_BY_ID(yytext, *driver.loc.back()); }
|
||||
{ACTION_CTL_RULE_REMOVE_TARGET_BY_ID}[=]{REMOVE_RULE_BY} { return p::make_ACTION_CTL_RULE_REMOVE_TARGET_BY_ID(yytext, *driver.loc.back()); }
|
||||
{ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG}[=]{REMOVE_RULE_BY} { return p::make_ACTION_CTL_RULE_REMOVE_TARGET_BY_TAG(yytext, *driver.loc.back()); }
|
||||
|
Reference in New Issue
Block a user