审计日志
systemctl stop firewalld && systemctl disable firewalld
setenforce 0 && sed -ir ‘s/^SELINUX=enforcing/SELINUX=disabled/‘ /etc/selinux/config
systemctl enable auditd.service
systemctl enable rsyslog.service
rpm -qa | grep rsyslog
rpm -qa | grep logrotate
systemctl status rsyslog
ps -ef | grep rsyslogd | grep -v grep
cp /etc/rsyslog.conf{,.bka}
vim /etc/rsyslog.conf
#### RULES #### 下的 全部注释掉 +# 自定义到 一个文件里
*.* /home/filebeat/logs/test.log
local0.info /home/filebeat/logs/test.log
vim /etc/sysconfig/rsyslog
添加
SYSLOGD_OPTIONS="-r -x -m 0"
SYSLOGD_OPTIONS 参数
在“SYSLOGD_OPTIONS”行上加“-r”选项以允许接受外来日志消息。
-s ip 表示只允许接收来自指定ip的日志消息,提高安全性。多个ip之间使用冒号分隔,例如:SYSLOGD_OPTIONS=‘-r -s 192.168.0.2:192.168.0.3‘
-x 表示禁止中央日志服务器解析远程主机的FQDN(fully qualified domain name,完整域名)。默认情况下,当有其他机器向自己发送日志消息时,中央日志服务器将尝试解析该机器的FQDN。如果syslog守护进程无法解析出那个地址,它将继续尝试,这种毫无必要的额外负担将大幅降低日志记录工作的效率,应该禁止。
-m 0表示给日志添加-- MARK --标记,0表示关闭标记。举例,-m 240,表示每隔240分钟(每天6次)在日志文件里增加一行时间戳消息。日志文件里的“--MARK--”消息可以让你知道中央日志服务器上的syslog守护进程没有停工偷懒。
原文链接:https://blog.csdn.net/sunny_na/article/details/65444326
systemctl restart rsyslog
service auditd restart
systemctl stop firewalld && systemctl disable firewalld
setenforce 0 && sed -ir ‘s/^SELINUX=enforcing/SELINUX=disabled/‘ /etc/selinux/config
开机自弃
systemctl enable auditd.service
systemctl enable rsyslog.service
aureport --start today --event --summary -i
vim /etc/rsyslog.conf
$ModLoad imfile
#### RULES #### 全部注释掉 +#
*.* @10.184.33.82:514
添加
$InputFileName /var/log/audit/audit.log
$InputFileTag audit-errorlog:
$InputFileStateFile state-audit-audit.log
$InputRunFileMonitor
$InputFilePollInterval 10
*.* @IP:514
service auditd restart
2020.06.18 Sun 于北京·海淀
原文:https://www.cnblogs.com/nanhavezhi/p/13328859.html