From d4fbfa57001d42144a6fde0db96a36ce21f388bf Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 1 Mar 2020 20:30:33 +0100 Subject: syslog: T2086: do not log cron and su to regular syslog --- src/etc/rsyslog.d/01-auth.conf | 14 ++++++++++++++ src/etc/rsyslog.d/sudo.conf | 9 --------- 2 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 src/etc/rsyslog.d/01-auth.conf delete mode 100644 src/etc/rsyslog.d/sudo.conf (limited to 'src/etc/rsyslog.d') diff --git a/src/etc/rsyslog.d/01-auth.conf b/src/etc/rsyslog.d/01-auth.conf new file mode 100644 index 000000000..cc64099d6 --- /dev/null +++ b/src/etc/rsyslog.d/01-auth.conf @@ -0,0 +1,14 @@ +# The lines below cause all listed daemons/processes to be logged into +# /var/log/auth.log, then drops the message so it does not also go to the +# regular syslog so that messages are not duplicated + +$outchannel auth_log,/var/log/auth.log +if $programname == 'CRON' or + $programname == 'sudo' or + $programname == 'su' + then :omfile:$auth_log + +if $programname == 'CRON' or + $programname == 'sudo' or + $programname == 'su' + then stop diff --git a/src/etc/rsyslog.d/sudo.conf b/src/etc/rsyslog.d/sudo.conf deleted file mode 100644 index 589651f87..000000000 --- a/src/etc/rsyslog.d/sudo.conf +++ /dev/null @@ -1,9 +0,0 @@ -# Isolating sudo messages from syslog -# -# https://debian-administration.org/article/676/Isolating_sudo_messages_from_syslog - -# match if "program name" is equal to "sudo" -:programname, isequal, "sudo" -/var/log/auth.log - -# if we matched this causes the input to be swallowed, preventing further logging. -& ~ -- cgit v1.2.3