-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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] Use a separate netlink socket for control to avoid data congestion. #41207
[Auditbeat] Use a separate netlink socket for control to avoid data congestion. #41207
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some small nits
client, err := libaudit.NewAuditClient(nil) | ||
defer func() { | ||
if client != nil { | ||
client.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that if we move the defer
statement to after the error check, we don't need the nil check, and we can just do defer client.close()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, makes sense. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}() | ||
|
||
if err != nil { | ||
return nil, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we get a fmt.Errorf()
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform) |
@fearful-symmetry I re-worked the whole thing, please have another look. Thanks. |
@nicholasberlin looks like mostly linter errors from old code, we need to use |
Thanks! Will get into it tomorrow. |
@fearful-symmetry ready for review now. Thanks again. |
FYI: Searching for this error 'failed to get audit status before adding rules: failed to get audit status ack: error receiving audit reply: no buffer space available' didn't give me any results on Google or Github. The reason being the error message is in a screenshot, not in plaintext. I ended up creating a ticket with Elastic and after a few days of messages I was finally told it would be fixed in 8.16. I then had to dig through the MR's for the 8.16 branch to find anything auditd related. That led me to this PR. Would be good to put the error message in plaintext in the issue/PR/MR so people can actually search for it :) |
Proposed commit message
Use a separate socket for GetStatus.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Run this program while starting Auditbeat. In a separate terminal run
while true; do ss -f netlink | grep auditbeat; done
You will see the auditbeat netlink sockets disappear but Auditbeat will continue to run.
Data will stop flowing to Elasticsearch, and an error message will be pushed Elasticsearch, which will be similar to this:
With this PR's patch, the netlink sockets will remain, data will flow to Elasticsearch, and no error message will be pushed.