How to setup an event forwarder on a separate box to receive audit logs over rsyslog to be picked up by the event forwarder
Event-Forwarder Server
Provides UDP syslog reception $ModLoad imudp $UDPServerRun 514 # Provides TCP syslog reception #$ModLoad imtcp #$InputTCPServerRun 514
if $msg contains '/api/' then /var/log/cb/audit/useractivity.log &~ if $msg contains ' ban' then /var/log/cb/audit/banning.log &~ if $msg contains ' command' then /var/log/cb/audit/live-response.log & ~ if $msg contains ' isolation' then /var/log/cb/audit/isolation.log &~Example:
if $host == "192.168.1.20" then /var/log/cb/audit/useractivity.log &~
Centos 6 = service rsyslog restart Centos 7/8 = systemctl restart rsyslog
# Set the same defaults configured in /etc/logrotate.conf
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# use date as a suffix of the rotated file
dateext
/var/log/cb/audit/*.log
{
compress
daily
dateext
dateformat -%Y%m%d.%s
delaycompress
maxsize 500M
maxage 7
missingok
postrotate
/bin/kill -s HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
rotate 7
sharedscripts
}
# Run logrotate every 5 minutes to perform a rotation if necessary. */5 * * * * root /usr/sbin/logrotate /etc/cb/cb-logrotate.conf
EDR Server:
if $programname == 'cb-audit-isolation' then /var/log/cb/isolation.log;CbAuditLogFormat & @<EF IP HERE>:514;CbAuditLogFormat & ~ if $programname == 'cb-audit-banning' then /var/log/cb/audit/banning.log;CbAuditLogFormat & @<EF IP HERE>:514;CbAuditLogFormat & ~ if $programname == 'cb-audit-live-response' then /var/log/cb/audit/live-response.log;CbAuditLogFormat & @<EF IP HERE>:514;CbAuditLogFormat & ~ if $programname == 'cb-audit-useractivity' then /var/log/cb/audit/useractivity.log;CbAuditLogFormat & @<EF IP HERE>:514;CbAuditLogFormat &~
$MaxMessageSize 4096
Centos 6 = service rsyslog restart Centos 7/8 = systemctl restart rsyslog
MaxSyslogSenderMessageSize= MaxCbLoggingMessageSize=
yum install tcpdump (if not already installed) tcpdump -X -i and port 514