-
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][add_session_metadata processor] Fix more potential enrichment failures #39243
Conversation
With the ebpf backend for the add_session_metadata processor, wait for processes to be inserted into the processdb, if they are not already in it at the time that the process event is enriched.
Pinging @elastic/sec-deployment-and-devices (Team:Security-Deployment and Devices) |
x-pack/auditbeat/processors/sessionmd/provider/ebpf_provider/ebpf_provider.go
Outdated
Show resolved
Hide resolved
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.
lgtm with 1 nit. Also my brain had a hard time digesting UpdateDB
for ebpf provider
…ts into session-view-fix-missing-proc
I'll look into reworking UpdateDB in the future, I want to keep this PR to bugfixes only |
…ment failures (#39243) Fix two more cases that could cause unenriched processes in the add_session_metadata processor. It was possible for auditd events to arrive before the ebpf event added processes to the process DB, now the enrichment will wait for the process to be inserted into the DB, if it's not already before enrichment is run on it. Also stop attempting to enrich failed syscall events, and modifying the DB based on these. Changes: With the ebpf backend, when an event is processed wait for a process to be added to the DB before enriching, if it's not already in the DB before the event is received. Do not enrich failed syscall auditd events. Since failed syscalls don't actually cause a process to be created, they should not be enriched, or inserted to the process Remove scrapeAncestors from DB. The intention of this was to fill in missed processes, but now processes should not be missed with epbf, and ineffective with procfs, as the process will most likely already be ended. This was causing DB inconsistancies when run on failed syscall events, and I haven't ever seen any cases where it's helpful now. (cherry picked from commit ffcd181)
…ment failures (#39243) (#39354) Fix two more cases that could cause unenriched processes in the add_session_metadata processor. It was possible for auditd events to arrive before the ebpf event added processes to the process DB, now the enrichment will wait for the process to be inserted into the DB, if it's not already before enrichment is run on it. Also stop attempting to enrich failed syscall events, and modifying the DB based on these. Changes: With the ebpf backend, when an event is processed wait for a process to be added to the DB before enriching, if it's not already in the DB before the event is received. Do not enrich failed syscall auditd events. Since failed syscalls don't actually cause a process to be created, they should not be enriched, or inserted to the process Remove scrapeAncestors from DB. The intention of this was to fill in missed processes, but now processes should not be missed with epbf, and ineffective with procfs, as the process will most likely already be ended. This was causing DB inconsistancies when run on failed syscall events, and I haven't ever seen any cases where it's helpful now. (cherry picked from commit ffcd181) Co-authored-by: Michael Wolf <[email protected]>
Proposed commit message
Fix two more cases that could cause unenriched processes in the add_session_metadata processor.
It was possible for auditd events to arrive before the ebpf event added processes to the process DB, now the enrichment will wait for the process to be inserted into the DB, if it's not already before enrichment is run on it. Also stop attempting to enrich failed syscall events, and modifying the DB based on these.
Changes:
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
not process.entry_leader.entity_id : * and process.pid: * and not auditd.result: "fail"
Related issues