- 監査ルールを確認
# auditctl -l
No rules
- 監査ルールを指定
# vi /etc/audit/audit.rules
# This file contains the auditctl rules that are loaded
# whenever the audit daemon is started via the initscripts.
# The rules are simply the parameters that would be passed
# to auditctl.
# First rule - delete all
-D
# Increase the buffers to survive stress events.
# Make this bigger for busy systems
-b 320
# Feel free to add below this line. See auditctl man page
/* 一番下にルールを書く
サンプルの書式
-w /etc/passwd -p wa -k passwd_changes */
- 記録の確認
# tail /var/log/audit/audit.log
type=USER_AUTH msg=audit(1548727536.902:20): user pid=1368 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='op=success acct="root" exe="/usr/sbin/sshd" hostname=? addr=192.168.2.63 terminal=ssh res=success'
type=CRED_ACQ msg=audit(1548727536.902:21): user pid=1368 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='op=PAM:setcred acct="root" exe="/usr/sbin/sshd" hostname=192.168.2.63 addr=192.168.2.63 terminal=ssh res=success'
:
:
ただし、タイムスタンプが ctime の1970年4月1日から何時間経過したかとなっているので、これを変えましょう。
# ausearch -k password_changes | more