2022年8月、ホームページを全面リニューアルしました! 情報を分かりやすくお伝えできるサイト作りを目指してまいります。

SMTPのとばっつ^口^でウィルスを撃退する!

昨今のMail型ウィルス(以降、ワーム)には世の中でかなりの人々が被害に有っていると思う。特に、トロイの木馬型のワームについては、その手口の巧妙さには腹が立つのもそうだが、恐怖さえ覚える。まさに、インターネットの世界への挑戦と言うか、テロに近いものが有るのではなかろうか?このような、背景からワームに対する防御策として、単に自分のPCにウィルスソフトをセットアップして使うだけでは、仮に脆弱性のあるメールクライアントを使ってるユーザには ”完璧な防御” とは言い難い。と言うのも、そのウィルス防御ソフトの使い方及びメンテ方法を熟知しているかしていないかの如何にかかわる問題だと俺は思う。いくらウィルスソフトをセットアップしてもデフォルトでセットアップしてそのまま何もしないで放置しておいては定義ファイルも更新されない場合がある。このような事ではなんのためのウィルスソフトなのか?疑問である。したがって、この手の初心者的あやまちは是非に気をつけたいものである。


ここで説明するモジュールは、MailMonitor for SMTPと言って Sophos社 が開発したメールサーバ側のSMTPポートを監視してインターネットから自サーバ宛てに来たウィルスメールを、その場で退治すると言う画期的なウィルス対策用モジュールである。したがって、ユーザのメールクライアントには直接配送されないのできわめて強固なウィルス対策が可能となる。以下に、MailMonitor for SMTPのインストール方法を説明する。


1.MailMonitor for SMTPの構造

図1は、メールサーバとMailMonitor for SMTPを同居させる場合を示す。
この場合、MailMonitor for SMTPが、25番ポートで動作するため、メールサーバ側のSMTPを仮に2525番で動作させるようにする。したがって、メールの配送を必ずMailMonitor for SMTPへ転送するように設定する。

図2は、メールサーバとMailMonitor for SMTPを別にする場合を示す。
この場合、MailMonitor for SMTPが別サーバなので、メールサーバがMailMonitor for SMTPサーバを中継するような設定にする。ポートは、両者25番ポートを使うようにしておけば良い。


2.MailMonitor for SMTPのゲット
MailMonitor for SMTPは、企業レベルでは製品購入の必要があるが、個人レベルでは現在(2002年5月)ベータ版が Sophos社 のサイト にある。これを、ゲットする事をお勧めする。貴重な開発品の提供なので、使った方は好評をSophos社の方へフィードバックすると感謝されるであろう。


3.インストール

■ インストール前の注意事項

注1 : インストールの前に、MailMonitor for SMTPは現在Linux版のみの供給になっている。したがって、Linuxで使用する事が前提となるが、FreeBSDでも使用できる。FreeBSD4.xで使用する場合は、Linux_baseパッケージをインストールしてFreeBSDでLinuxをエミュレートさせよう!(BSDは素晴らしい、こんな便利なものがある)

注2 : どうもこの、MailMonitor for SMTPは自分自身が25番ポートで動こうとするらしい。したがって、仮にMTAのconfをいじり、SMTPを別な空きポートで動かすような設定をして、そこのポートをMailMonitor for SMTPで監視する設定にする。
しかし、本来ベストな環境設定は、管理サーバを別に構築して、そこでMailMonitor for SMTPを動かす事を俺はお勧めする(1項参照)。

注3 : MailMonitor for SMTPは、Sophos Anti-Virusのモジュールを利用する。したがって、MailMonitor for SMTPをインストールする前に、当サイトの技術の部屋の” Linuxウィルスソフト導入の勧め! ”を参照してAnti-Virusをインストールしていただきたい。

注4 : MailMonitor for SMTPは、現在のベータバージョンではアクセス制御が機能しません。Sophos社によると、正式版ではFixされるそうです。したがって、SMTP 25番のセキュリティが効かないのでリレー中継してしまいます。現在のベータバージョンを使用する場合は、SMTP AUTHもしくはPOP before SMTPを併用する事をお勧めする。

■ モジュールの解凍

tar玉になっているので適当なフォルダに入れて解凍する。

# tar -xvf mmsmtp.linux.intel.tar

■ インストール

mmsmtp-installフォルダに移動して、install.shシェルプログラムを実行!

# cd mmsmtp-install

# ./install.sh

Checking for files needed to install MailMonitor for SMTP …
install.sh: OK.
DIST: OK.
PLATFORM: OK.
README.TXT: OK.
DIST1.tar.gz: OK.

Step 0/4 ***********************************************

Install

This is an interactive shell script to help you install
the MailMonitor for SMTP (linux-x86).
Copyright (c) 1998,2001 Sophos Plc, Oxford, England

You may ^C out of this script at any time, and start again.
When you are asked to type <CR>, press the RETURN key.
Default values are surrounded by square brackets, i.e. [].

Installation overview

0. Installation overview
1. Select the installation directory
2. Query the config data
3. Installation options summary
4. Installing the product

Enter your choice ([n]ext, (b)ack or (q)uit)?

nを入力。

Step 1/4 ***********************************************

Please enter the name of the directory to hold the
MailMonitor for SMTP (linux-x86) installation.

This installation script will create a directory named mmsmtp-1.0
under the installation directory.

Enter installation directory [/usr/local/sophos]: Using directory /usr/
local/sophos

Enter your choice ([n]ext, (b)ack or (q)uit)?

デフォルトインストールディレクトリ名は、/usr/local/sohosでよければ nを入力。

Step 2/4 ***********************************************
Please specify the following configuration options:
(Take a look in the manual for the description of these options)

The folder where temporary files will be created
[general]/temp_folder [/var/spool/mmsmtp/data]: Using /var/spool/
mmsmtp/data

検索目的の一時フォルダを指定する。
デフォルトは、/var/spool/mmsmtp/dataでよければ リターンを入力。

The folder where queued files will be stored

[general]/queue_folder [/var/spool/mmsmtp/queue]: Using /var/spool/
mmsmtp/queue

MailMonitor が処理を開始しようとしているジョブ、あるいは現在処理中のジョブの詳細を保存するフォルダを指定する。
デフォルトは、/var/spool/mmsmtp/queueでよければ リターンを入力。

The folder where log files will be stored
[log]/folder [/var/log/mmsmtp]: Using /var/log/mmsmtp

ログファイルを保存するフォルダを指定する。
デフォルトは、/var/log/mmsmtpでよければ リターンを入力。

The folder where quarantined messages will be stored
[quarantine]/folder [/var/spool/mmsmtp/quarantine]: Using /var/spool/
mmsmtp/quarantine

隔離されたメッセージ(感染の疑いのあるメッセージ、または感染しているため隔離されたもの)を保存するフォルダを指定する。
デフォルトは、/var/spool/mmsmtp/quarantineでよければ リターンを入力。

The interfaces the SMTP scanner will listen on
[general]/interfaces [skeeve:25]: Using skeeve:25

MailMonitor for SMTP サーバーの IP アドレスとポート番号を指定する。
(MailMonitor for SMTPをインストールしたサーバのIPアドレスもしくはホスト名)
デフォルトは、<IPアドレス> 25でよければ リターンを入力。

The IP address of the SMTP server that will be used for sending emails
[general]/smtp_server_address [mail []]: Using mail []
The port of the SMTP server
[general]/smtp_server_port [25]: Using port 25

メール送信に使用する SMTP サーバーの IP アドレスとポート番号を指定する。
(MailMonitor for SMTPで監視されるメールサーバのIPアドレスもしくはホスト名)
デフォルトは、<IPアドレス> 25でよければ リターンを入力。
→ メールサーバと同居させる場合は、<IPアドレス>2525

The IP address of the SMTP server that will be used for sending
notifications
[notification]/smtp_server_address [mail []]: Using mail []
The port of the SMTP server
[notification]/smtp_server_port [25]: Using port 25

ウイルス通知送信に使用する SMTP サーバーの IP アドレスとポート番号を指定する。
(MailMonitor for SMTPで監視されるメールサーバのIPアドレスもしくはホスト名)
デフォルトは、<IPアドレス> 25でよければ リターンを入力。
→ メールサーバと同居させる場合は、<IPアドレス>2525

Return email address of the notification email message
[notification]/sender [mmsmtp@skeeve]: Using mmsmtp@skeeve
The list of the additional email addresses where to send notfication
email
[notification]/notify_list [mmsmtp-admin@skeeve]: Using mmsmtp-admin@
skeeve

通知メッセージ用の返信メールアドレスを指定し、通知メッセージ受信用の追加アドレスを設定する。これで良ければ リターンを入力。

Enter your choice ([n]ext, (b)ack or (q)uit)?

すべての環境設定オプションを設定(あるいはデフォルトを指定)した後、nを入力。

Step 3/4 ***********************************************

Installation options summary

Installation directory = /usr/local/sophos/mmsmtp-1
[general]/temp_folder = /var/spool/mmsmtp/data
[general]/queue_folder = /var/spool/mmsmtp/queue
[log]/folder = /var/log/mmsmtp
[quarantine]/folder = /var/spool/mmsmtp/quarantine
[general]/interfaces = skeeve:25
[general]/smtp_server_address = mail []
[general]/smtp_server_port = 25
[notification]/smtp_server_address = mail []
[notification]/smtp_server_port = 25
[notification]/sender = mmsmtp@skeeve
[notification]/notify_list = mmsmtp-admin@skeeve

Enter your choice ([n]ext, (b)ack or (q)uit)?

ステップ 3 では、インストールオプションを確認する。その後、n を入力。

Step 4/4 ***********************************************

Performing the installation…
Checking for directory /usr/local/sophos/mmsmtp-1 …
Created directory /usr/local/sophos/mmsmtp-1.
Uncompressing and extracting DIST1.tar.gz…
linux-x86/
linux-x86/bin/
linux-x86/bin/qm
linux-x86/bin/mmsmtp.out
MailMonitor for SMTP
linux-x86/bin/mmsmtpd
linux-x86/bin/mmsmtp-uninstall
linux-x86/lib/
linux-x86/man/
linux-x86/template/
linux-x86/template/attachment.txt
linux-x86/template/message.txt
linux-x86/template/notify_administrator.txt
linux-x86/template/notify_recipients.txt
linux-x86/template/notify_sender.txt
linux-x86/wwwroot/
linux-x86/mmsmtp.cfg
linux-x86/README.TXT
/usr/local/sophos/mmsmtp should be a symbolic link to the directory
/usr/local/sophos/mmsmtp-1/linux-x86
Create the /usr/local/sophos/mmsmtp symbolic link (y or n)? /usr/local/
sophos/mmsmtp link already exists. Recreating the link…
/usr/local/sophos/mmsmtp link created.
Updating config file /usr/local/sophos/mmsmtp-1/linux-x86/mmsmtp.cfg
Config file successfully updated.
Updating file /usr/local/sophos/mmsmtp-1/linux-x86/bin/mmsmtpd
File successfully updated.
Updating file /usr/local/sophos/mmsmtp-1/linux-x86/bin/mmsmtp-uninstall
File successfully updated.
Checking shared libraries of the /usr/local/sophos/mmsmtp-1/linux-x86/
bin/mmsmtp.out
All libraries present.
Starting the MailMonitor for SMTP daemon…
mmsmtp daemon (pid=7182) has been started successfully
Installation complete.
Users should add /usr/local/sophos/mmsmtp/bin to their PATH.
Users should add /usr/local/sophos/mmsmtp/man to their MANPATH.
Sophos customer support is available at:
email: support@sophos.com
US support: +1 888 SOPHOS 9
UK Support: +44 1235 559933
http://www.sophos.com

ステップ 4 では、インストールが行われる。また、インストールが正しく終了したかどうかが表示される。エラーが無く終われば、以上でセットアップ完了。


4.運用に当たって

■ 起動

起動は、パスが通っていれば以下で起動。

# mmsmtp -start

停止させる場合は、

# mmsmtp -terminate

次回起動のために、以下のようなシェルスクリプトを作ってLinuxなら、rc.localに書き込む。
FreeBSDなら、startmmsmtp.shのようなファイルを作り/usr/local/etc/rc.dに置く。
内容は、以下に示す。

#!/bin/sh もしくは#!/bin/bash

if [ -f /usr/local/sophos/mmsmtp/bin/mmsmtpd ]; then
/usr/local/sophos/mmsmtp/bin/mmsmtpd -start
fi

■ ライブラリが無い!

FreeBSDの場合、mmsmtp起動時に”libxxxxxxx.soがない。”なんて言うエラーが出る場合がある。その時は、そのライブラリの場所を見つけて、/usr/libの中にシンボルリンクを張れば問題なく起動できるはずである。

■ ウィルス定義のアップデート

インストールが完了して運用するわけだが、最新の定義ファイルのメンテを忘れずに行う事。メンテをしなければせっかく運用しててもモジュールが役に立たない。定義ファイルのメンテ方法は、当サイトの技術の部屋の” Linuxウィルスソフト導入の勧め! ”を参照すること。

以上

コメント