Repository navigation
[9.5](backport #53507) Drop ebpfevents as a dependency, move auditbeat FIM to quark - #54419
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: # 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) |
✅ 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. |
|
Don't merge yet, I need to update the documentation to refer to a specific 9.5 version that the changes in this PR apply to. |
Dependency Update AnalysisSummary: This PR removes github.com/elastic/ebpfevents v0.12.0 → removedEcosystem: Go
Changelog highlights (v0.12.0 → removed)Local metadata confirms the dependency is removed and file event handling is moved to quark:
No upstream release-note comparison is applicable for a dependency removal. Usage in this repositoryCurrent tree has no remaining imports of Quark usage for this path is present in:
Additional existing quark usage also appears in:
Compatibility assessmentThe intended dependency migration appears coherent, but the PR currently introduces malformed module metadata:
Those blocks include conflicting entries (e.g.
Given this, the update is not merge-ready yet. Labels AppliedNo labels applied (risk is high due malformed 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 the direct Go dependency Dependency 1: 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 (withheld 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. |
This comment has been minimized.
This comment has been minimized.
Dependency Update AnalysisSummary: This PR replaces github.com/elastic/ebpfevents
|
| Check | Result |
|---|---|
| Breaking changes | |
| Testable in PR | ✅ Yes (PR CI/check runs are executing; module unit/system tests were updated in this PR) |
Changelog highlights (v0.12.0 → removed)
ebpfeventsv0.12.0release notes only mention: "bump ebpf to support kernel v7 renames".- No CVE/GHSA/security-fix entries are called out in the upstream release note.
- Removing this dependency reduces supply-chain surface (and transitively drops
elastic/ebpffrom this path).
Usage in this repository
Removed imports previously at:
auditbeat/module/file_integrity/event_linux.go:31(base commit)auditbeat/module/file_integrity/event_linux_test.go:28(base commit)auditbeat/module/file_integrity/eventreader_ebpf.go:30(base commit)auditbeat/module/file_integrity/eventreader_ebpf_test.go:28(base commit)libbeat/ebpf/watcher_linux.go:27andlibbeat/ebpf/watcher_test.go:30(base commit)
Current tree has no github.com/elastic/ebpfevents imports.
Compatibility assessment
- Migration is implemented in-repo (new quark-backed reader/event mapping), so there is no unresolved API mismatch against
ebpfevents. - However, behavior changed for users of the
ebpfbackend (notably Docker--pid=hostrequirement and possible CREATE+REMOVE coalescing), so this is not a low-risk drop-in replacement.
github.com/elastic/elastic-agent-libs v0.7.2 (indirect) → v0.47.0 (direct)
Ecosystem: Go
| Check | Result |
|---|---|
| Breaking changes | ✅ None found for consumed APIs (logp, mapstr) |
| Testable in PR | ✅ Yes (same PR CI context; direct call sites are in changed/tested Auditbeat files) |
Changelog highlights (v0.7.2 → v0.47.0)
- Upstream
v0.47.0notes include housekeeping pluspaths, logp: remove the global paths singleton. - No CVE/GHSA/security advisory entries are listed in the release note.
- Security posture impact for this repo appears neutral-to-positive: no newly expanded privileged scope from this module bump itself.
Usage in this repository
Current direct imports are limited to:
auditbeat/module/file_integrity/ebpfreader_supported.go:26(logp)auditbeat/module/file_integrity/eventreader_ebpf.go:31(logp)auditbeat/module/file_integrity/event_linux_test.go:34(mapstr)
Compatibility assessment
- Current usage relies on logger/map utilities, not the removed global paths singleton.
- No Go major-version path break (
/v2etc.) is involved. go.sumcleanup shows expected transitive removals after droppingebpfevents; no incompatible direct API calls detected.
Labels Applied
No labels applied (oblt-aw/ai/merge-ready not applied because overall risk is moderate due documented behavioral/breaking impact for eBPF FIM users).
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 comment has been minimized.
This comment has been minimized.
|
This pull request is now in conflicts. Could you fix it? 🙏 |
Merge elastic-agent-libs import (#54568) and the go-quark 0.9.0 upgrade (#54625) from 9.5, both of which this backport depends on: the FIM eBPF reader needs quark's File.ChangeMask, first available in quark 0.8, and 9.5 now imports logp and mapstr from pkg/ rather than from the elastic-agent-libs module. Conflict resolution: - file_integrity: import logp and mapstr from github.com/elastic/beats/v7/pkg in the files this backport rewrites - Updated go.mod, go.sum - Updated NOTICE.txt
Dependency Update AnalysisSummary: This PR removes the Go dependency Dependency: github.com/elastic/ebpfevents
|
| Check | Result |
|---|---|
| Breaking changes | |
| Testable in PR | ✅ Yes (code/tests/docs changed in PR context) |
Changelog highlights (v0.12.0 → removed)
- Upstream release-note comparison is not applicable because this is a dependency removal, not a version bump.
- Local changelog explicitly marks this as
kind: breaking-changeand states new host PID namespace requirement for the eBPF backend:changelog/fragments/1793136201-auditbeat-fim-ebpf-docker-pid-host.yaml:1-48. - Security/CVE notes: no CVE/GHSA IDs were introduced in local metadata; security impact is mainly architectural:
- positive: removes
github.com/elastic/ebpfeventsfromgo.modand drops related transitive modules fromgo.sum. - caution: non-host PID namespace deployments can drop/misattribute events (visibility/integrity risk for detections).
- positive: removes
Usage in this repository
Pre-change ebpfevents usage existed in FIM and shared watcher paths (base commit scan):
auditbeat/module/file_integrity/event_linux.go(event translation path)auditbeat/module/file_integrity/eventreader_ebpf.go(event subscription path)libbeat/ebpf/watcher_linux.go(shared watcher wrapper)
Post-change:
go.modno longer requiresgithub.life-white.uk/elastic/ebpfevents(removed from diff).- FIM now uses quark queue (
quark.QQ_EBPF | quark.QQ_FILE | quark.QQ_MIN_AGG) inauditbeat/module/file_integrity/eventreader_ebpf.go:29-53. - Event mapping now uses quark file/process payloads in
auditbeat/module/file_integrity/event_linux.go:40-241. - Doc/runtime warning on PID namespace requirement:
auditbeat/module/file_integrity/eventreader_ebpf.go:72-73,docs/reference/auditbeat/auditbeat-module-file_integrity.md:39,docs/reference/auditbeat/running-on-docker.md:159-165.
Compatibility assessment
- This is not a Go major-version import-path migration; it is a backend implementation swap with direct user-visible behavior changes.
- Breaking behavior is documented and enforced by runtime warnings when not in initial PID namespace.
file.modehandling was aligned to permission bits (auditbeat/tests/system/test_file_integrity.py:114-115,auditbeat/module/file_integrity/event_linux.go:150), which can affect downstream expectations.- Result: compatibility risk is moderate for Docker/K8s users of
file_integritywithbackend: ebpfunless--pid=host/hostPID: trueis set.
Labels Applied
No labels applied (did not apply oblt-aw/ai/merge-ready because overall risk is moderate and breaking behavior is documented).
What is this? | From workflow: Observability Agentic Workflow — Pull Request
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
TL;DRBuildkite Remediation
Investigation detailsRoot Cause
Given shutdown happens in Evidence
Verification
Follow-up
What is this? | From workflow: Observability Agentic Workflow — Status Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
|
/test |
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).