Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf86a71f

Browse files
author
Felipe Zimmerle
committed
Adds SecStatusEngine On/Off switch
Add the possibility to turn the Status Engine On or Off using thedirective SecStatusEngine [On/Off]. By default it is On.
1 parent0c6a661 commitf86a71f

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

‎apache2/apache2_config.c‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,6 +2083,23 @@ static const char *cmd_rule_engine(cmd_parms *cmd, void *_dcfg, const char *p1)
20832083
returnNULL;
20842084
}
20852085

2086+
staticconstchar*cmd_STATUS_ENGINE(cmd_parms*cmd,void*_dcfg,constchar*p1)
2087+
{
2088+
if (strcasecmp(p1,"on")==0) {
2089+
status_engine_state=STATUS_ENGINE_ENABLED;
2090+
}
2091+
elseif (strcasecmp(p1,"off")==0) {
2092+
status_engine_state=STATUS_ENGINE_DISABLED;
2093+
}
2094+
else {
2095+
returnapr_psprintf(cmd->pool,"ModSecurity: Invalid value for " \
2096+
"SecStatusEngine: %s",p1);
2097+
}
2098+
2099+
returnNULL;
2100+
}
2101+
2102+
20862103
staticconstchar*cmd_rule_inheritance(cmd_parms*cmd,void*_dcfg,intflag)
20872104
{
20882105
directory_config*dcfg= (directory_config*)_dcfg;
@@ -3297,6 +3314,14 @@ const command_rec module_directives[] = {
32973314
"On or Off"
32983315
),
32993316

3317+
AP_INIT_TAKE1 (
3318+
"SecStatusEngine",
3319+
cmd_status_engine,
3320+
NULL,
3321+
CMD_SCOPE_ANY,
3322+
"On or Off"
3323+
),
3324+
33003325
AP_INIT_TAKE1 (
33013326
"SecXmlExternalEntity",
33023327
cmd_xml_external_entity,

‎apache2/mod_security2.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ unsigned long int DSOLOCAL msc_pcre_match_limit = 0;
6161

6262
unsigned longintDSOLOCALmsc_pcre_match_limit_recursion=0;
6363

64+
intDSOLOCALstatus_engine_state=STATUS_ENGINE_ENABLED;
65+
6466
unsigned longintDSOLOCALconn_read_state_limit=0;
6567

6668
unsigned longintDSOLOCALconn_write_state_limit=0;
@@ -724,7 +726,14 @@ static int hook_post_config(apr_pool_t *mp, apr_pool_t *mp_log, apr_pool_t *mp_t
724726
"Original server signature: %s",real_server_signature);
725727
}
726728

727-
msc_status_engine_call();
729+
if (status_engine_state!=STATUS_ENGINE_DISABLED) {
730+
msc_status_engine_call();
731+
}
732+
else {
733+
ap_log_error(APLOG_MARK,APLOG_NOTICE,0,NULL,
734+
"Status engine is currently disabled, enable it by set " \
735+
"SecStatusEngine to On.");
736+
}
728737
}
729738

730739
srand((unsignedint)(time(NULL)*getpid()));

‎apache2/modsecurity.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ extern DSOLOCAL unsigned long int msc_pcre_match_limit;
142142

143143
externDSOLOCAL unsigned longintmsc_pcre_match_limit_recursion;
144144

145+
externDSOLOCALintstatus_engine_state;
146+
145147
externDSOLOCAL unsigned longintconn_read_state_limit;
146148

147149
externDSOLOCAL unsigned longintconn_write_state_limit;
@@ -182,6 +184,9 @@ extern DSOLOCAL int *unicode_map_table;
182184
#defineMODSEC_DETECTION_ONLY 1
183185
#defineMODSEC_ENABLED 2
184186

187+
#defineSTATUS_ENGINE_ENABLED 1
188+
#defineSTATUS_ENGINE_DISABLED 0
189+
185190
#defineHASH_DISABLED 0
186191
#defineHASH_ENABLED 1
187192

‎apache2/msc_status_engine.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include"apr_optional.h"
2222
#include"msc_pcre.h"
2323

24-
#defineSTATUS_ENGINE_DNS_IN_BETWEEN_DOTS13
24+
#defineSTATUS_ENGINE_DNS_IN_BETWEEN_DOTS32
2525

2626
#defineSTATUS_ENGINE_DNS_SUFFIX "status.modsecurity.org"
2727

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp