CentOS 8
Sponsored Link

Auditd : Transfer Logs to Remote Host2019/09/28

 
Configure Auditd to transfer logs to remote host.
This example is based on the environment like follows.
+----------------------+          |          +----------------------+
| [  Auditd Server   ] |10.0.0.30 | 10.0.0.51| [  Auditd Client   ] |
|     dlp.srv.world    +----------+----------+    node01.srv.world  |
|                      |                     |                      |
+----------------------+                     +----------------------+

[1] Configure Auditd Host that receives Audit logs from remote hosts.
[root@dlp ~]#
vi /etc/audit/auditd.conf
# line 27: uncomment and specify listening port

tcp_listen_port =
60
[root@dlp ~]#
service auditd restart

[2] If Firewalld is running on Audit receiver Host, allow audit service.
[root@dlp ~]#
firewall-cmd --add-service=audit --permanent

success
[root@dlp ~]#
firewall-cmd --reload

success
[3] Configure Auditd Client Host that sends Audit logs.
[root@node01 ~]#
dnf -y install audispd-plugins
[root@node01 ~]#
vi /etc/audit/plugins.d/au-remote.conf
# line 6: change

active =
yes
[root@node01 ~]#
vi /etc/audit/audisp-remote.conf
# line 6: remote host to send logs

remote_server =
dlp.srv.world
# line 7: specify port (the one which remote server is just listening)

port = 60
[root@node01 ~]#
vi /etc/audit/auditd.conf
# line 9: change (not record logs on local filesystem)

log_format =
NOLOG
[root@node01 ~]#
service auditd restart

[4] That's OK, Audit logs on remote hosts are recorded like follows.
[root@dlp ~]#
grep node01 /var/log/audit/audit.log

type=USER_START msg=audit(1569565170.307:59): pid=853 uid=0 auid=0 ses=1 subj=system_u:system_r:local_login_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_selinux,pam_loginuid,pam_console,pam_selinux,pam_namespace,pam_keyinit,pam_keyinit,pam_limits,pam_systemd,pam_unix,pam_umask,pam_lastlog acct="root" exe="/usr/bin/login" hostname=node01.srv.world addr=? terminal=ttyS0 res=success'
type=CRED_REFR msg=audit(1569565170.307:60): pid=853 uid=0 auid=0 ses=1 subj=system_u:system_r:local_login_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/login" hostname=node01.srv.world addr=? terminal=ttyS0 res=success'
type=USER_LOGIN msg=audit(1569565170.307:61): pid=853 uid=0 auid=0 ses=1 subj=system_u:system_r:local_login_t:s0-s0:c0.c1023 msg='op=login id=0 exe="/usr/bin/login" hostname=node01.srv.world addr=? terminal=ttyS0 res=success'
Matched Content