アンチウイルス Clam Antivirus インストール


この章を始める前に下記の設定が必要です
「logrotate インストール」
clamavインストール
[root@freebsd ~]# cd /usr/ports/security/clamav
[root@freebsd clamav]# make BATCH=yes install clean
[root@freebsd clamav]# rehash
[root@freebsd clamav]# cd
clamd.conf編集
[root@freebsd ~]# chmod 640 /usr/local/etc/clamd.conf
[root@freebsd ~]# vi /usr/local/etc/clamd.conf
#LogTime yes
↓
LogTime yes ←コメント解除(ログに時間を付ける)

User clamav
↓
#User clamav ←コメントアウト(root権限で動作させる)
freshclam.conf編集
[root@freebsd ~]# chmod 640 /usr/local/etc/freshclam.conf
[root@freebsd ~]# vi /usr/local/etc/freshclam.conf
DatabaseOwner clamav
↓
DatabaseOwner root ←変更(root権限で動作させる)

DatabaseMirror database.clamav.net
↓
DatabaseMirror db.jp.clamav.net ←変更(ミラー変更)
clamav起動
[root@freebsd ~]# vi /etc/rc.conf
clamav_clamd_enable="YES" ←追加(clamd起動)
clamav_freshclam_enable="YES" ←追加(freshclam起動)
[root@freebsd ~]# /usr/local/etc/rc.d/clamav-clamd start Starting clamav_clamd. LibClamAV Warning: ************************************************** LibClamAV Warning: *** The virus database is older than 7 days! *** LibClamAV Warning: *** Please update it as soon as possible. *** LibClamAV Warning: ************************************************** [root@freebsd ~]# /usr/local/etc/rc.d/clamav-freshclam start Starting clamav_freshclam.
ウイルスデータベース更新
[root@freebsd ~]# freshclam
ClamAV update process started at Sat Feb  9 21:01:12 2008
main.cvd is up to date (version: 45, sigs: 169676, f-level: 21, builder: sven)
daily.cvd is up to date (version: 5755, sigs: 38210, f-level: 21, builder: ccordes)
スキャンテスト
[root@freebsd ~]# clamscan --infected --remove --recursive
----------- SCAN SUMMARY -----------
Known viruses: 846122
Engine version: 0.96.3
Scanned directories: 1
Scanned files: 8
Infected files: 0 ←感染ファイルは0
Data scanned: 0.01 MB
Data read: 0.00 MB (ratio 2.00:1)
Time: 10.795 sec (0 m 10 s)
clamscan定期実行
[root@freebsd ~]# vi /etc/periodic/daily/600.clamscan
↓下記を記入
#!/bin/sh

/usr/local/bin/clamscan -i -r --remove /home >> /var/log/clamav/clamscan.log 2>&1
[root@freebsd ~]# chmod 755 /etc/periodic/daily/600.clamscan
ログローテーション
[root@freebsd ~]# vi /usr/local/etc/logrotate.d/clamav
↓下記を記入
/var/log/clamav/clamscan.log{
	monthly
	rotate 4
	missingok
}
Home PageTop