0

I have forwarded the auditd log files to central log server but the log received at the central log server have extra information added to it which I dont want. Note (auditd and syslog are on same server where the auditd forwards auditd log event to its local syslog(local6 facility) and the local syslog will send local6.* to central Log server)

here is the log received at central log server where this "<182>Nov 29 14:04:16 ubuntu audispd: node=ubuntu" is appended by either syslog(at log source) or audisp (at log source)

(auditd-->syslog-->) --> centralSyslog

<182>Nov 29 14:04:16 ubuntu audispd: node=ubuntu type=SYSCALL msg=audit(1511943556.347:424): arch=c000003e syscall=2 success=yes exit=3 a0=2647ca8 a1=90800 a2=2648317 a3=20 items=1 ppid=2726 pid=2727 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=4 comm="bash" exe="/bin/bash" key="log_sec"
<182>Nov 29 14:04:16 ubuntu audispd: node=ubuntu type=CWD msg=audit(1511943556.347:424):  cwd="/tmp"
<182>Nov 29 14:04:16 ubuntu audispd: node=ubuntu type=PATH msg=audit(1511943556.347:424): item=0 name="/opt/secret_dir/" inode=918715 dev=fc:00 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL
<182>Nov 29 14:04:16 ubuntu audispd: node=ubuntu type=PROCTITLE msg=audit(1511943556.347:424): proctitle="bash"

The actual log file looks like below:-

type=SYSCALL msg=audit(1511943489.078:423): arch=c000003e syscall=263 success=yes exit=0 a0=ffffff9c a1=12480c0 a2=0 a3=15e items=2 ppid=2727 pid=19367 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=4 comm="rm" exe="/bin/rm" key="log_sec"
type=CWD msg=audit(1511943489.078:423):  cwd="/tmp"
type=PATH msg=audit(1511943489.078:423): item=0 name="/opt/secret_dir/" inode=918715 dev=fc:00 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=PARENT
type=PATH msg=audit(1511943489.078:423): item=1 name="/opt/secret_dir/password.txt" inode=918727 dev=fc:00 mode=0100644 ouid=0 ogid=0 rdev=00:00 nametype=DELETE
type=PROCTITLE msg=audit(1511943489.078:423): proctitle=726D002D7266002F6F70742F7365637265745F6469722F70617373776F72642E747874
type=SYSCALL msg=audit(1511943556.347:424): arch=c000003e syscall=2 success=yes exit=3 a0=2647ca8 a1=90800 a2=2648317 a3=20 items=1 ppid=2726 pid=2727 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=4 comm="bash" exe="/bin/bash" key="log_sec"
type=CWD msg=audit(1511943556.347:424):  cwd="/tmp"
type=PATH msg=audit(1511943556.347:424): item=0 name="/opt/secret_dir/" inode=918715 dev=fc:00 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL
type=PROCTITLE msg=audit(1511943556.347:424): proctitle="bash"

my audisp config file looks like below(at LogSource server1)

cat /etc/audisp/plugins.d/syslog.conf | grep -v "#"

active = yes
direction = out
path = builtin_syslog
type = builtin 
args = LOG_LOCAL6
format = string

The rsyslog config file looks like below (at source Log server1)

cat /etc/rsyslog.d/50-default.conf

 ..
local6.*     @@192.168.8.147:6161
sherpaurgen
  • 616
  • 6
  • 10
  • 26

1 Answers1

0

You might be able to suppress this in the sending syslog by defining your own template for the message. For example, add to your .conf a line with

$template newmsg,"%msg:R,ERE,1:.* node=ubuntu (.*)--end%\n"

then use this in the action:

local6.*     @@192.168.8.147:6161; newmsg

See my previous post for an explanation of the regexp property replacer.

meuh
  • 1,563
  • 10
  • 11