Repository navigation
[8.19](backport #53507) Drop ebpfevents as a dependency, move auditbeat FIM to quark - #54421
Conversation
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) # Conflicts: # NOTICE.txt # auditbeat/module/file_integrity/_meta/docs.md # docs/reference/auditbeat/auditbeat-module-file_integrity.md # docs/reference/auditbeat/running-on-docker.md # go.sum
|
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 |
🤖 GitHub commentsJust comment with:
|
|
Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform) |
|
Don't merge yet, I need to update the documentation to refer to a specific 8.19 version that the changes in this PR apply to. |
Dependency Update AnalysisSummary: This PR includes a Go dependency removal ( github.com/elastic/ebpfevents v0.12.0 → removedEcosystem: Go
Changelog highlights (v0.12.0 → removed)No upstream vOLD→vNEW release-note path applies because this is a dependency removal. Local changelog fragment ( Usage in this repositoryPrevious usage existed in FIM/libbeat eBPF paths (pre-change), e.g. Compatibility assessment
These markers also surround apparent pseudo-bumps ( Labels AppliedNo labels applied (overall risk is high due unresolved dependency-manifest conflicts and documented behavioral breaking impact). What is this? | From workflow: Observability Agentic Workflow — Pull Request Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
This comment has been minimized.
This comment has been minimized.
|
This pull request has not been merged yet. Could you please review and merge it @{{ assignee | join(', @') }}? 🙏 |
Dependency Update AnalysisSummary: This PR removes Dependency:
|
| Check | Result |
|---|---|
| Breaking changes | auditbeat file_integrity ebpf backend) |
| Testable in PR | ✅ Yes (code + tests changed in PR context) |
Changelog highlights (v0.12.0 → removed)
- Upstream
ebpfeventsv0.12.0release notes: “bump ebpf to support kernel v7 renames” (elastic/ebpfeventsreleasev0.12.0). - This PR removes that dependency rather than upgrading it.
- CVE/security signal: no CVE/GHSA entries were found in the
v0.12.0release body; removing a dependency reduces direct supply-chain exposure to that module.
Usage in this repository
- Before this PR,
ebpfeventswas used by Auditbeat FIM and shared eBPF watcher code (for exampleauditbeat/module/file_integrity/event_linux.go,auditbeat/module/file_integrity/eventreader_ebpf.go,libbeat/ebpf/watcher_linux.go). - In this PR, those
ebpfeventsusages are removed and FIM now consumes quark queue events (auditbeat/module/file_integrity/eventreader_ebpf.go:53,:55,:155). - Additional behavior guardrails are documented in code and docs, including host PID namespace requirement (
auditbeat/module/file_integrity/eventreader_ebpf.go:73, docs/changelog updates).
Compatibility assessment
- The change is internally consistent for dependency migration, but it introduces user-visible behavior changes for
ebpfbackend usage:- host PID namespace requirement in containers (
--pid=host/hostPID: true), - possible event attribution/drop differences when not in host PID namespace,
- event-shape/aggregation semantics adjusted via quark queue handling.
- host PID namespace requirement in containers (
- These changes are documented and scoped to technical-preview backends, but they are still breaking for affected
ebpfusers. - No mutable pin risk or Actions commit-verification checks apply (not a GitHub Actions dependency bump).
Labels Applied
No labels applied (oblt-aw/ai/merge-ready withheld: moderate risk + breaking behavioral impact for production ebpf backend users).
What is this? | From workflow: Observability Agentic Workflow — Pull Request
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
|
This pull request is now in conflicts. Could you fix it? 🙏 |
|
This pull request is merged. |
TL;DRBuildkite failed before tests/build steps: the PR head cannot be merged into Remediation
Investigation detailsRoot CauseThis is a configuration/backport merge-conflict failure, not a runtime test failure. The Buildkite "Upload Pipeline" step runs a repo post-checkout hook that attempts to create/refresh a merge branch ( Evidence
Verification
Follow-up
What is this? | From workflow: Observability Agentic Workflow — Status Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
Pick up the elastic-agent-libs import (#54570) and the go-quark 0.9.0 upgrade (#54653) from 8.19, both of which this backport depends on: the FIM eBPF reader needs quark's File.ChangeMask, first available in quark 0.8, and 8.19 now imports logp and mapstr from pkg/ rather than from the elastic-agent-libs module. Conflict resolution: - file_integrity: keep this backport's ebpfreader_supported.go and eventreader_ebpf.go, importing logp from github.com/elastic/beats/v7/pkg. event_linux_test.go likewise for mapstr. - go.mod, go.sum: take 8.19's and drop only ebpfevents, then tidy. This also restores the sarama and brotli versions the branch had fallen behind on. - NOTICE.txt: regenerated.
0d18d74 to
20b9b52
Compare
Dependency Update AnalysisSummary: This PR removes Dependency: github.com/elastic/ebpfevents v0.12.0 → removedEcosystem: Go
Changelog highlights (v0.12.0 → removed)
Usage in this repository
Compatibility assessment
Labels AppliedNo labels applied ( What is this? | From workflow: Observability Agentic Workflow — Pull Request Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
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).
This is an automatic backport of pull request #53507 done by [Mergify](https://mergify.com).