■Fortigate-80Cのスパム検知を試してみる。 下記でsshは読み込み専用の自動ログイン出来る環境にした。 Fortigate-80Cのバックアップをscpとcronで自動化する。 http://labunix.hateblo.jp/entry/20150301/1425137577 ■アンティスパムのライセンスは有効。 $ ssh 172.31.31.251 "get system fortiguard" | grep antispam antispam-force-off : disable antispam-cache : enable antispam-cache-ttl : 1800 antispam-cache-mpercent: 2 antispam-license : Contract antispam-expiration : Fri Sep 18 09:00:00 2015 antispam-timeout : 7 ■外部メールサービスで実際にスパムとして判定されているメール本文にある URLがスパム判定されるか確かめるためには予め、スパム判定される素材が必要。 スパムメール対策サービス http://www.fortinet.co.jp/support/fortiguard_services/antispam.html ■サンプルとなる素材が欲しい。 ドメインのブラックリスト(base/new/E-mail)を見つけた。 Using our spam blacklists http://www.joewein.de/sw/bl-text.htm ■サンプルとしていくつか挿入して確認してみたが、 Fortigateですべてがスパムと判定されるわけではないため、 ランダムに上記のうち、「base」を使用して、 ランダムで選択したドメインを本文に挿入するスクリプトを作成 $ wget https://raw.githubusercontent.com/labunix/fortigate-80c-settings/master/spamtest.sh; \ chmod +x spamtest.sh ■Fortigateを通るメールサーバのIPとポート、 それとランダムで選択するドメインの数を指定するだけ。 $ ./spamtest.sh Input Mail Server IP(default 192.168.1.251) Input Mail Server Port (default 25) Input Loop count (default 5) ■スパム検知されたメールを確認。 件名に「Spam」が挿入されて HTTML形式の警告文(誤検知の場合の報告リンク付)に差し替えられ、 署名の「fortigate」が追加された。 From labunix@myhome.local Mon Mar 9 01:13:42 2015 X-Original-To: labunix@myhome.local X-Quarantine-ID: <X_dJDqouDwMz> X-Virus-Scanned: Debian amavisd-new at myhome.local X-Amavis-Alert: BAD HEADER SECTION, Missing required header field: "Date" X-Spam-Flag: NO X-Spam-Score: 6.058 X-Spam-Level: ****** X-Spam-Status: No, score=6.058 tagged_above=2 required=6.31 tests=[ALL_TRUSTED=-1, HTML_MESSAGE=0.001, HTML_MIME_NO_HTML_TAG=0.635, MIME_HEADER_CTYPE_ONLY=1.996, MIME_HTML_ONLY=1.105, MISSING_DATE=1.396, MISSING_HEADERS=1.207, MISSING_MID=0.14, NO_DNS_FOR_FROM=0.379, TO_NO_BRKTS_HTML_ONLY=0.199] autolearn=no Subject: =?utf-8?Q?=5BSpam=5D?= Test X-SpamInfo: FortiGuard - AntiSpam ase, X-ASE-REPORT: 104fb30b3c72d4047231a7031b550ea48 Threshold 80 Verdict score 100 Engine version 1.00001.117 Rule version 1001 FortiRule: 100 R_NUM_URI_BLAC K FortiSig1: 1 attirep.ru Content-Type: text/html; <DIV><a style="color: blue; background-color: ffffdd" href="http://nospammer.net/SubmitSpam/submitspam.php?id=I3QzCHQoUHNmYg9ffEtz TA__&sig=e3g0DkcJWR9oIzFtaiVlc3l4NC12MTN.CVdFBRhAFV8LDQ__"> If this email is not spam, click here to submit the signatures to FortiGuard - AntiSpam Service. </a></DIV> <PRE> attirep.ru fortigate