Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auditbeat: Warn if Auditbeat and auditd are running #5845

Closed
andrewkroh opened this issue Dec 8, 2017 · 1 comment
Closed

Auditbeat: Warn if Auditbeat and auditd are running #5845

andrewkroh opened this issue Dec 8, 2017 · 1 comment

Comments

@andrewkroh
Copy link
Member

When using a unicast netlink socket you can have only one userspace process registered to receive data from the kernel audit framework. If two are running only one will receive data and the other will get nothing and no errors.

Auditbeat could be enhanced to make it more user friendly by detecting this condition and warning the user by logging a message and sending an error event to ES.

Detection could be accomplished by:

  • Periodically checking if the Auditbeat PID is registered as the recipient of Audit data in the kernel. We can check the audit status and if our PID isn't present warn and try to fix the issue.
  • Dump the process table and look for "auditd".
@adriansr
Copy link
Contributor

Have a POC for the periodical check but after testing I found out that a process cannot evict a running audit process. I mean, once a process sets the PID it can only be changed by this same process, or until it terminates, so the periodical check makes no sense.

In this case, the solution is easier, you get an EEXISTS when setting the PID. This branch has a working sample (updating go-libaudit from the vendor folder directly). I have submitted the first patch to go-libaudit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants