问题原文
原帖链接 · J'e · CC BY-SA 4.0
On Ubuntu 20, I'm trying to send audit logs to [email omitted]. I do have a real domain and email server but I'm redacting them here. When I trigger an audit event, the email is instead sent to root on the local machine. So far I've tried the following:
- Running
echo "Subject: test" | sendmail -f root@my_machine.com [email omitted]the test email is sent successfully. /etc/audit/auditd.confhas been modified to replaceaction_mail_acct = rootwithaction_mail_acct = [email omitted]- After modifying auditd.conf, I restarted it using
service auditd restart
I don't see any relevent errors in:
- /var/log/mail.err
- /var/log/mail.log
::: update :::
With the action_email_acct set to a real account, I then ran sudo ls in a terminal to generate an audit event that I can see in /var/log/audit/audit.log. Should I be seeing the audit event here if it's supposed to be emailed?
已采纳解答
原帖链接 · Esa Jokinen · CC BY-SA 4.0
The action_mail_acct is not for sending audit alerts but for giving notifications about low disk space (below space_left or admin_space_left) when space_left_action or admin_space_left_action is configured to email. From auditd.conf(5):
space_left_actionThis parameter tells the system what action to take when the system has detected that it is starting to get low on disk space. Valid values are
ignore,syslog,rotate,exec,suspend,single, andhalt. If set toignore, the audit daemon does nothing.syslogmeans that it will issue a warning to syslog.rotatewill rotate logs, losing the oldest to free up space.action_mail_acctas well as sending the message to syslog. exec /path-to-script will execute the script. - -
admin_space_left_actionThis parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are
ignore,syslog,rotate,exec,suspend,single, andhalt. If set toignore, the audit daemon does nothing.syslogmeans that it will issue a warning to syslog.rotatewill rotate logs, losing the oldest to free up space.action_mail_acctas well as sending the message to syslog. - -
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
