Repository navigation
[9.6](backport #53507) Drop ebpfevents as a dependency, move auditbeat FIM to quark - #54418
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) |
|
Don't merge yet, I need to update the documentation to refer to a specific 9.6 version that the changes in this PR apply to. |
✅ 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. |
Dependency Update AnalysisSummary: This PR removes 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 (did not apply 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 1: github.com/elastic/ebpfevents v0.12.0 → removedEcosystem: Go
Changelog highlights (v0.12.0 → removed)
Usage in this repositoryPre-change usage was concentrated in Auditbeat FIM + libbeat eBPF code:
Current branch no longer imports Compatibility assessment
Labels AppliedNo labels applied (merge-ready criteria not met due malformed 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 comment has been minimized.
This comment has been minimized.
|
This pull request is merged. |
Dependency Update AnalysisSummary: This PR removes Dependency 1:
|
| Check | Result |
|---|---|
| Breaking changes | |
| Testable in PR | ✅ Yes (unit/system tests updated in this PR) |
Changelog highlights (v0.12.0 / replacement libs)
elastic/ebpfevents v0.12.0release notes show kernel v7 rename support; no CVE/GHSA entries were listed.elastic/elastic-agent-libs v0.47.0release notes include mostly maintenance changes (team metadata, updatecli bumps, Go/linter alignment,paths/logpsingleton cleanup); no CVE/GHSA entries were listed.- Security/CVE assessment: no explicit upstream security advisories were introduced by these versions from release-note content.
Usage in this repository
Current implementation uses quark + agent libs in Auditbeat FIM:
auditbeat/module/file_integrity/eventreader_ebpf.go:29-31importsgithub.life-white.uk/elastic/go-quarkandgithub.life-white.uk/elastic/elastic-agent-libs/logp.auditbeat/module/file_integrity/eventreader_ebpf.go:44-57opens and configures quark queue (QQ_EBPF | QQ_FILE | QQ_MIN_AGG).auditbeat/module/file_integrity/event_linux.go:40-128maps quark events to Beat file-integrity events.
Prior ebpfevents usage removed from:
auditbeat/module/file_integrity/eventreader_ebpf.go(old import/subscription path)auditbeat/module/file_integrity/event_linux.go(oldNewEventFromEbpfEventmapping)libbeat/ebpf/watcher_linux.goandlibbeat/ebpf/watcher_test.godeleted
Compatibility assessment
- The repo code was updated to the new interfaces (quark event model + direct
elastic-agent-libs/logpusage), with corresponding test rewrites inauditbeat/module/file_integrity/event_linux_test.go. - User-visible behavior changes are documented in this PR/docs: eBPF backend in Docker now requires host PID namespace, and some operation sequences may be coalesced differently.
- This is compatible at compile-time with in-repo usage, but it is not a no-behavior-change dependency bump; operational semantics changed in a production feature path.
Labels Applied
No labels applied (did not apply oblt-aw/ai/merge-ready because overall risk is moderate due runtime behavior changes in production-facing functionality).
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.
Dependency Update AnalysisSummary: This PR performs a Go dependency migration ( Dependency:
|
| Check | Result |
|---|---|
| Breaking changes | docs/reference/auditbeat/auditbeat-module-file_integrity.md:39 and docs/reference/auditbeat/running-on-docker.md:165. |
| Testable in PR | ✅ Yes — usage and behavior updates are exercised by changed unit/system tests in-repo (auditbeat/module/file_integrity/event_linux_test.go, auditbeat/tests/system/test_file_integrity.py:114-116). |
Changelog highlights (vOLD → vNEW)
elastic/ebpfevents v0.12.0release notes: “bump ebpf to support kernel v7 renames” (no CVE/GHSA noted).elastic-agent-libs v0.47.0release notes includepaths, logp: remove the global paths singletonand repo/tooling alignment changes (no CVE/GHSA noted).- CVE-focused assessment: no vulnerability advisories were identified in the upstream release notes reviewed for these tags; this migration mainly changes backend implementation and dependency graph, not introducing known new vulnerable surface from release-note evidence.
Usage in this repository
- Module graph change is explicit in
go.mod:172(github.com/elastic/elastic-agent-libs v0.47.0) replacing the priorebpfeventsrequirement. - Runtime usage moved to quark-backed event ingestion and agent-libs logging/types:
auditbeat/module/file_integrity/eventreader_ebpf.go:29-31(importsgo-quark,elastic-agent-libs/logp)auditbeat/module/file_integrity/eventreader_ebpf.go:44-57(quark queue setup)auditbeat/module/file_integrity/event_linux.go:40-98(NewEventFromQuarkEventpath)
- No remaining Go-source imports of
github.com/elastic/ebpfeventswere found in this branch.
Compatibility assessment
- Compile-time/API compatibility in this repo looks addressed: callsites now consume quark events and use
elastic-agent-libs(logp,mapstr) consistently. - Behavioral compatibility changed intentionally for the eBPF backend (documented and tested):
- host PID namespace requirement in containerized runs
- event semantics/metadata handling differences reflected in tests and docs
- Security posture from available notes appears neutral-to-improved (dependency consolidation; no new advisories identified), but operational/runtime behavior impact keeps overall risk at moderate.
Labels Applied
No labels applied (overall risk is moderate, so oblt-aw/ai/merge-ready was not applied).
What is this? | From workflow: Observability Agentic Workflow — Pull Request
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
Dependency Update AnalysisSummary: This PR removes Go dependency github.com/elastic/ebpfevents v0.12.0 → removed (migrated to go-quark path)Ecosystem: Go
Changelog highlights (v0.12.0 → removal)Upstream release notes are not applicable for a removal/migration bump. From local metadata in this PR:
Security/CVE review:
Usage in this repository
Compatibility assessment
Labels AppliedNo labels applied (overall risk assessed as moderate; What is this? | From workflow: Observability Agentic Workflow — Pull Request Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
TL;DRBuildkite failed in the Winlogbeat setup step before Remediation
Investigation detailsRoot CauseInfrastructure/setup-script failure in Windows CI: Sysmon downloads and manifest installation succeed, then the job exits because temp directory deletion fails. Relevant code:
Evidence
Verification
Follow-upI checked for matching open 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).