Este tutorial explica cómo puede integrar ClamAV en PureFTPd para escanear virus en un sistema CentOS 6.2. Al final, siempre que se cargue un archivo a través de PureFTPd, ClamAV lo revisará y lo eliminará si es malware.
1 nota preliminar
Debería tener una configuración de PureFTPd en funcionamiento en su servidor CentOS 6.2, p. como se muestra en este tutorial:alojamiento virtual con PureFTPd y MySQL (incluida la gestión de cuotas y ancho de banda) en CentOS 6.2.
2 Instalación de ClamAV
ClamAV no está disponible en los repositorios oficiales de CentOS, por lo tanto, habilitamos el repositorio EPEL (si aún no lo ha hecho, por ejemplo, en el tutorial de alojamiento virtual con PureFTPd y MySQL (incl. gestión de cuotas y ancho de banda) en CentOS 6.2):
rpm --import https://fedoraproject.org/static/0608B895.txt
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
rpm -ivh epel-release-6-5.noarch.rpm
yum install yum-priorities
Edite /etc/yum.repos.d/epel.repo...
vi /etc/yum.repos.d/epel.repo
... y agregue la línea prioridad=10 a la sección [epel]:
[epel] name=Extra Packages for Enterprise Linux 6 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch failovermethod=priority enabled=1 priority=10 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 [...] |
[...] # If your pure-ftpd has been compiled with pure-uploadscript support, # this will make pure-ftpd write info about new uploads to # /var/run/pure-ftpd.upload.pipe so pure-uploadscript can read it and # spawn a script to handle the upload. # Don't enable this option if you don't actually use pure-uploadscript. CallUploadScript yes [...] |
#!/bin/sh /usr/bin/clamdscan --remove --quiet --no-summary "$1" |
#!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. /usr/sbin/pure-uploadscript -B -r /etc/pure-ftpd/clamav_check.sh touch /var/lock/subsys/local |