Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
|
clamav [2015/05/11 15:38] catherine.balleydier@grenoble-inp.fr créée |
clamav [2016/09/16 15:00] (Version actuelle) catherine.balleydier@grenoble-inp.fr [Test] |
||
|---|---|---|---|
| Ligne 13: | Ligne 13: | ||
| # yum install epel-release-6-8.noarch.rpm | # yum install epel-release-6-8.noarch.rpm | ||
| remplacer https par http au niveau de mirrorlist | remplacer https par http au niveau de mirrorlist | ||
| + | # yum install pcre-devel | ||
| # yum install clamav | # yum install clamav | ||
| - | | + | |
| - | ==== Configuration ===== | + | Version : 0.99 |
| + | ===== Configuration ====== | ||
| ==== Groupe ==== | ==== Groupe ==== | ||
| Ligne 35: | Ligne 37: | ||
| - | ==== Logs ==== | + | ===== Logs ===== |
| # cd /var/log/clamav | # cd /var/log/clamav | ||
| Ligne 65: | Ligne 67: | ||
| # vi eicar.com | # vi eicar.com | ||
| - | X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* | + | |
| + | {{:ex-clamav.gif?600|}} | ||
| # clamscan eicar.com | # clamscan eicar.com | ||
| Ligne 82: | Ligne 85: | ||
| </code> | </code> | ||
| + | ===== Configurer sympa pour la vérification des messages ===== | ||
| + | Fichier de configuration /etc/sympa/sympa.conf | ||
| + | |||
| + | antivirus_path /usr/bin/clamscan | ||
| + | antivirus_args --stdout | ||
| + | antivirus_notify none | ||
| ===== Vérifier des répertoires ===== | ===== Vérifier des répertoires ===== | ||
| Ligne 97: | Ligne 106: | ||
| # /usr/local/SCRIPTS/clamav/clamav_dossier.pl | # /usr/local/SCRIPTS/clamav/clamav_dossier.pl | ||
| # | # | ||
| - | # 05/05/05 | + | # 05/01/06 |
| # | # | ||
| ######################################################################## | ######################################################################## | ||
| Ligne 116: | Ligne 125: | ||
| my $datescan = strftime "%Y%m%d", localtime; | my $datescan = strftime "%Y%m%d", localtime; | ||
| - | my $REP = "/home/sympa/list_data/\*/\*/shared" ; | + | my $REP = "/home/sympa/list_data/\*/\*/shared" ;:q |
| - | my $fich = "/usr/local/SCRIPTS/clamav/scan"."$datescan" ; | + | |
| + | my $fich1 = "/usr/local/SCRIPTS/clamav/scan.log" ; | ||
| + | my $fich2 = "/usr/local/SCRIPTS/clamav/pbscan"."$datescan" ; | ||
| my $admin = "catherine.balleydier\@grenoble-inp.fr" ; | my $admin = "catherine.balleydier\@grenoble-inp.fr" ; | ||
| - | my $commande1 = "clamscan -r $REP > $fich" ; | + | my $commande1 = "clamscan -r $REP > $fich1" ; |
| system ($commande1) ; | system ($commande1) ; | ||
| - | open (FICH1,"$fich") ||die "probleme fichier"; | + | open (FICH1,"$fich1") ||die "probleme fichier"; |
| my @CONFIG = <FICH1> ; | my @CONFIG = <FICH1> ; | ||
| close (FICH1); | close (FICH1); | ||
| Ligne 129: | Ligne 140: | ||
| if ("@CONFIG" !~ /Infected files: 0/ ) | if ("@CONFIG" !~ /Infected files: 0/ ) | ||
| { | { | ||
| - | my $commande2 = "mailx -s \"fichiers infectes sur $host\" $admin < $fich" ; | + | open (FICH2,">$fich2") ||die "probleme fichier"; |
| + | my $ligne ; | ||
| + | foreach $ligne (@CONFIG) | ||
| + | { | ||
| + | if ( $ligne !~ /: OK/ ) | ||
| + | { | ||
| + | chomp $ligne ; | ||
| + | print FICH2 "$ligne\n" ; | ||
| + | } | ||
| + | } | ||
| + | close (FICH2); | ||
| + | my $commande2 = "mailx -s \"fichiers infectes sur $host\" $admin < $fich2" ; | ||
| system ($commande2) ; | system ($commande2) ; | ||
| - | } | + | |
| </code> | </code> | ||
| # chmod 700 clamav_dossier.pl | # chmod 700 clamav_dossier.pl | ||
| + | |||
| + | ===== Logrotate de scan ===== | ||
| + | |||
| + | Créer sous **/etc/logrotate.d** : **resul-clamav** | ||
| + | |||
| + | <code> | ||
| + | /usr/local/SCRIPTS/clamav/scan.log | ||
| + | { | ||
| + | missingok | ||
| + | compress | ||
| + | notifempty | ||
| + | daily | ||
| + | rotate 30 | ||
| + | } | ||
| + | </code> | ||
| + | |||
