mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
{dis|en}able-filename-logging: Option to disable logging of filename in audit log [Issue #1065 - Marc Stern]
This commit is contained in:
parent
42c819d1b9
commit
c1c91e24cd
3
CHANGES
3
CHANGES
@ -1,6 +1,9 @@
|
|||||||
DD MMM YYYY - 2.9.2 - To be released
|
DD MMM YYYY - 2.9.2 - To be released
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
|
* {dis|en}able-filename-logging: Option to disable logging of filename
|
||||||
|
in audit log.
|
||||||
|
[Issue #1065 - Marc Stern]
|
||||||
* Reads fuzzy hash databases on init
|
* Reads fuzzy hash databases on init
|
||||||
[Issue #1339 - Robert Paprocki and @Rendername]
|
[Issue #1339 - Robert Paprocki and @Rendername]
|
||||||
* Changes the configuration to recognize soap+xml as XML
|
* Changes the configuration to recognize soap+xml as XML
|
||||||
|
@ -339,6 +339,7 @@ char *format_error_log_message(apr_pool_t *mp, error_message_t *em) {
|
|||||||
|
|
||||||
if (em == NULL) return NULL;
|
if (em == NULL) return NULL;
|
||||||
|
|
||||||
|
#ifndef LOG_NO_FILENAME
|
||||||
if (em->file != NULL) {
|
if (em->file != NULL) {
|
||||||
s_file = apr_psprintf(mp, "[file \"%s\"] ",
|
s_file = apr_psprintf(mp, "[file \"%s\"] ",
|
||||||
log_escape(mp, (char *)em->file));
|
log_escape(mp, (char *)em->file));
|
||||||
@ -349,6 +350,7 @@ char *format_error_log_message(apr_pool_t *mp, error_message_t *em) {
|
|||||||
s_line = apr_psprintf(mp, "[line %d] ", em->line);
|
s_line = apr_psprintf(mp, "[line %d] ", em->line);
|
||||||
if (s_line == NULL) return NULL;
|
if (s_line == NULL) return NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
s_level = apr_psprintf(mp, "[level %d] ", em->level);
|
s_level = apr_psprintf(mp, "[level %d] ", em->level);
|
||||||
if (s_level == NULL) return NULL;
|
if (s_level == NULL) return NULL;
|
||||||
|
@ -2194,10 +2194,12 @@ char *msre_format_metadata(modsec_rec *msr, msre_actionset *actionset) {
|
|||||||
|
|
||||||
if (actionset == NULL) return "";
|
if (actionset == NULL) return "";
|
||||||
|
|
||||||
|
#ifndef LOG_NO_FILENAME
|
||||||
if ((actionset->rule != NULL) && (actionset->rule->filename != NULL)) {
|
if ((actionset->rule != NULL) && (actionset->rule->filename != NULL)) {
|
||||||
fn = apr_psprintf(msr->mp, " [file \"%s\"] [line \"%d\"]",
|
fn = apr_psprintf(msr->mp, " [file \"%s\"] [line \"%d\"]",
|
||||||
actionset->rule->filename, actionset->rule->line_num);
|
actionset->rule->filename, actionset->rule->line_num);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (actionset->id != NULL) {
|
if (actionset->id != NULL) {
|
||||||
id = apr_psprintf(msr->mp, " [id \"%s\"]",
|
id = apr_psprintf(msr->mp, " [id \"%s\"]",
|
||||||
log_escape(msr->mp, actionset->id));
|
log_escape(msr->mp, actionset->id));
|
||||||
|
17
configure.ac
17
configure.ac
@ -427,6 +427,21 @@ AC_ARG_ENABLE(rule-id-validation,
|
|||||||
unique_id=''
|
unique_id=''
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# Disable logging of filename
|
||||||
|
AC_ARG_ENABLE(filename-logging,
|
||||||
|
AS_HELP_STRING([--enable-filename-logging],
|
||||||
|
[Enable logging of filename in audit log. This is the default]),
|
||||||
|
[
|
||||||
|
if test "$enableval" != "no"; then
|
||||||
|
log_filename=
|
||||||
|
else
|
||||||
|
log_filename="-DLOG_NO_FILENAME"
|
||||||
|
fi
|
||||||
|
],
|
||||||
|
[
|
||||||
|
log_filename=''
|
||||||
|
])
|
||||||
|
|
||||||
# Ignore configure errors
|
# Ignore configure errors
|
||||||
AC_ARG_ENABLE(errors,
|
AC_ARG_ENABLE(errors,
|
||||||
AS_HELP_STRING([--disable-errors],
|
AS_HELP_STRING([--disable-errors],
|
||||||
@ -677,7 +692,7 @@ else
|
|||||||
fi
|
fi
|
||||||
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"
|
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"
|
||||||
|
|
||||||
APXS_WRAPPER=build/apxs-wrapper
|
APXS_WRAPPER=build/apxs-wrapper
|
||||||
APXS_EXTRA_CFLAGS=""
|
APXS_EXTRA_CFLAGS=""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user