Linux システムでの syslog サーバ設定の例
LinuxシステムでのSyslogサーバー設定例の概要
セキュアな Junos OS 環境では、イベントを監査し、ローカルの監査ファイルに保存する必要があります。記録されたイベントは、同時に外部の syslog サーバに送信されます。syslog サーバーは、デバイスからストリーミングされた syslog メッセージを受信します。syslogサーバには、ストリーミングされたsyslogメッセージを受信するように設定されたNETCONFサポート付きのSSHクライアントが必要です。
NDcPP2.2eログはイベントをキャプチャします。そのうちのいくつかを以下に示します。
-
コミットされた変更
-
ユーザーのログインとログアウト
-
SSHセッションの確立の失敗
-
SSHセッションの確立または終了
-
システム時刻の変更
次の手順は、StrongSwan設定を使用してLinuxプラットフォーム上でsyslogサーバを設定し、IPsecを提供する方法を示す例です。開始する前に、Linux ベースの syslog サーバーを IP アドレスとゲートウェイで構成し、StrongSwan IPsec クライアントを syslog サーバーにインストールして、Junos OS デバイスとの VPN 接続を開始する必要があります。
IPsec VPN 機能を提供するためにリモート syslog サーバーで StrongSwan 構成をセットアップするには、次の手順を実行します。
-
Junos OS デバイスの構成に従って、 /etc/ipsec.secrets の設定を変更します。
root@host# vi /etc/ipsec.secrets 192.168.1.2 192.168.1.1 : PSK “12345”
-
Junos OS デバイスの設定に従って、 /etc/ipsec.conf の設定を変更します。
root@host# vi /etc/ipsec.conf config setup charondebug="ike 4, cfg 4, chd 4, enc 1, net 4, knl 4, dmn 4" conn %default ikelifetime=240 keylife=300 rekeymargin=10s keyingtries=%forever mobike=no conn home keyexchange=ikev1 authby=psk ike=aes128-sha256-modp2048! esp=aes128-sha1-modp2048! left=192.168.1.2 # self if leftsubnet=203.0.113.1/24 # self net for proxy id leftid=192.168.1.2 # self id right=192.168.1.1 # peer if rightsubnet=192.168.2.0/24 # peer net for proxy id rightid=192.168.1.1 # peer id auto=add leftfirewall=yes dpdaction=restart dpddelay=10 dpdtimeout=120 rekeyfuzz=10% reauth=no
手記:ここでは、
conn home
は Junos OS デバイスと Syslog サーバー上の Strongswan VPN クライアント間に確立する IPSec トンネル接続の名前を指定し、ike=aes-sha256-modp2048
は接続に使用する IKE 暗号化および認証アルゴリズムと DH グループを指定し、esp=aes128-sha1
は接続に使用する ESP 暗号化および認証アルゴリズムを指定します。 -
ipsec up <being-established-ipsec-tunnel-name>
コマンドを使用して、IPsec サービスをアクティブにします。例えば[root@host]# ipsec up home 002 "home" #3: initiating Main Mode 104 "home" #3: STATE_MAIN_I1: initiate 010 "home" #3: STATE_MAIN_I1: retransmission; will wait 20s for response
-
IPsec StrongSwanサービスを再起動します。
root@host# ipsec restart
-
syslogで暗号化されたトラフィックを確認します。
root@host# tcpdump –I eth1 –vv –s 1500 –c 10 –o /var/tmp/Syslog_Traffic.pcap
-
/var/log/syslogをsyslogサーバー上の/var/tmp/syslog_verifyファイルにコピーして、Junos OSデバイスからのsyslogを検証します。
root@host# cp /var/log/syslog /var/tmp/syslog_verify
ローカル ファイルへのイベント ログの構成
ローカル・ファイルへの監査情報の保管、および記録する詳細レベルを syslog
ステートメントで構成できます。この例では、Audit_file という名前のファイルにログを格納 します
[edit system] syslog { file Audit_file; }
リモート サーバーへのイベント ログの構成
SSH経由でNETCONFを使用してイベントログメッセージをリモートシステムのイベントロギングサーバーに送信するイベントトレースモニターを設定して、監査情報の安全なリモートサーバーへのエクスポートを設定します。以下の手順は、SSH経由でNETCONFを使用して、安全な外部サーバーにシステムログメッセージを送信するために必要な設定を示しています。
リモートサーバーからの接続開始時のリモートサーバーへのイベントログの構成
次の手順では、TOE への SSH 接続がリモート システム ログ サーバーから開始されたときに、リモート サーバーへのイベント ログを設定する手順について説明します。
以下の出力は、syslog サーバのテスト ログ結果を示しています。
host@ssh-keygen -b 2048 -t rsa -C 'syslog-monitor key pair' -f ~/.ssh/syslog-monitor Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/host/.ssh/syslog-monitor. Your public key has been saved in /home/host/.ssh/syslog-monitor.pub. The key fingerprint is: ef:75:d7:68:c5:ad:8d:6f:5e:7a:7e:9b:3d:f1:4d:3f syslog-monitor key pair The key's randomart image is: +--[ RSA 2048]----+ | | | | | | | ..| | S +| | . Bo| | . . *.X| | . . o E@| | . .BX| +-----------------+ [host@linux]$ cat /home/host/.ssh/syslog-monitor.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrUREJUBpjwAoIgRrGy9zgt+ D2pikk3Q/Wdf8I5vr+njeqJhCx2bUAkrRbYXNILQQAZbg7kLfi/8TqqL eon4HOP2e6oCSorKdx/GrOTzLONL4fh0EyuSAk8bs5JuwWNBUokV025 gzpGFsBusGnlj6wqqJ/sjFsMmfxyCkbY+pUWb8m1/A9YjOFT+6esw+9S tF6Gbg+VpbYYk/Oday4z+z7tQHRFSrxj2G92aoliVDBLJparEMBc8w LdSUDxmgBTM2oadOmm+kreBUQjrmr6775RJn9H9YwIxKOxGm4SFnX/Vl4 R+lZ9RqmKH2wodIEM34K0wXEHzAzNZ01oLmaAVqT syslog-monitor key pair [host@linux]$ eval `ssh-agent` Agent pid 1453 [host@linux]$ ssh-add ~/.ssh/syslog-monitor Enter passphrase for /home/host/.ssh/syslog-monitor: Identity added: /home/host/.ssh/syslog-monitor (/home/host/.ssh/syslog-monitor)
host@linux]$ ssh syslog-mon@starfire -s netconf > test.out host@linux]$ cat test.out this is NDcPP test device <!-- No zombies were killed during the creation of this user interface -- <!-- user syslog-mon, class j-monitor -><hello> <capabilities> <capability>urn:ietf:params:xml:ns:netconf:base:1.0</capability> <capability>urn:ietf:params:xml:ns:netconf:capability:candidate:1.0</capability> <capability>urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0</capability> <capability>urn:ietf:params:xml:ns:netconf:capability:validate:1.0</capability> <capability>urn:ietf:params:xml:ns:netconf:capability:url:1.0?protocol=http,ftp,file</capability> <capability>http://xml.juniper.net/netconf/junos/1.0</capability> <capability>http://xml.juniper.net/dmi/system/1.0</capability> </capabilities> <session-id4129/session-id> </hello> ]]>]]>
次の出力は、TOE で生成され、syslog サーバで受信されたイベント ログを示しています。
Jan 20 17:04:51 starfire sshd[4182]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key Jan 20 17:04:51 starfire sshd[4182]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key Jan 20 17:04:53 starfire sshd[4182]: Accepted password for sec-admin from 10.209.11.24 port 55571 ssh2 Jan 20 17:04:53 starfire mgd[4186]: UI_AUTH_EVENT: Authenticated user 'sec-admin' at permission level 'j-administrator' Jan 20 17:04:53 starfire mgd[4186]: UI_LOGIN_EVENT: User 'sec-admin' login, class 'j-administrator' [4186], ssh-connection '10.209.11.24 55571 10.209.14.92 22', client-mode 'cli'
次の出力は、受信したローカルsyslogとリモートsyslogが類似していることを示しています。
Local : an 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Redundancy interface management process checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/rdd' Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/rdd', PID 4317, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Dynamic flow capture service checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/dfcd' Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/dfcd', PID 4318, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Connectivity fault management process checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/cfmd' Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/cfmd', PID 4319, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Layer 2 address flooding and learning process checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/l2ald' Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/l2ald', PID 4320, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Layer 2 Control Protocol process checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/l2cpd' Jan 20 17:09:30 starfire l2cp[4321]: Initializing PNAC state machines Jan 20 17:09:30 starfire l2cp[4321]: Initializing PNAC state machines complete Jan 20 17:09:30 starfire l2cp[4321]: Initialized 802.1X module and state machinesJan 20 17:09:30 starfire l2cp[4321]: Read acess profile () config Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/l2cpd', PID 4321, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Multicast Snooping process checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/mcsnoopd' Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/mcsnoopd', PID 4325, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: commit wrapup... Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: activating '/var/etc/ntp.conf' Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: start ffp activate Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/ffp' Jan 20 17:09:30 starfire ffp[4326]: "dynamic-profiles": No change to profiles....................................
Remote : an 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Redundancy interface management process checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/rdd' Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/rdd', PID 4317, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Dynamic flow capture service checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/dfcd' Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/dfcd', PID 4318, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Connectivity fault management process checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/cfmd' Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/cfmd', PID 4319, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Layer 2 address flooding and learning process checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/l2ald' Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/l2ald', PID 4320, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Layer 2 Control Protocol process checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/l2cpd' Jan 20 17:09:30 starfire l2cp[4321]: Initializing PNAC state machines Jan 20 17:09:30 starfire l2cp[4321]: Initializing PNAC state machines complete Jan 20 17:09:30 starfire l2cp[4321]: Initialized 802.1X module and state machinesJan 20 17:09:30 starfire l2cp[4321]: Read acess profile () config Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/l2cpd', PID 4321, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: Multicast Snooping process checking new configuration Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/mcsnoopd' Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_STATUS: Cleanup child '/usr/sbin/mcsnoopd', PID 4325, status 0 Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: commit wrapup... Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: activating '/var/etc/ntp.conf' Jan 20 17:09:30 starfire mgd[4186]: UI_COMMIT_PROGRESS: Commit operation in progress: start ffp activate Jan 20 17:09:30 starfire mgd[4186]: UI_CHILD_START: Starting child '/usr/sbin/ffp' Jan 20 17:09:30 starfire ffp[4326]: "dynamic-profiles": No change to profiles ...............
デバイスが使用する接続が意図せずに切断された場合、セキュリティー管理者は接続を再始動する必要があり、そうしないとデバイスは監査サーバーとの再接続を試みます。