Repository navigation
Drop ebpfevents as a dependency, move auditbeat FIM to quark - #53507
Conversation
🤖 GitHub commentsJust comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
This pull request is now in conflicts. Could you fix it? 🙏 |
This is the first commit towards rewriting auditbeat's file integrity module logic to work on top of quark.
This replaces the file hooks in ebpfevents (which depends on elastic/ebpf) with the file hooks in quark's eBPF backend and allows us to drop the ebpfevents dependency from beats.
2cade63 to
e2f9228
Compare
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
|
@elastic/ski-docs Can I get a quick review? It's the last one needed before merge. |
vishaangelova
left a comment
There was a problem hiding this comment.
A couple of comments to scope the docs changes to the correct version.
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
@Mergifyio backport 9.6 9.5 9.4 8.19 |
✅ Backports have been createdDetails
Cherry-pick of de78e8d has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
Cherry-pick of de78e8d has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
Cherry-pick of de78e8d has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
Cherry-pick of de78e8d has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
…t FIM to quark (#54418) * Drop ebpfevents as a dependency, move auditbeat FIM to quark (#53507) This replaces the file hooks in ebpfevents (which depends on elastic/ebpf) with the file hooks in quark's eBPF backend and allows us to drop the ebpfevents dependency from beats. Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com> (cherry picked from commit de78e8d) Co-authored-by: Christos Kalkanis <christos.kalkanis@elastic.co>
…t FIM to quark (#54419) This replaces the file hooks in ebpfevents (which depends on elastic/ebpf) with the file hooks in quark's eBPF backend and allows us to drop the ebpfevents dependency from beats. Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com> (cherry picked from commit de78e8d) Co-authored-by: Christos Kalkanis <christos.kalkanis@elastic.co>
…at FIM to quark (#54421) This replaces the file hooks in ebpfevents (which depends on elastic/ebpf) with the file hooks in quark's eBPF backend and allows us to drop the ebpfevents dependency from beats. Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com> (cherry picked from commit de78e8d) Co-authored-by: Christos Kalkanis <christos.kalkanis@elastic.co>
Summary
Drops https://github.com/elastic/ebpfevents (and transitively, https://github.com/elastic/ebpf) as a dependency of beats. The goal is consolidation and reducing our maintenance burden: There is no good reason for us to be maintaining equivalent (or near equivalent) eBPF functionality across multiple projects, as eBPF issues may involve time consuming debugging, dependency management and staged releases (especially when kernel internals change).
Proposed commit message
The auditbeat file_integrity ebpf backend now reads file events from quark's eBPF backend instead of the ebpfevents library, removing the dependency on elastic/ebpfevents and elastic/ebpf. User configuration is unchanged. Process and container enrichment now comes from quark's process cache, operations on the same file that happen close together may be reported as a single event, and file.mode reports only the permission bits, consistent with the fsnotify backend. When running in Docker, the ebpf backend now requires --pid=host so that the process table matches the process IDs the kernel reports (same as the other quark consumers in beats).
Checklist
[ ] I have made corresponding change to the default configuration filesNot neededstresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.Disruptive User Impact
When running in Docker, the ebpf backend now requires
--pid=hostso that the process table matches the process IDs the kernel reports (same as the other quark consumers in beats).A CREATE followed by a REMOVE can be reported as a single 'deleted' event as Quark will merge the two events if they originate in the same process and are both within the hold time window. This case would previously result in two separate events.
For extra context, please also see my comment here.
NOTE: According to the documentation, the default backend is
fsnotify, withebpfandKprobesin technical preview.Question to reviewers: Should we mark (both/just pid=host) (pid=host and 'create followed by delete in the same process and hold window') as BREAKING changes?
EDIT: I'll mark the entire fragment as breaking change. Both ebpf and kprobe backends are 'technical preview', not the default (fsnotify is), and it seems that ebpf isn't used much -if at all- internally, which means that the blast radius from this breaking change should be minimal.
How to test this PR locally
Depending on the kernel you're running, you may first need to apply #54106 (if the Python tests fail with Linux kernel version parsing error).
You can also run
auditbeatdumping JSON to stdout:Verification that
auditbeatstarted correctly:Related issues
Notes for reviewers
Please review, I still have a few manual tests to go through (containers / Docker).