FortiGate で Syslog サーバを設定する方法を説明します。
想定ネットワーク構成
以下のネットワーク構成を想定します。
FortiGate について
- 型番:FortiGate 60E
- ファームウェアバージョン:v6.0.6 build0272 (GA)
要件
FortiGateからSyslogサーバへ各種ログを送信するよう設定する。
Syslog サーバの設定手順
GUI で設定する場合の手順
[ログ&レポート]→[ログ設定] の画面にて、以下項目を設定します。
- リモートロギングとアーカイブ
- ログをSyslogへ送る → ON
- IPアドレス/FQDN → 10.1.10.5(SyslogサーバのIPアドレス)
設定後、画面下部の [適用] をクリックします。
これだけで設定は完了です。
CLI で設定する場合の手順
Syslog サーバの設定に該当するコンフィグの項目は config log syslogd setting です。
設定前のコンフィグ内容は以下の通りです。
FW01 # show log syslogd setting
config log syslogd setting
end
Syslog サーバを設定するコマンドは以下の通りです。
config log syslogd setting
set status enable
set server "10.1.10.5"
set mode udp
set port 514
set facility local7
set source-ip ''
set format default
end
各項目の意味は以下の通りです。
config log syslogd setting
set status enable #← Syslogサーバ設定を有効化
set server "10.1.10.5" #← SyslogサーバのIPアドレス
#以下の項目はデフォルト値のため変更が無ければ明示的に設定しなくてもOK
set mode udp #← Syslogの形式の指定
set port 514 #← Syslogサーバの受付ポート
set facility local7 #← Syslogのファシリティ
set source-ip '' #← Syslog送信のソースIPアドレス
set format default #← ログフォーマット
end
設定後の show syslogd setting
を確認します。
FW01 # show log syslogd setting
config log syslogd setting
set status enable
set server "10.1.10.5"
end
Syslogサーバでのログ確認
Ubuntu の rsyslog を使用して FortiGate からログを受信してみます。
結果として以下のようなログを受信できていることを確認できました。
user01@ubuntuPC:/var/log$ tail syslog
Feb 29 21:56:01 _gateway date=2020-02-29 time=21:56:01 devname="FW01" devid="FGT60Exxxxxxxxxx" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1582980961 srcip=fe80::9c61:f90:98e2:2610 srcport=51568 srcintf="VLAN10" srcintfrole="lan" dstip=ff02::c dstport=1900 dstintf=unknown-0 dstintfrole="undefined" sessionid=692471 proto=17 action="deny" policyid=0 policytype="local-in-policy6" service="udp/1900" dstcountry="Reserved" srccountry="Reserved" trandisp="noop" app="udp/1900" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 rcvdpkt=0 appcat="unscanned"
Feb 29 21:56:05 _gateway date=2020-02-29 time=21:56:04 devname="FW01" devid="FGT60Exxxxxxxxxx" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1582980964 srcip=fe80::8c4a:9856:1588:7abb srcport=57001 srcintf="VLAN10" srcintfrole="lan" dstip=ff02::1:3 dstport=5355 dstintf=unknown-0 dstintfrole="undefined" sessionid=692473 proto=17 action="deny" policyid=0 policytype="local-in-policy6" service="udp/5355" dstcountry="Reserved" srccountry="Reserved" trandisp="noop" app="udp/5355" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 rcvdpkt=0 appcat="unscanned"
Feb 29 21:56:05 _gateway date=2020-02-29 time=21:56:04 devname="FW01" devid="FGT60Exxxxxxxxxx" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1582980964 srcip=fe80::8c4a:9856:1588:7abb srcport=61236 srcintf="VLAN10" srcintfrole="lan" dstip=ff02::1:3 dstport=5355 dstintf=unknown-0 dstintfrole="undefined" sessionid=692475 proto=17 action="deny" policyid=0 policytype="local-in-policy6" service="udp/5355" dstcountry="Reserved" srccountry="Reserved" trandisp="noop" app="udp/5355" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 rcvdpkt=0 appcat="unscanned"
Feb 29 21:56:05 _gateway date=2020-02-29 time=21:56:05 devname="FW01" devid="FGT60Exxxxxxxxxx" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1582980965 srcip=fe80::8c4a:9856:1588:7abb srcport=57001 srcintf="VLAN10" srcintfrole="lan" dstip=ff02::1:3 dstport=5355 dstintf=unknown-0 dstintfrole="undefined" sessionid=692477 proto=17 action="deny" policyid=0 policytype="local-in-policy6" service="udp/5355" dstcountry="Reserved" srccountry="Reserved" trandisp="noop" app="udp/5355" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 rcvdpkt=0 appcat="unscanned"
Feb 29 21:56:05 _gateway date=2020-02-29 time=21:56:05 devname="FW01" devid="FGT60Exxxxxxxxxx" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1582980965 srcip=fe80::8c4a:9856:1588:7abb srcport=61236 srcintf="VLAN10" srcintfrole="lan" dstip=ff02::1:3 dstport=5355 dstintf=unknown-0 dstintfrole="undefined" sessionid=692479 proto=17 action="deny" policyid=0 policytype="local-in-policy6" service="udp/5355" dstcountry="Reserved" srccountry="Reserved" trandisp="noop" app="udp/5355" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 rcvdpkt=0 appcat="unscanned"
Feb 29 21:56:05 _gateway date=2020-02-29 time=21:56:05 devname="FW01" devid="FGT60Exxxxxxxxxx" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1582980965 srcip=10.1.10.6 srcport=17500 srcintf="VLAN10" srcintfrole="lan" dstip=10.1.10.255 dstport=17500 dstintf=unknown-0 dstintfrole="undefined" sessionid=5576556 proto=17 action="deny" policyid=0 policytype="local-in-policy" service="udp/17500" dstcountry="Reserved" srccountry="Reserved" trandisp="noop" app="udp/17500" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 appcat="unscanned"
Feb 29 21:56:05 _gateway date=2020-02-29 time=21:56:05 devname="FW01" devid="FGT60Exxxxxxxxxx" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1582980965 srcip=10.1.10.6 srcport=17500 srcintf="VLAN10" srcintfrole="lan" dstip=255.255.255.255 dstport=17500 dstintf=unknown-0 dstintfrole="undefined" sessionid=5576554 proto=17 action="deny" policyid=0 policytype="local-in-policy" service="udp/17500" dstcountry="Reserved" srccountry="Reserved" trandisp="noop" app="udp/17500" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 appcat="unscanned"
Feb 29 21:56:05 _gateway date=2020-02-29 time=21:56:05 devname="FW01" devid="FGT60Exxxxxxxxxx" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1582980965 srcip=10.1.10.6 srcport=17500 srcintf="VLAN10" srcintfrole="lan" dstip=255.255.255.255 dstport=17500 dstintf=unknown-0 dstintfrole="undefined" sessionid=5576558 proto=17 action="deny" policyid=0 policytype="local-in-policy" service="udp/17500" dstcountry="Reserved" srccountry="Reserved" trandisp="noop" app="udp/17500" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 appcat="unscanned"
Feb 29 21:56:05 _gateway date=2020-02-29 time=21:56:05 devname="FW01" devid="FGT60Exxxxxxxxxx" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1582980965 srcip=fe80::9c61:f90:98e2:2610 srcport=51568 srcintf="VLAN10" srcintfrole="lan" dstip=ff02::c dstport=1900 dstintf=unknown-0 dstintfrole="undefined" sessionid=692481 proto=17 action="deny" policyid=0 policytype="local-in-policy6" service="udp/1900" dstcountry="Reserved" srccountry="Reserved" trandisp="noop" app="udp/1900" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 rcvdpkt=0 appcat="unscanned"
Feb 29 21:56:08 _gateway date=2020-02-29 time=21:56:08 devname="FW01" devid="FGT60Exxxxxxxxxx" logid="0001000014" type="traffic" subtype="local" level="notice" vd="root" eventtime=1582980968 srcip=fe80::9c61:f90:98e2:2610 srcport=51568 srcintf="VLAN10" srcintfrole="lan" dstip=ff02::c dstport=1900 dstintf=unknown-0 dstintfrole="undefined" sessionid=692483 proto=17 action="deny" policyid=0 policytype="local-in-policy6" service="udp/1900" dstcountry="Reserved" srccountry="Reserved" trandisp="noop" app="udp/1900" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 rcvdpkt=0 appcat="unscanned"
保存されるログの内容について
Syslog サーバに保存されるログの内容は FortiGate で設定したログ設定に依存します。
ログ設定項目としては次のような項目があります。
ログ設定画面のログ設定
[ログ&レポート] → [ログ設定] の画面にて設定したイベントロギング、ローカルトラフィックログ。
ポリシー設定のロギングオプション
許可ポリシーの場合は [セキュリティイベント] か [すべてのセッション] が選択できます。
- セキュリティイベント → セキュリティプロファイルが適用された通信のログ
- すべてのセッション → 当該ポリシーで許可されたすべての通信のログ
拒否ポリシーの場合は [違反トラフィックをログ] となっていて、拒否した通信のログを保存できます。
[すべてのセッション] や [違反トラフィックをログ] を ON にすると、ログの量が膨大になり Syslog サーバのディスク容量を圧迫する可能性があるため注意してください。
Syslog のフィルタ設定
コンフィグの config log syslogd filter 項目で Syslog に関するフィルタ設定ができます。
FW01 # show full-configuration log syslogd filter
config log syslogd filter
set severity information
set forward-traffic enable
set local-traffic enable
set multicast-traffic enable
set sniffer-traffic enable
set anomaly enable
set voip enable
set dns enable
set ssh enable
set filter ''
set filter-type include
end
上のコンフィグの中の set severity
項目で Syslog へ送信するログの重要度を設定できます。
set severity
に設定できる値は以下の通りです。
# set severity
emergency Emergency level.
alert Alert level.
critical Critical level.
error Error level.
warning Warning level.
notification Notification level.
information Information level.
debug Debug level.
デフォルトは information
です。必要に応じて設定変更してください。
―――――――――――――
次のステップ → FortiGate 60E で HA(冗長構成)を構築する
―――――――――――――