mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Improves SecRemoteRules messages on IIS
IIS was not displaying correctly the error messages and the amount of loaded rules while the operator SecRemoteRules was used.
This commit is contained in:
@@ -705,7 +705,7 @@ const char *modsecIsServerSignatureAvailale(void) {
|
||||
return new_server_signature;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef VERSION_IIS
|
||||
void modsecStatusEngineCall()
|
||||
{
|
||||
if (status_engine_state != STATUS_ENGINE_DISABLED) {
|
||||
@@ -717,4 +717,34 @@ void modsecStatusEngineCall()
|
||||
"SecStatusEngine to On.\n");
|
||||
}
|
||||
}
|
||||
|
||||
void modsecReportRemoteLoadedRules()
|
||||
{
|
||||
#ifdef WITH_REMOTE_RULES
|
||||
if (remote_rules_server != NULL)
|
||||
{
|
||||
if (remote_rules_server->amount_of_rules == 1)
|
||||
{
|
||||
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
|
||||
"ModSecurity: Loaded %d rule from: '%s'.",
|
||||
remote_rules_server->amount_of_rules,
|
||||
remote_rules_server->uri);
|
||||
}
|
||||
else
|
||||
{
|
||||
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
|
||||
"ModSecurity: Loaded %d rules from: '%s'.",
|
||||
remote_rules_server->amount_of_rules,
|
||||
remote_rules_server->uri);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (remote_rules_fail_message != NULL)
|
||||
{
|
||||
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, "ModSecurity: " \
|
||||
"Problems loading external resources: %s",
|
||||
remote_rules_fail_message);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@@ -119,8 +119,9 @@ void modsecSetConfigForIISRequestBody(request_rec *r);
|
||||
|
||||
const char *modsecIsServerSignatureAvailale(void);
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef VERSION_IIS
|
||||
void modsecStatusEngineCall(void);
|
||||
void modsecReportRemoteLoadedRules(void);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Reference in New Issue
Block a user