aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2010-01-14 14:04:15 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2010-01-14 14:04:15 +0000
commitd931de5788961b7aa1c5b71165ec1edf42479ef0 (patch)
treea62145c508286a72c8c9d5c93b6ab73f0ba7611a
parent88edbe14fe4d03ee8ade9bacaaef5815d8cf9e60 (diff)
downloadmsec-d931de5788961b7aa1c5b71165ec1edf42479ef0.tar
msec-d931de5788961b7aa1c5b71165ec1edf42479ef0.tar.gz
msec-d931de5788961b7aa1c5b71165ec1edf42479ef0.tar.bz2
msec-d931de5788961b7aa1c5b71165ec1edf42479ef0.tar.xz
msec-d931de5788961b7aa1c5b71165ec1edf42479ef0.zip
Save the entire log message in /var/log/security/ as well.
-rwxr-xr-xcron-sh/security.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/cron-sh/security.sh b/cron-sh/security.sh
index 32dac9c..9a2d19d 100755
--- a/cron-sh/security.sh
+++ b/cron-sh/security.sh
@@ -31,6 +31,8 @@ fi
# variables
LCK=/var/run/msec-security.pid
SECURITY_LOG="/var/log/security.log"
+MAIL_LOG_TODAY="/var/log/security/mail.today"
+MAIL_LOG_YESTERDAY="/var/log/security/mail.yesterday"
# log formatting
REPORT_DATE=`date "+%b %d %H:%M:%S"`
@@ -99,8 +101,14 @@ if [[ -s ${SECURITY} ]]; then
cat ${INFOS} | sed -e "s/^/$INFO_PREFIX/g" >> ${SECURITY_LOG}
+ # save the complete mail text somewhere
+ if [[ -f ${MAIL_LOG_TODAY} ]]; then
+ mv ${MAIL_LOG_TODAY} ${MAIL_LOG_YESTERDAY};
+ fi
+ cat ${MSEC_TMP} > ${MAIL_LOG_TODAY}
+
Maillog "[msec] *** Security Check on ${REPORT_HOSTNAME}, ${REPORT_DATE} ***" "${MSEC_TMP}"
- Notifylog "MSEC has performed Security Check on ${REPORT_HOSTNAME} on ${REPORT_DATE}"
+ Notifylog "MSEC has performed Security Check on ${REPORT_HOSTNAME} on ${REPORT_DATE}. Detailed results are available in ${MAIL_LOG_TODAY}"
fi
# diff check