aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2010-01-14 14:12:26 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2010-01-14 14:12:26 +0000
commit1c31b59cd740b88976aba05c711820705ace96f3 (patch)
treebdeb52d9eeca9cbeee1eb4718a29baa9b47ee813
parent9f2fa5b895d55b3cfa46e18d638f4b0241d98dc9 (diff)
downloadmsec-1c31b59cd740b88976aba05c711820705ace96f3.tar
msec-1c31b59cd740b88976aba05c711820705ace96f3.tar.gz
msec-1c31b59cd740b88976aba05c711820705ace96f3.tar.bz2
msec-1c31b59cd740b88976aba05c711820705ace96f3.tar.xz
msec-1c31b59cd740b88976aba05c711820705ace96f3.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