diff --git a/src/parser/seclang-scanner.ll b/src/parser/seclang-scanner.ll index 31143869..9ef6176b 100755 --- a/src/parser/seclang-scanner.ll +++ b/src/parser/seclang-scanner.ll @@ -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; diff --git a/test/benchmark/basic_rules.conf b/test/benchmark/basic_rules.conf index 947c0550..c08e8322 100644 --- a/test/benchmark/basic_rules.conf +++ b/test/benchmark/basic_rules.conf @@ -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"