From: Steve Grubb <sgrubb@redhat.com>
To: Linux-Audit Mailing List <linux-audit@redhat.com>
Subject: Re: Grouping audit events in an auditd log parser
Date: Tue, 06 Apr 2021 09:55:24 -0400 [thread overview]
Message-ID: <1780427.tdWV9SEqCh@x2> (raw)
In-Reply-To: <CAKz+TUtgw6MR==j6-KegJEFRLrUySJUFQyVfdacZ1q96339Jqw@mail.gmail.com>
On Tuesday, April 6, 2021 9:03:50 AM EDT Alan Evangelista wrote:
> Hi! I was using auditbeat to connect to the audit kernel module and get
> filesystem operations events from it. However, as I discussed in another
> thread, it seems that the audit events kernel queue is buggy in kernel 3.1,
> the kernel version available on CentOS 7. This means that if
> auditbeat crashes for any reason, I'll start losing FS events. In order to
> make my event detection more resilient, I decided to move the critical
> point of failure from auditbeat to auditd: I'll let auditd write a log file
> and write a fluentd parser to read from that log file.
>
> Writing that auditd log parser, I reached a question: how to group audit
> records in a FS event (for instance, there are SYSCALL, CWD and PATHs audit
> events for a single file creation, deletion or renaming). Can I assume
> that *all* records of an event will always appear sequentially in the log
> file with the same timestamp/event ID or records from different filesystem
> operations can be interleaved? Ex: simultaneous fsop 1 and fsop 2 could
> show up like:
>
> TYPE:SYSCALL msg=audit(167111.123:1) (...)
> TYPE:CWD msg=audit(167111.123:1) (...)
> TYPE:SYSCALL msg=audit(167112.123:2) (...)
> TYPE:PATH msg=audit(167111.123:1) (...)
> TYPE:PATH msg=audit(167111.123:1) (...)
> TYPE:CWD msg=audit(167112.123:1) (...)
> TYPE:PATH msg=audit(167112.123:1) (...)
>
> ?
Nope. You cannot assume that. Serialization is left as an exercise for user
space. Also, there is an audit parsing library that knows how to group events
and hides all additional complexity. You can either use it to parse the log
directly or to get the events from the realtime interface.
-Steve
--
Linux-audit mailing list
Linux-audit@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-audit
next prev parent reply other threads:[~2021-04-06 13:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 13:03 Grouping audit events in an auditd log parser Alan Evangelista
2021-04-06 13:55 ` Steve Grubb [this message]
2021-04-06 14:01 ` Lenny Bruzenak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1780427.tdWV9SEqCh@x2 \
--to=sgrubb@redhat.com \
--cc=linux-audit@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox