mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Initial support to load rules from a remote server
New directive `SecRemoteRules' was added. It allows the user to load a set of rules from a given HTTP server.
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "apr_version.h"
|
||||
|
||||
#include "msc_remote_rules.h"
|
||||
|
||||
#if defined(WITH_LUA)
|
||||
#include "msc_lua.h"
|
||||
#endif
|
||||
@@ -66,6 +68,8 @@ unsigned long int DSOLOCAL msc_pcre_match_limit = 0;
|
||||
|
||||
unsigned long int DSOLOCAL msc_pcre_match_limit_recursion = 0;
|
||||
|
||||
msc_remote_rules_server DSOLOCAL *remote_rules_server = NULL;
|
||||
|
||||
int DSOLOCAL status_engine_state = STATUS_ENGINE_DISABLED;
|
||||
|
||||
int DSOLOCAL conn_limits_filter_state = MODSEC_DISABLED;
|
||||
@@ -752,6 +756,24 @@ static int hook_post_config(apr_pool_t *mp, apr_pool_t *mp_log, apr_pool_t *mp_t
|
||||
"SecStatusEngine to On.");
|
||||
}
|
||||
#endif
|
||||
|
||||
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 rule from: '%s'.",
|
||||
remote_rules_server->amount_of_rules,
|
||||
remote_rules_server->uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
srand((unsigned int)(time(NULL) * getpid()));
|
||||
|
Reference in New Issue
Block a user