mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds initial support to initcol action
This commit is contained in:
@@ -21,6 +21,7 @@ class Driver;
|
||||
#include "actions/action.h"
|
||||
#include "actions/audit_log.h"
|
||||
#include "actions/ctl_audit_log_parts.h"
|
||||
#include "actions/init_col.h"
|
||||
#include "actions/set_var.h"
|
||||
#include "actions/severity.h"
|
||||
#include "actions/skip_after.h"
|
||||
@@ -59,6 +60,7 @@ using modsecurity::ModSecurity;
|
||||
|
||||
using modsecurity::actions::Action;
|
||||
using modsecurity::actions::CtlAuditLogParts;
|
||||
using modsecurity::actions::InitCol;
|
||||
using modsecurity::actions::SetVar;
|
||||
using modsecurity::actions::Severity;
|
||||
using modsecurity::actions::Tag;
|
||||
@@ -794,7 +796,12 @@ act:
|
||||
}
|
||||
| ACTION_INITCOL
|
||||
{
|
||||
$$ = Action::instantiate($1);
|
||||
std::string error;
|
||||
$$ = new InitCol($1);
|
||||
if ($$->init(&error) == false) {
|
||||
driver.error(@0, error);
|
||||
YYERROR;
|
||||
}
|
||||
}
|
||||
| TRANSFORMATION
|
||||
{
|
||||
|
@@ -155,10 +155,14 @@ FREE_TEXT_SPACE [^ \t]+
|
||||
FREE_TEXT_SPACE_COMMA [^, \t]+
|
||||
FREE_TEXT_SPACE_COMMA_QUOTE [^, \t\"]+
|
||||
|
||||
COL_NAME [A-Za-z]+
|
||||
COL_FREE_TEXT_SPACE_COMMA ([^,])+
|
||||
|
||||
VAR_FREE_TEXT_QUOTE ([^\']|([^\\]\\\'))+
|
||||
VAR_FREE_TEXT_SPACE_COMMA [^, \t\"]+
|
||||
VAR_FREE_TEXT_SPACE [^ \t\"]+
|
||||
|
||||
|
||||
SOMETHING ["]{1}[^@]{1}([^"]|([^\\"]\\\"))*["]{1}
|
||||
|
||||
CONFIG_DIR_UNICODE_MAP_FILE (?i:SecUnicodeMapFile)
|
||||
@@ -333,7 +337,7 @@ CONFIG_DIR_UNICODE_MAP_FILE (?i:SecUnicodeMapFile)
|
||||
{ACTION_ACCURACY}:{FREE_TEXT_QUOTE} { return yy::seclang_parser::make_ACTION_ACCURACY(strchr(yytext, ':') + 1, *driver.loc.back()); }
|
||||
{ACTION_CTL_BDY_XML} { return yy::seclang_parser::make_ACTION_CTL_BDY_XML(yytext, *driver.loc.back()); }
|
||||
{ACTION_CTL_BDY_JSON} { return yy::seclang_parser::make_ACTION_CTL_BDY_JSON(yytext, *driver.loc.back()); }
|
||||
{ACTION_INITCOL}:{FREE_TEXT_QUOTE}={FREE_TEXT_SPACE_COMMA} { return yy::seclang_parser::make_ACTION_INITCOL(yytext, *driver.loc.back()); }
|
||||
{ACTION_INITCOL}:{COL_NAME}={COL_FREE_TEXT_SPACE_COMMA} { return yy::seclang_parser::make_ACTION_INITCOL(yytext, *driver.loc.back()); }
|
||||
|
||||
["] { return yy::seclang_parser::make_QUOTATION_MARK(yytext, *driver.loc.back()); }
|
||||
[,] { return yy::seclang_parser::make_COMMA(*driver.loc.back()); }
|
||||
|
Reference in New Issue
Block a user