mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Adds modsecStatusEngineCall to standalone API
In ModSecurityIIS the configuration is loaded upon the first request is received. In other words, SecStatusEngine value can be only loaded once the first request hit the server, and so, the status function was moved to proceed just after the configuration got loaded. This update is IIS only.
This commit is contained in:
parent
d75e443b9b
commit
20014c808c
@ -726,6 +726,7 @@ static int hook_post_config(apr_pool_t *mp, apr_pool_t *mp_log, apr_pool_t *mp_t
|
||||
"Original server signature: %s", real_server_signature);
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
if (status_engine_state != STATUS_ENGINE_DISABLED) {
|
||||
msc_status_engine_call();
|
||||
}
|
||||
@ -734,6 +735,7 @@ static int hook_post_config(apr_pool_t *mp, apr_pool_t *mp_log, apr_pool_t *mp_t
|
||||
"Status engine is currently disabled, enable it by set " \
|
||||
"SecStatusEngine to On.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
srand((unsigned int)(time(NULL) * getpid()));
|
||||
|
@ -356,8 +356,8 @@ int msc_status_engine_call (void) {
|
||||
}
|
||||
|
||||
apr_snprintf(beacon_string, beacon_string_len+1+10+4,
|
||||
"%s,%s/IIS,%s/%s,%s/%s,%s/%s,%s/%s,%s",
|
||||
modsec, apache, apr, apr_loaded, pcre, pcre_loaded, lua, lua_loaded,
|
||||
"%s,IIS,%s/%s,%s/%s,%s/%s,%s/%s,%s",
|
||||
modsec, apr, apr_loaded, pcre, pcre_loaded, lua, lua_loaded,
|
||||
libxml, libxml_loaded, id);
|
||||
#else
|
||||
beacon_string = malloc(sizeof(char)*(beacon_string_len+1+10));
|
||||
|
@ -21,7 +21,11 @@
|
||||
#include "apr_optional.h"
|
||||
#include "msc_pcre.h"
|
||||
|
||||
#ifndef WIN32
|
||||
#define STATUS_ENGINE_DNS_IN_BETWEEN_DOTS 32
|
||||
#else
|
||||
#define STATUS_ENGINE_DNS_IN_BETWEEN_DOTS 30
|
||||
#endif
|
||||
|
||||
#define STATUS_ENGINE_DNS_SUFFIX "status.modsecurity.org"
|
||||
|
||||
|
@ -796,6 +796,9 @@ CMyHttpModule::OnBeginRequest(
|
||||
delete path;
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
modsecStatusEngineCall();
|
||||
|
||||
}
|
||||
delete apppath;
|
||||
}
|
||||
|
@ -701,3 +701,16 @@ const char *modsecIsServerSignatureAvailale(void) {
|
||||
return new_server_signature;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
void modsecStatusEngineCall()
|
||||
{
|
||||
if (status_engine_state != STATUS_ENGINE_DISABLED) {
|
||||
msc_status_engine_call();
|
||||
}
|
||||
else {
|
||||
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
|
||||
"Status engine is currently disabled, enable it by set " \
|
||||
"SecStatusEngine to On.\n");
|
||||
}
|
||||
}
|
||||
#endif
|
@ -119,6 +119,10 @@ void modsecSetConfigForIISRequestBody(request_rec *r);
|
||||
|
||||
const char *modsecIsServerSignatureAvailale(void);
|
||||
|
||||
#ifdef WIN32
|
||||
void modsecStatusEngineCall(void);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user