mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Adds support to include path between quotes
This commit is contained in:
parent
b497091017
commit
70e2a4b379
@ -382,6 +382,23 @@ CONFIG_DIR_UNICODE_MAP_FILE (?i:SecUnicodeMapFile)
|
||||
yypush_buffer_state(yy_create_buffer( yyin, YY_BUF_SIZE ));
|
||||
}
|
||||
|
||||
{CONFIG_INCLUDE}[ ]["]{CONFIG_VALUE_PATH}["] {
|
||||
const char *file = strchr(yytext, ' ') + 1;
|
||||
char *f = strdup(file + 1);
|
||||
f[strlen(f)-1] = '\0';
|
||||
yyin = fopen(f, "r" );
|
||||
if (!yyin) {
|
||||
BEGIN(INITIAL);
|
||||
driver.error (*driver.loc.back(), "", yytext + std::string(": Not able to open file."));
|
||||
throw yy::seclang_parser::syntax_error(*driver.loc.back(), "");
|
||||
}
|
||||
free(f);
|
||||
driver.ref.push_back(file);
|
||||
driver.loc.push_back(new yy::location());
|
||||
yypush_buffer_state(yy_create_buffer( yyin, YY_BUF_SIZE ));
|
||||
}
|
||||
|
||||
|
||||
{CONFIG_SEC_REMOTE_RULES}[ ][^ ]+[ ][^\n\r ]+ {
|
||||
HttpsClient c;
|
||||
std::string key;
|
||||
|
@ -1,3 +1 @@
|
||||
SecRule ARGS "@contains /test.txt" "allow"
|
||||
SecRule ARGS:teste "@contains /test.txt" " allow,deny"
|
||||
SecRule ARGS "@contains /test.txt" "allow, allow,deny"
|
||||
include "owasp-modsecurity-crs-orig/modsecurity_crs_10_setup.conf"
|
||||
|
Loading…
x
Reference in New Issue
Block a user