【FortiGate】Webフィルタ機能の基本的な設定を理解する

ファイアウォール(UTM)
スポンサーリンク

作業環境

  • FortiGate 60E
    • version 7.0.1

Webフィルタ機能概要

Webフィルタ機能では、Webフィルタプロファイルを(ファイアウォール)ポリシーに適用することによって、 適用したプロファイルの内容に従って当該ポリシーに合致するトラフィックについて Web リソースへのユーザアクセスを制限または制御することができます。

ポリシー設定画面のセキュリティプロファイル設定欄

3 つの主要コンポーネント

  1. Web コンテンツフィルタ
    • 指定した単語またはパターンを含む Web ページをブロックする
  2. URL フィルタ
    • URL や URL パターンを使用して、それに合致する URL への Web アクセスをブロックまたは許可したり、FortiSandbox によって検出された悪意のある URL をブロックしたりする
  3. FortiGuard Web フィルタリングサービス
    • Webトラフィックのフィルタリングに使用できる多くの追加カテゴリを提供し、カテゴリ別のアクセス制御を可能とする

デフォルトの Webフィルタプロファイル

デフォルトでは以下の 3 つの Webフィルタプロファイルが存在します。

  • default
  • monitor-all
  • wifi-default

これらのプロファイルをカスタマイズして使用することも、新規にオリジナルのプロファイルを作成して使用することも可能です。

Webフィルタプロファイル設定画面

GUI で設定する場合は、[セキュリティプロファイル > Webフィルタ] 画面で実施できます。

プロファイルを新規作成する場合は [新規作成] ボタンから実施できます。

フローベースとプロキシベース

プロファイルの設定項目である [機能セット] の値としてフローベースプロキシベースかを選択できます。

プロキシベースの場合のみ使用できる機能がいくつかありますが、プロキシベースにするとフローベースよりもスループットが小さくなるといわれています。

◆フローベースの場合の設定項目

◆プロキシベースの場合の設定項目

上の画像で (P) マークがついている設定項目はプロキシベースの場合のみ使用できる機能です。

CLI でのコンフィグ

CLI における Webフィルタプロファイルのコンフィグは config webfilter profile です。

config webfilter profile
    edit "default"
        set comment "Default web filtering."
        set feature-set proxy
        config ftgd-wf
            unset options
            config filters
                edit 1
                    set category 2
                    set action block
                next
                edit 2
                    set category 7
                    set action block
                next
                edit 3
                    set category 8
                    set action block
                next
                ...
                edit 23
                    set category 91
                    set action block
                next
            end
        end
    next
end

Webフィルタ機能の適用順序

複数ある Webフィルタ機能について適用される順序は以下の通りです。

  1. URLフィルタ
  2. FortiGuard Webフィルタ
  3. Webコンテンツフィルタ
  4. Webスクリプトフィルタ
  5. アンチウイルススキャン

この適用順序を利用して、URLフィルタにて指定の URL のみ後続のフィルタ処理から除外する、といった設計にすることもできます。

URLフィルタの設定

URLフィルタでは、指定したテキストや正規表現を含むパターンを持つ特定の URL についてブロック、許可、モニタなどを実施することができます。

URLフィルタの設定は、Webフィルタプロファイル設定画面の中の [スタティックURLフィルタ] 欄で行います。

URLフィルタタイプ

  • シンプル:
    • 指定した URL と完全一致した場合にヒットと判定する
  • 正規表現/ワイルドカード:
    • 正規表現またはワイルドカードのルールに基づいて判定する

URLフィルタアクション

  • 除外(exempt):
    • 後続のWebフィルタ機能(Webコンテンツフィルタなど)での評価を免除される(許可扱い)
    • FortiGuard Webフィルタや Webコンテンツフィルタの対象から除外する意図で使用される
  • ブロック:
    • アクセスをブロックする
  • 許可:
    • 許可され、後続のWebフィルタ機能(Webコンテンツフィルタなど)での評価に進む
  • モニタ:
    • 「許可」と同じ処理、かつログに記録される

CLI での設定

URLフィルタの設定は、CLI コンフィグ上では、Webフィルタプロファイルのコンフィグ(config webfilter profile)の中で、URLフィルタのコンフィグ(config webfilter urlfilter)内のレコードを参照する形になっています。

config webfilter profile
    edit "default"
        #中略
        config web
            #中略
            set urlfilter-table 1 "<---config webfilter urlfilter のレコードを参照している"
            #中略
        end
        #中略
    next
end

config webfilter urlfilter
    edit 1 "<---このレコードが参照されている"
        set name "Auto-webfilter-urlfilter_9c7amcqzu"
        set comment ''
        set one-arm-ips-urlfilter disable
        set ip-addr-block disable
        config entries
            edit 1
                set url "*yahoo.co.jp"
                set type wildcard
                set action block
                set antiphish-action block
                set status enable
                set referrer-host ''
            next
        end
    next
end

動作確認

以下のような URLフィルタを設定していたとします。

この URLフィルタを含む Webフィルタプロファイルをポリシーに適用した状態で yahoo.co.jp にアクセスすると以下の画面が表示されアクセスがブロックされます。

URLフィルタのログ確認

GUI の [ログ&レポート > Webフィルタ] 画面で URLフィルタのログを確認できます。

CLI でのログ表示

CLI では以下の手順でローカルログの確認ができます。

1. ログフィルタの設定
FW01 # execute log filter category utm-webfilter

2. ログの表示
FW01 # execute log display
72 logs found.
10 logs returned.
40.7% of logs has been searched.

1: date=2021-10-25 time=14:19:23 eventtime=1635139163990211500 tz="+0900" logid="0315012544" type="utm" subtype="webfilter" eventtype="urlfilter" level="warning" vd="root" urlfilteridx=1 urlfilterlist="Auto-webfilter-urlfilter_9c7amcqzu" policyid=15 sessionid=403964 srcip=10.1.10.3 srcport=54554 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=204.79.197.200 dstport=443 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTPS" hostname="c.bing.com" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="https://c.bing.com/" sentbyte=517 rcvdbyte=0 direction="outgoing" urlsource="Local URLfilter Block" msg="URL was blocked because it is in the URL filter list" crscore=30 craction=8 crlevel="high"

2: date=2021-10-25 time=14:19:23 eventtime=1635139163974792425 tz="+0900" logid="0315012544" type="utm" subtype="webfilter" eventtype="urlfilter" level="warning" vd="root" urlfilteridx=1 urlfilterlist="Auto-webfilter-urlfilter_9c7amcqzu" policyid=15 sessionid=403962 srcip=10.1.10.3 srcport=54553 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=13.107.21.200 dstport=443 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTPS" hostname="www.bing.com" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="https://www.bing.com/" sentbyte=517 rcvdbyte=0 direction="outgoing" urlsource="Local URLfilter Block" msg="URL was blocked because it is in the URL filter list" crscore=30 craction=8 crlevel="high"

3: date=2021-10-25 time=14:19:23 eventtime=1635139163683364458 tz="+0900" logid="0315012544" type="utm" subtype="webfilter" eventtype="urlfilter" level="warning" vd="root" urlfilteridx=1 urlfilterlist="Auto-webfilter-urlfilter_9c7amcqzu" policyid=15 sessionid=403960 srcip=10.1.10.3 srcport=54551 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=13.107.21.200 dstport=443 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTPS" hostname="www.bing.com" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="https://www.bing.com/" sentbyte=517 rcvdbyte=0 direction="outgoing" urlsource="Local URLfilter Block" msg="URL was blocked because it is in the URL filter list" crscore=30 craction=8 crlevel="high"

4: date=2021-10-25 time=14:19:23 eventtime=1635139163301477551 tz="+0900" logid="0315012544" type="utm" subtype="webfilter" eventtype="urlfilter" level="warning" vd="root" urlfilteridx=1 urlfilterlist="Auto-webfilter-urlfilter_9c7amcqzu" policyid=15 sessionid=403951 srcip=10.1.10.3 srcport=54544 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=13.107.21.200 dstport=443 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTPS" hostname="www.bing.com" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="https://www.bing.com/" sentbyte=517 rcvdbyte=0 direction="outgoing" urlsource="Local URLfilter Block" msg="URL was blocked because it is in the URL filter list" crscore=30 craction=8 crlevel="high"

5: date=2021-10-25 time=14:19:23 eventtime=1635139163074246509 tz="+0900" logid="0315012544" type="utm" subtype="webfilter" eventtype="urlfilter" level="warning" vd="root" urlfilteridx=1 urlfilterlist="Auto-webfilter-urlfilter_9c7amcqzu" policyid=15 sessionid=403948 srcip=10.1.10.3 srcport=54542 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=204.79.197.200 dstport=443 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTPS" hostname="c.bing.com" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="https://c.bing.com/" sentbyte=517 rcvdbyte=0 direction="outgoing" urlsource="Local URLfilter Block" msg="URL was blocked because it is in the URL filter list" crscore=30 craction=8 crlevel="high"

6: date=2021-10-25 time=14:19:23 eventtime=1635139162996921985 tz="+0900" logid="0315012544" type="utm" subtype="webfilter" eventtype="urlfilter" level="warning" vd="root" urlfilteridx=1 urlfilterlist="Auto-webfilter-urlfilter_9c7amcqzu" policyid=15 sessionid=403945 srcip=10.1.10.3 srcport=54539 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=13.107.21.200 dstport=443 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTPS" hostname="www.bing.com" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="https://www.bing.com/" sentbyte=517 rcvdbyte=0 direction="outgoing" urlsource="Local URLfilter Block" msg="URL was blocked because it is in the URL filter list" crscore=30 craction=8 crlevel="high"

7: date=2021-10-25 time=14:19:22 eventtime=1635139162755785205 tz="+0900" logid="0315012544" type="utm" subtype="webfilter" eventtype="urlfilter" level="warning" vd="root" urlfilteridx=1 urlfilterlist="Auto-webfilter-urlfilter_9c7amcqzu" policyid=15 sessionid=403940 srcip=10.1.10.3 srcport=54536 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=13.107.21.200 dstport=443 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTPS" hostname="www.bing.com" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="https://www.bing.com/" sentbyte=517 rcvdbyte=0 direction="outgoing" urlsource="Local URLfilter Block" msg="URL was blocked because it is in the URL filter list" crscore=30 craction=8 crlevel="high"

8: date=2021-10-25 time=14:19:22 eventtime=1635139162693403973 tz="+0900" logid="0315012544" type="utm" subtype="webfilter" eventtype="urlfilter" level="warning" vd="root" urlfilteridx=1 urlfilterlist="Auto-webfilter-urlfilter_9c7amcqzu" policyid=15 sessionid=403939 srcip=10.1.10.3 srcport=54535 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=13.107.21.200 dstport=443 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTPS" hostname="www.bing.com" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="https://www.bing.com/" sentbyte=517 rcvdbyte=0 direction="outgoing" urlsource="Local URLfilter Block" msg="URL was blocked because it is in the URL filter list" crscore=30 craction=8 crlevel="high"

9: date=2021-10-25 time=14:19:10 eventtime=1635139150097765866 tz="+0900" logid="0315012544" type="utm" subtype="webfilter" eventtype="urlfilter" level="warning" vd="root" urlfilteridx=1 urlfilterlist="Auto-webfilter-urlfilter_9c7amcqzu" policyid=15 sessionid=403897 srcip=10.1.10.3 srcport=54525 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=183.79.250.123 dstport=80 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTP" hostname="yahoo.co.jp" profile="WebFilterProfile01" action="blocked" reqtype="referral" url="http://yahoo.co.jp/favicon.ico" referralurl="http://yahoo.co.jp/" sentbyte=396 rcvdbyte=0 direction="outgoing" urlsource="Local URLfilter Block" msg="URL was blocked because it is in the URL filter list" crscore=30 craction=8 crlevel="high"

10: date=2021-10-25 time=14:19:10 eventtime=1635139149995767092 tz="+0900" logid="0315012544" type="utm" subtype="webfilter" eventtype="urlfilter" level="warning" vd="root" urlfilteridx=1 urlfilterlist="Auto-webfilter-urlfilter_9c7amcqzu" policyid=15 sessionid=403898 srcip=10.1.10.3 srcport=54524 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=183.79.250.123 dstport=80 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTP" hostname="yahoo.co.jp" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="http://yahoo.co.jp/" sentbyte=456 rcvdbyte=0 direction="outgoing" urlsource="Local URLfilter Block" msg="URL was blocked because it is in the URL filter list" crscore=30 craction=8 crlevel="high"

3. ログフィルタのリセット
FW01 # execute log filter reset

ブラックリストとホワイトリスト

Web フィルタリングにはブラックリスト方式ホワイトリスト方式という考え方があります。

  • ブラックリスト方式:
    • 原則アクセスを許可し、ブラックリストと呼ばれるリストに記載されたものに関してはブロックする
  • ホワイトリスト方式:
    • 原則アクセスをブロックし、ホワイトリストと呼ばれるリストに記載されたものに関しては許可する

FortiGate の URLフィルタに関しては、URLフィルタで指定されているどの URL パターンにも合致しない URL に関しては許可されるという、ブラックリスト方式になっています。

ホワイトリスト方式で設定したい場合

指定した URL についてのみアクセスを許可するというホワイトリスト方式で設定したい場合は、以下画像のように URLフィルタルールの最後にすべての URL についてブロックするルールを追加し、このルールより上に許可したい URL についてのルールを設定します。

ルールの適用順序と順序の変更

上の説明から察しているかとは思いますが、URLフィルタのルールは上側から順に適用されます。そのため許可とブロックのルールが混在しているケースではルールの適用順が重要になります。

ルールの適用順の変更方法についてですが、URLフィルタのルールリストの中の URL 欄で各ルールをドラッグ&ドロップすることによって位置(適用順序)を変更することが可能です。

FortiGuard Webフィルタ

FortiGuard Webフィルタは、数十億の Web ページを、ユーザーが許可またはブロックできるさまざまなカテゴリに分類してアクセス制御します。

FortiGuard Webフィルタの適用対象の Web トラフィックが発生すると、最も近い FortiGuard サーバにアクセス先 URL が送信され、どの URL カテゴリに分類されるかが返されます。

FortiGate では FortiGuard から返されたカテゴリと Webフィルタプロファイルの設定内容に基づき、Web アクセスがブロックまたは許可されます。

FortiGuard Webフィルタの設定

FortiGuard Webフィルタの設定は Webフィルタプロファイルの [FortiGuardカテゴリベースのフィルタ] を有効にして行います。

以下のように [FortiGuardカテゴリベースのフィルタ] を有効にするとカテゴリリストが表示されます。カテゴリ名の上にマウスポインタを持っていくと該当するサイトの例を確認できます。

[事前に設定されたフィルタ] としていくつかの設定セットがあり、ベースとする設定を選択することができます。

アクション

  • 許可:
    • カテゴリ内のサイトへのアクセスを許可する
  • モニタ:
    • カテゴリ内のサイトへのアクセスを許可およびログに記録する
  • ブロック:
    • カテゴリ内のサイトへのアクセスをブロックする
  • 警告:
    • 警告画面を表示し、ユーザが続行を選択した場合はサイトを閲覧可能
  • 認証:
    • カテゴリ内のサイトへのアクセスを許可する前にユーザに FortiGate での認証を要求する

動作確認

ブロックの場合

[ニュースとメディア] カテゴリをブロックと設定した Webフィルタプロファイルをポリシーに適用して、bbc.co.uk にアクセスします。

すると以下のような画面が表示され、アクセスがブロックされます。

警告の場合

次に、フィルタのアクションを警告に変更し、再度 bbc.co.uk にアクセスします。

すると以下のような警告画面が表示されます。

上の警告画面でユーザが [Proceed] をクリックすると Web サイトが表示されます。

認証の場合

次に、フィルタのアクションを認証にしてみます。

設定画面で対象カテゴリのアクションを認証にすると以下の画面が表示されるため、認証で使用したいユーザグループを指定します。(FortiGate で定義されているユーザグループの中から選択します。)

設定後、 再度 bbc.co.uk にアクセスします。

すると以下のように警告画面と同様の画面がまず表示され、[Proceed] をクリックすると認証画面が表示されます。

認証情報を入力し [継続] をクリックすると Web サイトが表示されます。

FortiGuard Webフィルタのログ確認

GUI の [ログ&レポート > Webフィルタ] 画面で FortiGuard Webフィルタのログを確認できます。

CLI でのログ表示

CLI では以下の手順でローカルログの確認ができます。

1. ログフィルタの設定
FW01 # execute log filter category utm-webfilter

2. ログの表示
FW01 # execute log display
97 logs found.
10 logs returned.
23.5% of logs has been searched.

1: date=2021-10-25 time=15:26:01 eventtime=1635143161905835922 tz="+0900" logid="0316013056" type="utm" subtype="webfilter" eventtype="ftgd_blk" level="warning" vd="root" policyid=15 sessionid=413061 srcip=10.1.10.3 srcport=52131 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=151.101.128.81 dstport=80 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTP" hostname="bbc.co.uk" profile="WebFilterProfile01" action="blocked" reqtype="referral" url="http://bbc.co.uk/favicon.ico" referralurl="http://bbc.co.uk/" sentbyte=392 rcvdbyte=0 direction="outgoing" msg="URL belongs to a denied category in policy" method="domain" cat=36 catdesc="ニュースとメディア"

2: date=2021-10-25 time=15:26:01 eventtime=1635143161814578628 tz="+0900" logid="0316013056" type="utm" subtype="webfilter" eventtype="ftgd_blk" level="warning" vd="root" policyid=15 sessionid=413060 srcip=10.1.10.3 srcport=52130 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=151.101.128.81 dstport=80 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTP" hostname="bbc.co.uk" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="http://bbc.co.uk/" sentbyte=480 rcvdbyte=0 direction="outgoing" msg="URL belongs to a denied category in policy" method="domain" cat=36 catdesc="ニュースとメディア"

3: date=2021-10-25 time=15:25:24 eventtime=1635143125188436420 tz="+0900" logid="0316013056" type="utm" subtype="webfilter" eventtype="ftgd_blk" level="warning" vd="root" policyid=15 sessionid=413001 srcip=10.1.10.3 srcport=54983 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=151.101.128.81 dstport=80 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTP" hostname="bbc.co.uk" profile="WebFilterProfile01" action="blocked" reqtype="referral" url="http://bbc.co.uk/favicon.ico" referralurl="http://bbc.co.uk/" sentbyte=392 rcvdbyte=0 direction="outgoing" msg="URL belongs to a denied category in policy" method="domain" cat=36 catdesc="ニュースとメディア"

4: date=2021-10-25 time=15:25:24 eventtime=1635143125098087226 tz="+0900" logid="0316013056" type="utm" subtype="webfilter" eventtype="ftgd_blk" level="warning" vd="root" policyid=15 sessionid=413001 srcip=10.1.10.3 srcport=54982 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=151.101.128.81 dstport=80 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTP" hostname="bbc.co.uk" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="http://bbc.co.uk/" sentbyte=454 rcvdbyte=0 direction="outgoing" msg="URL belongs to a denied category in policy" method="domain" cat=36 catdesc="ニュースとメディア"

5: date=2021-10-25 time=15:24:54 eventtime=1635143094473240424 tz="+0900" logid="0316013057" type="utm" subtype="webfilter" eventtype="ftgd_blk" level="warning" vd="root" policyid=15 sessionid=412927 srcip=10.1.10.3 srcport=54969 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=151.101.128.81 dstport=80 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTP" hostname="bbc.co.uk" profile="WebFilterProfile01" action="blocked" reqtype="referral" url="http://bbc.co.uk/favicon.ico" referralurl="http://bbc.co.uk/" sentbyte=392 rcvdbyte=0 direction="outgoing" msg="URL belongs to a category with warnings enabled" method="domain" cat=36 catdesc="ニュースとメディア"

6: date=2021-10-25 time=15:24:53 eventtime=1635143093879287679 tz="+0900" logid="0316013057" type="utm" subtype="webfilter" eventtype="ftgd_blk" level="warning" vd="root" policyid=15 sessionid=412928 srcip=10.1.10.3 srcport=54970 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=151.101.128.81 dstport=80 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTP" hostname="bbc.co.uk" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="http://bbc.co.uk/" sentbyte=454 rcvdbyte=0 direction="outgoing" msg="URL belongs to a category with warnings enabled" method="domain" cat=36 catdesc="ニュースとメディア"

7: date=2021-10-25 time=15:23:33 eventtime=1635143013482261313 tz="+0900" logid="0316013057" type="utm" subtype="webfilter" eventtype="ftgd_blk" level="warning" vd="root" policyid=15 sessionid=412701 srcip=10.1.10.3 srcport=64630 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=151.101.128.81 dstport=80 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTP" hostname="bbc.co.uk" profile="WebFilterProfile01" action="blocked" reqtype="referral" url="http://bbc.co.uk/favicon.ico" referralurl="http://bbc.co.uk/" sentbyte=374 rcvdbyte=0 direction="outgoing" msg="URL belongs to a category with warnings enabled" method="domain" cat=36 catdesc="ニュースとメディア"

8: date=2021-10-25 time=15:23:33 eventtime=1635143013163071256 tz="+0900" logid="0316013057" type="utm" subtype="webfilter" eventtype="ftgd_blk" level="warning" vd="root" policyid=15 sessionid=412700 srcip=10.1.10.3 srcport=64663 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=151.101.128.81 dstport=80 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTP" hostname="bbc.co.uk" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="http://bbc.co.uk/" sentbyte=436 rcvdbyte=0 direction="outgoing" msg="URL belongs to a category with warnings enabled" method="domain" cat=36 catdesc="ニュースとメディア"

9: date=2021-10-25 time=15:23:32 eventtime=1635143012633926398 tz="+0900" logid="0316013057" type="utm" subtype="webfilter" eventtype="ftgd_blk" level="warning" vd="root" policyid=15 sessionid=412696 srcip=10.1.10.3 srcport=57752 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=151.101.128.81 dstport=443 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTPS" hostname="bbc.co.uk" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="https://bbc.co.uk/" sentbyte=517 rcvdbyte=0 direction="outgoing" msg="URL belongs to a category with warnings enabled" method="domain" cat=36 catdesc="ニュースとメ ディア"

10: date=2021-10-25 time=15:23:32 eventtime=1635143012633926508 tz="+0900" logid="0316013057" type="utm" subtype="webfilter" eventtype="ftgd_blk" level="warning" vd="root" policyid=15 sessionid=412697 srcip=10.1.10.3 srcport=54003 srcintf="VLAN10" srcintfrole="lan" srcuuid="769878e8-1967-51ea-d211-302593b302ea" dstip=151.101.128.81 dstport=443 dstintf="wan1" dstintfrole="wan" dstuuid="da05e890-05d8-51ea-f01b-cfba759f8e4b" proto=6 service="HTTPS" hostname="bbc.co.uk" profile="WebFilterProfile01" action="blocked" reqtype="direct" url="https://bbc.co.uk/" sentbyte=517 rcvdbyte=0 direction="outgoing" msg="URL belongs to a category with warnings enabled" method="domain" cat=36 catdesc="ニュースとメディア"

3. ログフィルタのリセット
FW01 # execute log filter reset

Web コンテンツフィルタ

Web コンテンツフィルタでは、特定の単語やパターンを含む Web ページをブロックすることにより Web コンテンツへのアクセスを制御します。

コンテンツ評価

  • 禁止されている単語やフレーズを指定し、それらの単語やフレーズの重要度に数値(またはスコア)を付けることができる
  • Webコンテンツフィルタスキャンが禁止されたコンテンツを検出すると、そのページで見つかった禁止された単語やフレーズのスコアが追加される
  • スコア合計が Webフィルタプロファイルで設定されたしきい値よりも高い場合、FortiGate はページをブロックする
  • Webコンテンツフィルターのデフォルトスコアは 10 で、デフォルトのしきい値は 10。これは、デフォルトで、Web ページが 1 回の一致によってブロックされることを意味する
  • これらの設定は CLI でのみ設定できる

Web コンテンツフィルタの設定

Web コンテンツフィルタの設定は、Webフィルタプロファイルの [スタティックURLフィルタ > コンテンツフィルタ] で行います。

コンテンツフィルタ欄の表上部の [新規作成] をクリックすると新規Webコンテンツフィルタ設定画面が表示されるため、任意の設定を行います。

以下画像では「カジノ」を含むページをブロックする設定としています。

CLI での設定

Webコンテンツフィルタの設定は、CLI コンフィグ上では、Webフィルタプロファイルのコンフィグ(config webfilter profile)の中で、Webコンテンツフィルタのコンフィグ(config webfilter content)内のレコードを参照する形になっています。

config webfilter profile
    edit "default"
        #中略
        config web
            set bword-table 1 "<---config webfilter profile のレコードを参照している"
        end
        #中略
    next
end

config webfilter content
    edit 1 "<---このレコードが参照されている"
        set name "Auto-webfilter-content_se02e0yjy"
        config entries
            edit "カジノ"
                set status enable
                set lang japanese
            next
        end
    next
end

動作確認

特定のパターンを指定して、アクションをブロックに設定します。

その後、そのパターンに該当する文字列を含む Web サイトにアクセスすると、以下の画面が表示されアクセスがブロックされます。

HTTPS 通信の場合

HTTPS 通信の場合は、通信が暗号化されているためコンテンツフィルタリングができません。HTTPS についてもフィルタリングしたい場合は、SSL インスペクションを併せて使用する必要があると思われます。

Web コンテンツフィルタのログ確認

GUI の [ログ&レポート > Webフィルタ] 画面で Web コンテンツフィルタのログを確認できます。

Web フィルタ統計情報の確認

diagnose webfilter stats list root コマンドで統計情報を確認できます。

FW01 # diagnose webfilter stats list root
Proxy/flow URL filter stats:
 request:   0
 blocked:   0
 allowed:   0
 overridden:0
 logged:    0
 pending:   0

参考資料

FortiGuard Webフィルタリングサービス|サポート|ネットワークセキュリティのフォーティネット
FortiGuard Webフィルタリングは、悪意のあるWebサイトやハッキングされたWebサイト、などをブロックすることで、組織を保護します。フォーティネットは、お客様に満足していただける製品/サービスの提供に最優先で取り組んでいます。
Web filter | Administration Guide
webfilter | CLI Reference

タイトルとURLをコピーしました