mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Informs problems and successfully loaded external resources during reload
Resources load mechanism as the SecRemoteRuels were not showing information about the loaded rules while Apache was reloaded. This patch add such information to reload in the same way that it was showing on restart.
This commit is contained in:
parent
fe22446bdd
commit
dc81e4f852
2
CHANGES
2
CHANGES
@ -1,6 +1,8 @@
|
|||||||
DD mmm YYYY - 2.9.????? (To be released)
|
DD mmm YYYY - 2.9.????? (To be released)
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
* Informs about external resources loaded/failed while reloading Apache.
|
||||||
|
[ModSecurity team]
|
||||||
* Adds missing 'ModSecurity:' prefix in some warnings messages.
|
* Adds missing 'ModSecurity:' prefix in some warnings messages.
|
||||||
[Walter Hop and ModSecurity team]
|
[Walter Hop and ModSecurity team]
|
||||||
* Refactoring external resources download warn messages. Holding the message
|
* Refactoring external resources download warn messages. Holding the message
|
||||||
|
@ -762,14 +762,15 @@ static int hook_post_config(apr_pool_t *mp, apr_pool_t *mp_log, apr_pool_t *mp_t
|
|||||||
"it by set SecStatusEngine to On.");
|
"it by set SecStatusEngine to On.");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (remote_rules_fail_message != NULL)
|
/**
|
||||||
{
|
* Checking if it is not the first time that we are in this very function.
|
||||||
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, "ModSecurity: " \
|
* We want to show the messages below during the start and the reload.
|
||||||
"Problems loading external resources: %s",
|
*
|
||||||
remote_rules_fail_message);
|
*/
|
||||||
}
|
if (first_time != 1)
|
||||||
|
{
|
||||||
#ifdef WITH_REMOTE_RULES
|
#ifdef WITH_REMOTE_RULES
|
||||||
if (remote_rules_server != NULL)
|
if (remote_rules_server != NULL)
|
||||||
{
|
{
|
||||||
@ -789,6 +790,12 @@ static int hook_post_config(apr_pool_t *mp, apr_pool_t *mp_log, apr_pool_t *mp_t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
srand((unsigned int)(time(NULL) * getpid()));
|
srand((unsigned int)(time(NULL) * getpid()));
|
||||||
|
@ -1293,7 +1293,12 @@ static int msre_op_pmFromFile_param_init(msre_rule *rule, char **error_msg) {
|
|||||||
|
|
||||||
res = msc_remote_download_content(rule->ruleset->mp, fn, NULL,
|
res = msc_remote_download_content(rule->ruleset->mp, fn, NULL,
|
||||||
&chunk, error_msg);
|
&chunk, error_msg);
|
||||||
if (res == -1)
|
if (res == -2)
|
||||||
|
{
|
||||||
|
/* If download failed but SecRemoteRulesFailAction is set to Warn. */
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else if (res < 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user