How do I stop audit logs from going to /var/log/messages
How do I stop audit logs from going to /var/log/messages
Currently we have auditd turned on and events are getting sent to /var/log/messages as well as /var/log/audit/audit.log
All our logs go to a central syslog server also...
Having said that we would like to stop the auditd logs from going to "messages" but continue going to /var/log/audit/audit.log and continue being sent to our remote syslog server..
I tried setting /etc/audisp/plugins.d/syslog.conf to "active = no" but that didn't do it.
Can someone tell me how to accomplish this?
- Jason
Responses
Jason, in the article David Mention, what is the output for the following command? Here's mine:
[root@mysystem ~]# cd /etc/audit/
[root@mysystem audit]# grep audit auditd.conf
# This file controls the configuration of the audit daemon
log_file = /var/log/audit/audit.log
krb5_principal = auditd
##krb5_key_file = /etc/audit/audit.key
Good luck
We wanted to reply to Jason Greene's solution and say that it works great for us and it didn't appear to break anything else. We did this on RHEL 6.6.
This will GREATLY relieve our Splunk Forwarders on our servers.
Hopefully the future RHELs will have more built-in mechanisms to account for crazy auditing requirements and STIG'd systems. I'm sure both DoD and Corporations alike are becp,oming more secure these days.
Thanks!
Thanks.. This led me in the right direction.. Chose local6 instead of local0 as I didn't want the audit messages getting thrown to the kernel level.. Since we already log to /var/log/audit I just wanted the audisp records to go direct to external syslog boxes for aggregation.
so ended up with
/etc/rsyslog.conf
*.info;mail.none;authpriv.none;cron.none;local6.none /var/log/messages
grep local6 /etc/rsyslog.d/custom-syslog.conf
local6,kern,mail,daemon,auth,authpriv,user,syslog.debug @remote host:remote port
grep args /etc/audisp/plugins.d/syslog.conf
args = LOG_LOCAL6
Thanks again!
So I followed this solution and it seems to stop the spam: https://access.redhat.com/solutions/499323.
However, I'm sending all my logs to central log server and I have them aggregated by hostname, and I noticed that it most cases my audit.log and messages are very close to being the same size.
So I guess what I'm unsure of is that if
active = yes in the file /etc/audisp/plugins.d/syslog.conf
does that mean everything that gets sent messages as well audit.log? or is there still some different information that gets sent there?
I just want to make sure this is grabbing the full content of my audit logs if I'm sending them to my syslog server, albeit without the duplicate audisp data in messages.
Hello
If you want to stop audit logs from being written to /var/log/messages, you can achieve it as follows. 1. Edit active option value in config file
# vim /etc/audisp/plugins.d/syslog.conf
active = no
direction = out
path = builtin_syslog
type = builtin
args = LOG_INFO
format = string
- Now to reload this configuration
# systemctl reload auditd
--> Now audit logs will not be written to /var/log/messages
To start writing audit logs to /var/log/messages just set active = yes and reload auditd service and all audit logs would be recorded in messages as well.
To write audit logs to remote server, set active = yes and add LOG_LOCAL6 in args
# vim /etc/audisp/plugins.d/syslog.conf
active = no
direction = out
path = builtin_syslog
type = builtin
args = LOG_INFO LOG_LOCAL6
format = string
# systemctl reload auditd
Need to set rule in /etc/rsyslog.conf to route these logs to remote server, this can be achieved as follows
# vim /etc/rsyslog.conf
#audit log
$ModLoad imfile
$InputFileName /var/log/audit/audit.log
$InputFileTag tag_audit_log:
$InputFileStateFile audit_log
$InputFileSeverity info
$InputFileFacility local6
$InputRunFileMonitor
local6.* @@IP:514
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
