mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
Adds MODSEC_BUILD variable
This commit is contained in:
@@ -17,6 +17,7 @@ class Driver;
|
||||
#include "rule.h"
|
||||
#include "variable_duration.h"
|
||||
#include "variable_env.h"
|
||||
#include "variable_modsec_build.h"
|
||||
|
||||
using ModSecurity::actions::Action;
|
||||
using ModSecurity::actions::transformations::Transformation;
|
||||
@@ -24,6 +25,7 @@ using ModSecurity::operators::Operator;
|
||||
using ModSecurity::Variable;
|
||||
using ModSecurity::VariableDuration;
|
||||
using ModSecurity::VariableEnv;
|
||||
using ModSecurity::VariableModsecBuild;
|
||||
using ModSecurity::Rule;
|
||||
|
||||
}
|
||||
@@ -86,6 +88,7 @@ using ModSecurity::Rule;
|
||||
%token <std::string> VARIABLE
|
||||
%token <std::string> RUN_TIME_VAR_DUR
|
||||
%token <std::string> RUN_TIME_VAR_ENV
|
||||
%token <std::string> RUN_TIME_VAR_BLD
|
||||
|
||||
%token <std::string> OPERATOR
|
||||
%token <std::string> ACTION
|
||||
@@ -273,6 +276,18 @@ variables:
|
||||
variables->push_back(new VariableEnv($1));
|
||||
$$ = variables;
|
||||
}
|
||||
| variables PIPE RUN_TIME_VAR_BLD
|
||||
{
|
||||
std::vector<Variable *> *v = $1;
|
||||
v->push_back(new VariableModsecBuild($3));
|
||||
$$ = $1;
|
||||
}
|
||||
| RUN_TIME_VAR_BLD
|
||||
{
|
||||
std::vector<Variable *> *variables = new std::vector<Variable *>;
|
||||
variables->push_back(new VariableModsecBuild($1));
|
||||
$$ = variables;
|
||||
}
|
||||
|
||||
actions:
|
||||
actions COMMA SPACE ACTION
|
||||
|
@@ -59,6 +59,7 @@ TRANSFORMATION t:(lowercase|urlDecodeUni|urlDecode|none|compressWhitespace|remo
|
||||
VARIABLE (?i:FULL_REQUEST|FILES|AUTH_TYPE|ARGS_NAMES|ARGS|QUERY_STRING|REMOTE_ADDR|REQUEST_BASENAME|REQUEST_BODY|REQUEST_COOKIES_NAMES|REQUEST_COOKIES|REQUEST_FILENAME|REQUEST_HEADERS_NAMES|REQUEST_HEADERS|REQUEST_METHOD|REQUEST_PROTOCOL|REQUEST_URI|RESPONSE_BODY|RESPONSE_CONTENT_LENGTH|RESPONSE_CONTENT_TYPE|RESPONSE_HEADERS_NAMES|RESPONSE_HEADERS|RESPONSE_PROTOCOL|RESPONSE_STATUS|TX)
|
||||
RUN_TIME_VAR_DUR (?i:DURATION)
|
||||
RUN_TIME_VAR_ENV (?i:ENV)
|
||||
RUN_TIME_VAR_BLD (?i:MODSEC_BUILD)
|
||||
|
||||
VARIABLENOCOLON (?i:REQBODY_ERROR|MULTIPART_STRICT_ERROR|MULTIPART_UNMATCHED_BOUNDARY|REMOTE_ADDR|REQUEST_LINE)
|
||||
|
||||
@@ -112,6 +113,7 @@ FREE_TEXT [^\"]+
|
||||
{VARIABLE}:?{DICT_ELEMENT}? { return yy::seclang_parser::make_VARIABLE(yytext, loc); }
|
||||
{RUN_TIME_VAR_DUR} { return yy::seclang_parser::make_RUN_TIME_VAR_DUR(yytext, loc); }
|
||||
{RUN_TIME_VAR_ENV}:?{DICT_ELEMENT}? { return yy::seclang_parser::make_RUN_TIME_VAR_ENV(yytext, loc); }
|
||||
{RUN_TIME_VAR_BLD} { return yy::seclang_parser::make_RUN_TIME_VAR_BLD(yytext, loc); }
|
||||
|
||||
|
||||
{CONFIG_COMPONENT_SIG}[ ]["]{FREE_TEXT}["] { return yy::seclang_parser::make_CONFIG_COMPONENT_SIG(strchr(yytext, ' ') + 2, loc); }
|
||||
|
Reference in New Issue
Block a user