Skip to content
Snippets Groups Projects
Verified Commit 66a282f7 authored by David Beniamine's avatar David Beniamine
Browse files

Run clamav and rkhunter on upgrade

parent 7ac67cf0
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
LOGFILE="/tmp/clamav-$(date +'%Y-%m-%d').log";
LOGFILE="/var/log/clamav.log";
EMAIL_TO="root";
DIRTOSCAN="/var/www /home";
......@@ -31,9 +31,10 @@ do_sendmail(){
echo "To: $EMAIL_TO";
echo "Content-Type: text/plain; charset=UTF-8";
echo "";
echo -e "${message}") | sendmail -t
echo -e "${message}") | sendmail -t $EMAIL_TO
}
echo "" > $LOGFILE
for S in ${DIRTOSCAN}; do
DIRSIZE=$(du -sh "$S" 2>/dev/null | cut -f1);
......@@ -52,10 +53,5 @@ then
message="Une menace a été detecté sur votre serveur.\n Merci de vous
référer au log ci dessous et si besoin de contacter vos
administrateur.rice système."
else
subject="Aucune menace detectée"
message="Aucune menace detectée durant l'analyse hebdomadaire de votre serveur."
fi
do_sendmail
rm $LOGFILE
fi
......@@ -69,6 +69,7 @@ DEBIAN_FRONTEND='noninteractive' apt-get -qq install \
php-mcrypt \
php-mysql \
postfix \
rkhunter \
openssh-server \
tar \
tmux \
......
......@@ -44,6 +44,12 @@ if [ -f "$customfile" ]
then
/bin/bash $customfile
fi
if [ -z "`which rkhunter`" ]
then
aptitude install rkhunter
fi
rkhunter --sk -c
less /var/log/clamav.log
services="`checkrestart | awk '/^service/{print $2} /^systemctl/{print $3}'` \
$EXTRAS_SERVICES_TO_RESTART"
[ ! -z "$services" ] && systemctl restart $services
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment