Skip to content

Commit

Permalink
Option to disable logging of log producer in audit log when log level…
Browse files Browse the repository at this point in the history
… < 9.

[Issue owasp-modsecurity#1069 - Marc Stern]
  • Loading branch information
marcstern committed Apr 27, 2017
1 parent 2c07a17 commit f586924
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES
@@ -1,6 +1,9 @@
DD MMM YYYY - 2.9.2 - To be released
------------------------------------

* {dis|en}able-dechunk-logging: Option to disable logging of
dechunking in audit log when log level < 9.
[Issue #1068 - Marc Stern]
* {dis|en}able-handler-logging: Option to disable logging of Apache handler
in audit log
[Issue #1070, #1381 - Marc Stern]
Expand Down
6 changes: 6 additions & 0 deletions apache2/msc_logging.c
Expand Up @@ -1174,6 +1174,9 @@ void sec_audit_logger_json(modsec_rec *msr) {
yajl_kv_bool(g, "response_body_dechunked", 1);
}

#ifdef LOG_NO_PRODUCER
if (msr->txcfg->debuglog_level >= 9) {
#endif
sec_auditlog_write_producer_header_json(msr, g);

/* Server */
Expand Down Expand Up @@ -1323,6 +1326,9 @@ void sec_audit_logger_json(modsec_rec *msr) {
}
}

#ifdef LOG_NO_PRODUCER
}
#endif
yajl_gen_map_close(g); // audit_data top-level key is finished

/* AUDITLOG_PART_UPLOADS */
Expand Down
17 changes: 16 additions & 1 deletion configure.ac
Expand Up @@ -487,6 +487,21 @@ AC_ARG_ENABLE(handler-logging,
log_handler=''
])

# Disable logging of log producer
AC_ARG_ENABLE(log-producer-logging,
AS_HELP_STRING([--enable-log-producer-logging],
[Enable logging of log producer in audit log when log level < 9. This is the default]),
[
if test "$enableval" != "no"; then
log_producer=
else
log_producer="-DLOG_NO_PRODUCER"
fi
],
[
log_producer=''
])

# Ignore configure errors
AC_ARG_ENABLE(errors,
AS_HELP_STRING([--disable-errors],
Expand Down Expand Up @@ -737,7 +752,7 @@ else
fi
fi

MODSEC_EXTRA_CFLAGS="$pcre_study $pcre_match_limit $pcre_match_limit_recursion $pcre_jit $request_early $htaccess_config $lua_cache $debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api $cpu_type $unique_id $log_filename $log_server $log_collection_delete_problem"
MODSEC_EXTRA_CFLAGS="$pcre_study $pcre_match_limit $pcre_match_limit_recursion $pcre_jit $request_early $htaccess_config $lua_cache $debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api $cpu_type $unique_id $log_filename $log_server $log_collection_delete_problem $log_producer"

APXS_WRAPPER=build/apxs-wrapper
APXS_EXTRA_CFLAGS=""
Expand Down

0 comments on commit f586924

Please sign in to comment.