作業環境
- 型番:SRX100H2
- バージョン:12.1X44-D45
Syslog デフォルト設定
set system syslog archive size 100k
set system syslog archive files 3
set system syslog user * any emergency
set system syslog file messages any critical
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands error
ローカルへのログの保存設定
ローカルのログファイル messages
に保存するログについての設定です。
ログサイズ
set system syslog archive size <サイズ>
サイズ
:65536~1073741824 bytes から指定- デフォルトは 100k
例:
[edit]
root@SRX# set system syslog archive size 100k
アーカイブされるログファイル数
set system syslog archive files <数量>
数量
:1~1000 から指定- デフォルトは 3
例:
[edit]
root@SRX# set system syslog archive files 3
ファシリティとログレベル
ログ内容の設定は以下コマンドで行います。
set system syslog file messages <ファシリティ> <ログレベル>
ファシリティ
:保存するログの種類を指定- any
- authorization
- firewall
- ntp など
ログレベル
:保存するログのレベルを指定- none
- emergency
- alert
- critical
- error
- warning
- notice
- info
- any
例:firewall について error ログを保存する場合
[edit]
root@SRX# set system syslog file messages firewall error
ローカルログの確認
show log messages
root@SRX> show log messages
Dec 6 23:45:00 newsyslog[1476]: logfile turned over due to size>100K
Dec 7 00:29:13 SRX sshd[2080]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec 7 00:29:18 SRX sshd[2080]: Accepted password for root from 192.168.1.2 port 51048 ssh2
Dec 7 00:29:22 SRX sshd[2080]: Received disconnect from 192.168.1.2: 11: disconnected by server request
Dec 7 00:38:22 SRX sshd[2383]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec 7 00:38:26 SRX sshd: SSHD_LOGIN_FAILED: Login failed for user 'root' from host '192.168.1.2'
Dec 7 00:38:26 SRX sshd[2383]: Failed password for root from 192.168.1.2 port 51345 ssh2
Dec 7 00:38:31 SRX sshd: SSHD_LOGIN_FAILED: Login failed for user 'root' from host '192.168.1.2'
.
.
.
Syslog サーバへのシステムログ送信設定
Syslog 送信先の設定
set system syslog host <Syslog サーバ IP> <ファシリティ> <ログレベル>
例:
[edit]
root@SRX# set system syslog host 10.20.30.40 any any
ソースアドレスの設定
set system syslog source-address <IP>
Syslog サーバへのセキュリティログの送信設定
セキュリティログ(トラフィックログ)の送信設定です。
ログモードの設定
set security log mode < event | stream >
root@SRX# set security log mode ?
Possible completions:
event Process security logs in the control plane
stream Process security logs directly in the forwarding plane
- Event Mode
- デフォルト設定(最大1500 event/sec )
- セキュリティログは
system syslog
での処理対象になるため、system syslog
でセキュリティログをローカルログとして保存したり Syslog サーバへ送信するよう設定することができます
- Stream Mode
- 高負荷なトラフィック環境でセキュリティログの取得が必要な場合に推奨されるモード
- セキュリティログは
system syslog
での処理対象にならないため、以下のログストリームの設定を行う必要があります
ログストリームの設定(stream モードの場合)
stream モードの場合はログストリームとして以下項目を設定します。
- ログ送信先 IP アドレス
- フォーマット
- カテゴリ
- severity
設定コマンド:
set security log stream <ストリーム名> <各設定項目の設定>
・ログ送信先:
set security log stream stream1 host 10.1.10.100
・フォーマット
root@SRX# set security log stream stream1 format ?
Possible completions:
binary Binary log
sd-syslog Structured syslog
syslog Traditional syslog
welf Web Trends Extended Log Format
・カテゴリ
root@SRX# set security log stream stream1 category ?
Possible completions:
all All events are logged
content-security Only content security events are logged
・severity
root@SRX# set security log stream stream1 severity ?
Possible completions:
alert Conditions that require immediate attention
critical Critical conditions
debug Information normally used in debugging
emergency Conditions that cause security functions to stop
error General error conditions
info Information about normal security operations
notice Non-error conditions that are of interest
warning General warning conditions
※複数の送信先へログを送信する場合は、その数分だけログストリームを設定します
ソースアドレスの設定
set security log source-address <IP>
set security log source-address 192.168.1.99
参考資料
https://kb.juniper.net/InfoCenter/index?page=content&id=kb16502

25.System LoggingのCLI設定 Juniper SRX日本語マニュアル
25.System LoggingのCLI設定 Juniper SRX日本語マニュアル - Download as a PDF or view online for free

26.Traffic LoggingのCLI設定 Juniper SRX日本語マニュアル
26.Traffic LoggingのCLI設定 Juniper SRX日本語マニュアル - Download as a PDF or view online for free
―――――――――――――