mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds more regression tests to SecRemoteRules
This commit is contained in:
@@ -323,11 +323,11 @@ expression:
|
||||
{
|
||||
driver.responseBodyLimitAction = ModSecurity::Rules::BodyLimitAction::RejectBodyLimitAction;
|
||||
}
|
||||
| CONFIG_SEC_REMOTE_RULES_FAIL_ACTION CONFIG_VALUE_ABORT
|
||||
| CONFIG_SEC_REMOTE_RULES_FAIL_ACTION SPACE CONFIG_VALUE_ABORT
|
||||
{
|
||||
driver.remoteRulesActionOnFailed = Rules::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction;
|
||||
}
|
||||
| CONFIG_SEC_REMOTE_RULES_FAIL_ACTION CONFIG_VALUE_WARN
|
||||
| CONFIG_SEC_REMOTE_RULES_FAIL_ACTION SPACE CONFIG_VALUE_WARN
|
||||
{
|
||||
driver.remoteRulesActionOnFailed = Rules::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction;
|
||||
}
|
||||
|
@@ -236,6 +236,7 @@ FREE_TEXT_NEW_LINE [^\"|\n]+
|
||||
std::vector<std::string> conf = split(yytext, ' ');
|
||||
key = conf[1];
|
||||
url = conf[2];
|
||||
|
||||
driver.ref.push_back(url);
|
||||
driver.loc.push_back(*(new yy::location()));
|
||||
YY_BUFFER_STATE temp = YY_CURRENT_BUFFER;
|
||||
@@ -244,13 +245,12 @@ FREE_TEXT_NEW_LINE [^\"|\n]+
|
||||
bool ret = c.download(url);
|
||||
|
||||
if (ret == false) {
|
||||
/**
|
||||
* TODO: Implement the fail action.
|
||||
*
|
||||
*/
|
||||
if (driver.remoteRulesActionOnFailed == Rules::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction) {
|
||||
/** TODO: Implement the server logging mechanism. */
|
||||
}
|
||||
if (driver.remoteRulesActionOnFailed == Rules::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction) {
|
||||
driver.error (driver.loc.back(), "", yytext + std::string(" - Failed to download: ") + c.error);
|
||||
throw yy::seclang_parser::syntax_error(driver.loc.back(), "");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user