●Qmail Scannerのテスト |
インストールが完了したら,実際に動作するかテストしてみよう。以下のコマンドを入力し,管理者宛にメールが届いていれば正常に動作している。
$ cd qmail-scanner-1.10 setting QMAILQUEUE to /var/qmail/bin/qmail-scanner-queue.pl for this test... Sending standard test message -
no viruses... Sending eicar test virus - should
be caught by perlscanner module... Sending eicar test virus with altered
filename - should only be caught by commer Finished test. Now go and check Email for root@example.com |
●スキャンを行うルールの設定 |
Qmail Scannerでスキャンするファイルのルール設定ファイルは,「/var/spool/qmailscan/quarantine-attachments.txt」にある。初期設定では下記のように記述されている。
EICAR.COM 69 EICAR Test Virus Happy99.exe 10000 Happy99 Trojan zipped_files.exe 120495 W32/ExploreZip.worm.pak virus ILOVEYOU Virus-Subject: Love Letter Virus/Trojan |
新たに加える際の記述方法は
ファイル名<TAB>サイズ(バイト)<TAB>ウイルスの種類等の説明 |
となる。たとえばexeファイルとmp3ファイルを対象とするのであれば,
.exe 0 Executable binary .mp3 0 MP3 files not allowed |
と記述する。これによりメールにexeファイルおよびMP3ファイルが添付されていると,それを受け付けないように設定できる。また,ファイルを編集した際には必ず「/var/qmail/bin/qmail-scanner-queue.pl -g」を実行し,変更を反映させておく必要がある。
quarantine-attachments.txtの一例として,http://exe2bin.com/qmail-scanner/blacklist.txtやhttp://www.es.qmail.org/quarantine-attachments.txtなどを参照し,自分なりに手を加えながら利用するのもよいだろう。ここに上げたサイトの定義ファイルをそのまま利用したい場合は,
# cd /var/spool/qmailscan/ # cp quarantine-attachments.txt quarantine-attachments.txt.dist # wget http://www.es.qmail.org/quarantine-attachments.txt # /var/qmail/bin/qmail-scanner-queue.pl -g perlscanner: generate new DB file perlscannner: total of 152 entries. |
のように,オリジナルを「quarantine-attachments.txt.dist」として保存してからコピーすればよい。
●外部よりウイルスメールを受信した場合 |
では実際に,外部から自宅サーバに向けてウイルスを添付したメールを送信してみることにする。ウイルスが添付されたメールを受信すると,送信者と管理者に以下のようなメールが配信される。これでウイルスの添付されたメールからの感染を,未然に防ぐことができるわけだ。
Delivered-To: root@itmediahogehoge.org Attention: Virii <virus@example.org>. <<<<ウイルスメール送信者 A Virus was found in an Email message
you sent. The Virus was reported to be: EICAR-AV-Test Please update your virus scanner
or contact your I.T support Your message was sent with the following envelope: MAIL FROM: virus@example.org ... and with the following headers: From: Virii <virus@example.org> The original message is kept in: itmedia.hogehoge.org:/var/spool/qmailscan/quarantine where the System Anti-Virus Administrator can further diagnose it. The Email scanner reported the following when it scanned that message: --- ---sweep results --- --- |
3/6 |