如何获取持久审计日志?

如何获取持久审计日志?

我目前正在尝试找出哪个应用程序正在我的主目录中创建一个名为“no”的神秘套接字文件。这种情况每隔几周才会发生一次,这就是为什么我使用以下规则设置了 auditd /etc/audit.d/rules.d/no

# This is to clear out old rules, so we don't append to them.
-D

# Feel free to add below this line. See auditctl man page
-w /home/philipp/no

运行一些测试touch /home/philipp/no确认此方法有效。但是,日志文件不是持久的。

我刚刚遇到该文件显然是在昨天创建的,但审计日志不见了——今天我启动机器时它被新日志覆盖了,即使日志在配置中设置为“旋转”。

如何设置 auditd 以保留所有日志?我正在使用带有 systemd 的 Gentoo 和 3.0 版审计。

auditd.conf:

#
# This file controls the configuration of the audit daemon
#

local_events = yes
write_logs = yes
log_file = /var/log/audit/audit.log
log_group = root
log_format = ENRICHED
flush = INCREMENTAL_ASYNC
freq = 50
max_log_file = 8
num_logs = 5
priority_boost = 4
name_format = NONE
##name = mydomain
max_log_file_action = KEEP_LOGS
space_left = 75
space_left_action = SYSLOG
verify_email = yes
action_mail_acct = root
admin_space_left = 50
admin_space_left_action = SUSPEND
disk_full_action = SUSPEND
disk_error_action = SUSPEND
use_libwrap = yes
##tcp_listen_port = 60
tcp_listen_queue = 5
tcp_max_per_addr = 1
##tcp_client_ports = 1024-65535
tcp_client_max_idle = 0
transport = TCP
krb5_principal = auditd
##krb5_key_file = /etc/audit/audit.key
distribute_network = no
q_depth = 400
overflow_action = SYSLOG
max_restarts = 10
plugin_dir = /etc/audit/plugins.d

相关内容