mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-17 14:46:13 +03:00
Fixed noauditlog. See #451.
This commit is contained in:
parent
52ccced72b
commit
4c6dccada2
@ -333,6 +333,10 @@ static int is_response_status_relevant(modsec_rec *msr, int status) {
|
|||||||
apr_status_t rc;
|
apr_status_t rc;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
|
/* ENH: Setting is_relevant here will cause an audit even if noauditlog
|
||||||
|
* was set for the last rule that matched. Is this what we want?
|
||||||
|
*/
|
||||||
|
|
||||||
if ((msr->txcfg->auditlog_relevant_regex == NULL)
|
if ((msr->txcfg->auditlog_relevant_regex == NULL)
|
||||||
||(msr->txcfg->auditlog_relevant_regex == NOT_SET_P))
|
||(msr->txcfg->auditlog_relevant_regex == NOT_SET_P))
|
||||||
{
|
{
|
||||||
|
11
apache2/re.c
11
apache2/re.c
@ -1585,8 +1585,11 @@ static void msre_perform_disruptive_actions(modsec_rec *msr, msre_rule *rule,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If "noauditlog" was used do not mark the transaction for audit logging. */
|
/* If "noauditlog" used do not mark the transaction for audit logging. */
|
||||||
if (actionset->auditlog == 1) {
|
if (actionset->auditlog == 0) {
|
||||||
|
msr->is_relevant = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
msr->is_relevant++;
|
msr->is_relevant++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1598,8 +1601,8 @@ static void msre_perform_disruptive_actions(modsec_rec *msr, msre_rule *rule,
|
|||||||
|| (msr->modsecurity->processing_mode == MODSEC_OFFLINE)
|
|| (msr->modsecurity->processing_mode == MODSEC_OFFLINE)
|
||||||
|| (actionset->intercept_action == ACTION_NONE))
|
|| (actionset->intercept_action == ACTION_NONE))
|
||||||
{
|
{
|
||||||
/* If "nolog" was used log at a higher level. */
|
/* If "no(audit)?log" was used log at a higher level. */
|
||||||
msc_alert(msr, (actionset->log == 0 ? 4 : 2), actionset,
|
msc_alert(msr, ((actionset->log == 0) || (actionset->auditlog == 0) ? 4 : 2), actionset,
|
||||||
"Warning.", message);
|
"Warning.", message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user