ONTAP 8.2 7-mode で監査ログ設定。多分 8.X なら挙動は同じ。7.X は異なる可能性がある。
監査ログを取るためには、NetApp 側での設定と、Windows での設定の両方を行う必要がある。まずは NetApp 側の設定から。 デフォルトの監査関連の設定は以下のようになっている。
> options cifs.audit cifs.audit.account_mgmt_events.enable off cifs.audit.autosave.file.extension cifs.audit.autosave.file.limit 0 cifs.audit.autosave.onsize.enable off cifs.audit.autosave.onsize.threshold 75% cifs.audit.autosave.ontime.enable off cifs.audit.autosave.ontime.interval 1d cifs.audit.enable off cifs.audit.file_access_events.enable on cifs.audit.liveview.allowed_users cifs.audit.liveview.enable off cifs.audit.logon_events.enable on cifs.audit.logsize 1048576 cifs.audit.nfs.enable off cifs.audit.nfs.filter.filename cifs.audit.saveas /etc/log/adtlog.evt
GUI(OnCommand System Manager)でも有効/無効とファイル名ぐらいは設定できるが、ローテートに関する部分は設定できないので、全部まとめてコマンドラインで設定したほうが早い。
- 監査ログの種類
- options cifs.audit.account_mgmt_events.enable on
- アカウント操作に関するログ
- options cifs.audit.file_access_events.enable on
- ファイルアクセスに関するログ
- options cifs.audit.logon_events.enable on
- ログオンイベントに関するログ
- 監査ログをリアルタイムに見る必要がある場合
- options cifs.audit.liveview.enable on
- これを on にすると、他の Windows マシンの Event Viewer から直接 ONTAP に接続してリアルタイム(実際は 1 分ごとの flush)に監査ログを確認できるが、ファイル出力ができなくなる。そのため普通は有効にしない。
- options cifs.audit.liveview.allowed_users ユーザ名
- liveview を有効にした場合にイベントログへのアクセスを許可するユーザ名を指定。指定しなくても ONTAP の管理者権限があるアカウントは表示できる。
- 監査ログの保存設定
- options cifs.audit.saveas ログファイルのフルパス
- ログファイルの保存場所とベースとなるファイル名を定義する。保存場所はデフォルトではルートボリュームになっていて、万が一溢れると危険なので専用のボリュームを作ったほうが良い。設定する前に予めボリュームを作って share して格納フォルダを作っておく必要がある。ファイル名は任意だが拡張子の .evt は変更しないこと。
- options cifs.audit.logsize ログファイルの最大サイズをバイト単位で
- デフォルトは 1048576(1MB)。設定可能な最小値は 524288(512KB)、最大値は 68719476736(64GB)。
- 監査ログの自動保存設定
- 自動保存設定はサイズをトリガーにする方式と時間をトリガーにする方式の2種類ある。自動保存設定をしない場合は、cifs audit save コマンドを実行したタイミングでファイル出力される。
- options cifs.audit.autosave.onsize.enable on
options cifs.audit.autosave.onsize.threshold N% - cifs.audit.autosave.onsize.enable を on にすると、イベントログのサイズが、cifs.audit.logsize で指定したサイズの cifs.audit.autosave.onsize.threshold で指定した % 分のサイズになったらファイル出力される。
- options cifs.audit.autosave.ontime.enable on
options cifs.audit.autosave.ontime.interval 期間 - cifs.audit.autosave.ontime.enable を on にすると、cifs.audit.autosave.ontime.interval で指定した期間ごとにファイル出力される。期間の指定は、分単位が m、時間単位が h、日単位が d のサフィックスを付ける。設定が有効になった時間からの間隔になるため、日単位にした場合でも綺麗に 0 時から 23時59分までのログが 1 ファイルになるわけではない。
- options cifs.audit.autosave.onsize.enable on
- 監査ログのローテート設定
- options cifs.audit.autosave.file.extension timestamp|counter
- ファイルが出力される際に、ファイル名にタイムスタンプを付与する場合は timestamp、連番を付与する場合は counter を設定する。デフォルト値は空欄になっているが timestamp である。timestamp の形式は年月日時分秒(YYYYMMDDhhmmss)。拡張子の前に付く。例えば cifs.audit.saveas が /etc/log/adtlog.evt の場合、実際に出力されるファイル名は /etc/log/adtlog.YYYYMMDDhhmmss.evt になる。
- options cifs.audit.autosave.file.limit 保存ファイル数
- 指定の場所に保存するファイル数。超えた場合は古いものから上書きされる。0 を指定した場合は無制限となる。最大値は 999。
- 監査を有効にする設定
- options cifs.audit.enable on
- これを打つと監査が始まるので他の設定を済ませてから最後に打つこと。
例として、アカウント操作のログは取らない、ファイルアクセスとログオンのログは取る、ログサイズは 100MB で 80% のサイズトリガーでファイル出力、/vol/vol1/log フォルダに audit.YYYYMMDDhhmmss.evt というファイル名で 999 個まで出力、という設定にするコマンドは以下になる。なお、デフォルト値そのままのものはコマンド入力する必要は無いので記載していない。
> options cifs.audit.saveas /vol/vol1/log/audit.evt > options cifs.audit.autosave.file.extension timestamp > options cifs.audit.autosave.file.limit 999 > options cifs.audit.logsize 104857600 > options cifs.audit.autosave.onsize.enable on > options cifs.audit.autosave.onsize.threshold 80% > options cifs.audit.enable on
これで NetApp 側の設定は OK。次は Windows から監査対象フォルダの設定をする。
おまけ:監査ログ関連のコマンド
- cifs audit start
- 監査サービスの開始コマンド。
- cifs audit stop
- 監査サービスの停止コマンド。
- cifs audit save
- 監査ログをファイル出力させるコマンド。
- cifs audit clear
- 監査ログをクリア(消去)するコマンド。
0 件のコメント:
コメントを投稿