Sat, 15 Aug 2009 14:44:37 +0200
Report scripts version
#!/bin/bash # ############################################################################# # Copyright (C) 2005-2009 # # Michiel Broek <mbse@mbse.dds.nl> # Beekmansbos 10 # 1971 BV IJmuiden # the Netherlands # # This file is part of SlackSecCheckSripts. # # This package is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any # later version. # # SlackSecCheckSripts is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with MBSE BBS; see the file COPYING. If not, write to the Free # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ############################################################################# VERSION=0.14 export PATH=/bin:/usr/bin:/sbin:/usr/sbin umask 077 LANG=C; export LANG fqdn=`hostname -f` date=`date` if [ "${MAILTO}" = "" ]; then MAILTO=root@$fqdn fi DAILYDIR=`mktemp -d /tmp/_daily.XXXXXX` || exit 1 SECOUT="$DAILYDIR/secout" TMP1="$DAILYDIR/tmp1" trap "/bin/rm -rf $DAILYDIR ; exit 0" EXIT INT QUIT if ! cd "$DAILYDIR"; then echo "Can not cd to $DAILYDIR". exit 1 fi # Check chk_* scripts in /etc/security.d which are executable # and run them. Any script output is appended to the report # for f in `/bin/ls /etc/security.d/chk_*` do if [ -x $f ]; then rm -f $TMP1 $f > $TMP1 if [ -s $TMP1 ]; then if [ ! -f $SECOUT ]; then echo "" >> $SECOUT echo " SlackSecCheckSripts v${VERSION}" >> $SECOUT echo "" >> $SECOUT fi cat $TMP1 >> $SECOUT echo "" >> $SECOUT echo "------------------------------------------------------------------------------" >> $SECOUT fi fi done if [ ! -s "$SECOUT" ]; then echo "Nothing to report on $date" > $SECOUT fi env MAILRC=/dev/null mail -s "$fqdn daily insecurity output for $date" $MAILTO < $SECOUT