Skip to content

[9.4](backport #53507) Drop ebpfevents as a dependency, move auditbeat FIM to quark - #54420

Closed
mergify[bot] wants to merge 2 commits into
9.4from
mergify/bp/9.4/pr-53507
Closed

mergify[bot] wants to merge 2 commits into
9.4from
mergify/bp/9.4/pr-53507

Conversation

@mergify

@mergify mergify Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation~ Not needed
  • [ ] I have made corresponding change to the default configuration files Not needed
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Disruptive User Impact

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).

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, with ebpf and Kprobes in 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).

cd auditbeat && mage build pythonUnitTest
sudo -E env PATH="$PATH" ../build/ve/linux/bin/pytest tests/system/test_file_integrity.py -k ebpf -v

You can also run auditbeat dumping JSON to stdout:

cd auditbeat
DEV=true mage build
mkdir -p /tmp/ab/watch
cat >/tmp/ab/auditbeat.yml << DONE
auditbeat.modules:
- module: file_integrity
  backend: ebpf
  paths: [/tmp/ab/watch]
  scan_at_start: false
  hash_types: [sha1]

output.console:
  pretty: true
DONE
sudo ./auditbeat -e --strict.perms=false -c /tmp/ab/auditbeat.yml --path.home=/tmp/ab 2>/tmp/ab/log.txt

# Proceed to generate file activity e.g. create, chmod, chown, rm inside /tmp/ab/watch

Verification that auditbeat started correctly:

grep -E '(Syscall filter successfully|started ebpf watcher)' /tmp/ab/log.txt
# Must output two matches

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).

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
@mergify mergify Bot added backport conflicts There is a conflict in the backported pull request labels Nov 3, 2026
@mergify
mergify Bot requested a review from a team as a code owner November 3, 2026 16:55
@mergify

mergify Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of de78e8d has failed:

On branch mergify/bp/9.4/pr-53507
Your branch is up to date with 'origin/9.4'.

You are currently cherry-picking commit de78e8d.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   .github/dependabot.yml
	modified:   auditbeat/module/file_integrity/ebpfreader_other.go
	modified:   auditbeat/module/file_integrity/ebpfreader_supported.go
	modified:   auditbeat/module/file_integrity/event_linux.go
	modified:   auditbeat/module/file_integrity/event_linux_test.go
	modified:   auditbeat/module/file_integrity/eventreader_ebpf.go
	deleted:    auditbeat/module/file_integrity/eventreader_ebpf_test.go
	modified:   auditbeat/tests/system/test_file_integrity.py
	new file:   changelog/fragments/1793136201-auditbeat-fim-ebpf-docker-pid-host.yaml
	modified:   dev-tools/notice/overrides.json
	modified:   go.mod
	deleted:    libbeat/ebpf/seccomp_linux.go
	deleted:    libbeat/ebpf/watcher_linux.go
	deleted:    libbeat/ebpf/watcher_test.go
	modified:   x-pack/auditbeat/seccomp_linux.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   NOTICE.txt
	both modified:   auditbeat/module/file_integrity/_meta/docs.md
	both modified:   docs/reference/auditbeat/auditbeat-module-file_integrity.md
	both modified:   docs/reference/auditbeat/running-on-docker.md
	both modified:   go.sum

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

@mergify
mergify Bot requested a review from a team as a code owner November 3, 2026 16:55
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 3, 2026
@mergify
mergify Bot requested review from a team as code owners November 3, 2026 16:55
@mergify
mergify Bot removed the request for review from a team November 3, 2026 16:55
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@mergify
mergify Bot requested a review from orestisfl November 3, 2026 16:55
@github-actions github-actions Bot added Auditbeat cleanup Team:Security-Linux Platform Linux Platform Team in Security Solution dependencies Pull requests that update a dependency file labels Nov 3, 2026
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 3, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform)

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Elastic Docs Style Checker (Vale)

Summary: 6 errors found

❌ Errors (6): Must fix before merge.
File Line Rule Message
docs/reference/auditbeat/auditbeat-module-file_integrity.md 18 Elastic.ConflictMarkers Do not commit Git merge conflict markers in source code.
docs/reference/auditbeat/auditbeat-module-file_integrity.md 19 Elastic.ConflictMarkers Do not commit Git merge conflict markers in source code.
docs/reference/auditbeat/auditbeat-module-file_integrity.md 51 Elastic.ConflictMarkers Do not commit Git merge conflict markers in source code.
docs/reference/auditbeat/running-on-docker.md 159 Elastic.ConflictMarkers Do not commit Git merge conflict markers in source code.
docs/reference/auditbeat/running-on-docker.md 161 Elastic.ConflictMarkers Do not commit Git merge conflict markers in source code.
docs/reference/auditbeat/running-on-docker.md 191 Elastic.ConflictMarkers Do not commit Git merge conflict markers in source code.

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.

@christos68k
christos68k marked this pull request as draft November 3, 2026 16:58
@christos68k

Copy link
Copy Markdown
Member

Don't merge yet, I need to update the documentation to refer to a specific 9.4 version that the changes in this PR apply to.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Dependency Update Analysis

Summary: This PR removes github.com/elastic/ebpfevents and introduces conflicting go.sum entries (including attempted bumps to elastic-agent-client and go-jose), resulting in high risk because module resolution is currently broken.

Dependency 1: github.com/elastic/ebpfevents v0.12.0 → removed

Ecosystem: Go

Check Result
Breaking changes ⚠️ Found (module graph currently broken due malformed go.sum)
Changelog highlights (v0.12.0 → removed)

Removed from direct requirements in go.mod (git diff hunk in require block). No upstream release-note comparison is applicable for a pure removal.

Usage in this repository

The implementation in auditbeat/module/file_integrity/eventreader_ebpf.go now uses github.com/elastic/go-quark (eventreader_ebpf.go:29, :53, :55, :135). No remaining direct ebpfevents imports were found in *.go files.

Compatibility assessment

Functionally, the migration to quark is explicit in code paths under auditbeat/module/file_integrity. However, dependency-file consistency is currently broken, which is a hard compatibility blocker for build/test tooling.

Dependency 2: github.com/elastic/elastic-agent-client/v7 v7.18.1 → v7.19.0 (attempted in go.sum conflict block)

Ecosystem: Go

Check Result
Breaking changes ⚠️ Found (go.sum contains unresolved merge markers)
Changelog highlights (v7.18.1 → v7.19.0)

Release v7.19.0 includes dependency/tooling updates and agent tag/unit update work (source: elastic/elastic-agent-client release tag v7.19.0). No explicit API-breaking note was identified in that release body.

Usage in this repository

Directly used across x-pack management/agent code (e.g. x-pack/libbeat/management/managerV2.go, x-pack/filebeat/cmd/agent.go, x-pack/metricbeat/cmd/agent.go, x-pack/packetbeat/cmd/root.go) via pkg/client and pkg/proto imports.

Compatibility assessment

Cannot validate compatibility while go.sum is malformed. go list -m all fails with:

  • malformed go.sum:
  • go.sum:377: wrong number of fields 2

and merge markers exist at go.sum:377, :382, :385, :490, :495, :498.

Dependency 3: github.com/go-jose/go-jose/v4 v4.1.4 → v4.1.6 (attempted in go.sum conflict block)

Ecosystem: Go

Check Result
Breaking changes ⚠️ Found upstream + PR file inconsistency
Changelog highlights (v4.1.4 → v4.1.6)

v4.1.6 fixes a security advisory (GHSA-mgcc-cww5-fp2q) and introduces a behavioral breaking change: JWK parsing now caps RSA modulus size to 4096 bits unless MaxRSAModulusBits is set.

Usage in this repository

No direct github.com/go-jose/go-jose/v4 imports were found in repository *.go files, indicating transitive-only exposure in this repo.

Compatibility assessment

The upstream security fix is favorable, and direct API impact appears low for this repo. However, unresolved merge markers in go.sum prevent reliable dependency graph validation.

Labels Applied

No labels applied (oblt-aw/ai/merge-ready not applied because overall risk is high due malformed dependency files and immediate module-resolution failure).


What is this? | From workflow: Observability Agentic Workflow — Pull Request

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Buildkite failed because this backport commit includes unresolved merge conflict markers, which breaks pre-commit (check-merge-conflict) and also makes go.sum invalid (wrong number of fields 2). Resolve conflicts in docs + go.sum, then re-run CI.

Remediation

  • Resolve all conflict-marker blocks in:
    • auditbeat/module/file_integrity/_meta/docs.md (lines 6/7/39)
    • docs/reference/auditbeat/auditbeat-module-file_integrity.md (lines 18/19/51)
    • docs/reference/auditbeat/running-on-docker.md (lines 159/161/191)
    • go.sum (lines 377/382/385 and 490/495/498)
  • Rebuild dependency metadata after conflict resolution (go mod tidy from repo root), then re-run pre-commit and Buildkite.
Investigation details

Root Cause

This is a configuration/merge-resolution failure in the backport commit (8715cef8bb676b81dc1b0fecfe5c1dbaedb16579), not a flaky test or runtime bug. The commit message itself lists conflict files (go.sum + docs), and Buildkite logs show unresolved markers directly.

Evidence

  • Build: https://buildkite.com/elastic/beats/builds/55609
  • Job/step: multiple Run pre-commit and Run check/update jobs across beats (34 failures total)
  • Key log excerpts:
    • check for merge conflicts................................................Failed
    • go.sum:377: Merge conflict string '<<<<<<<' found
    • malformed go.sum:
    • /.../go.sum:377: wrong number of fields 2
    • make: *** [../dev-tools/make/mage-install.mk:10: mage] Error 1

Verification

  • Reproduced from provided Buildkite failure logs under /tmp/gh-aw/buildkite-logs/.
  • Local tests were not run because this environment is not checked out at the PR head commit; diagnosis is log- and metadata-based.

Follow-up

  • I checked for a related flaky-test issue (label:flaky-test "check for merge conflicts") and found none.

What is this? | From workflow: Observability Agentic Workflow — Status

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@mergify

mergify Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

This pull request has not been merged yet. Could you please review and merge it @{{ assignee | join(', @') }}? 🙏

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Dependency Update Analysis

Summary: This PR removes github.com/elastic/ebpfevents from Go dependencies and shifts Auditbeat FIM eBPF handling to github.com/elastic/go-quark; overall risk is high for merge readiness due unresolved merge-conflict markers in dependency/docs files.

Dependency 1: github.com/elastic/ebpfevents v0.12.0 → removed

Ecosystem: Go

Check Result
Breaking changes ⚠️ Found (behavioral changes in eBPF backend path/process attribution and event coalescing)
Testable in PR ✅ Yes (.github/workflows/check-default.yml and .github/workflows/golangci-lint.yml run on pull_request)
Changelog highlights (v0.12.0 → removed)
  • Local change replaces ebpfevents event path with quark queue processing:
    • auditbeat/module/file_integrity/eventreader_ebpf.go:53 (QQ_EBPF | QQ_FILE | QQ_MIN_AGG)
    • auditbeat/module/file_integrity/eventreader_ebpf.go:55 (quark.OpenQueue)
    • auditbeat/module/file_integrity/event_linux.go:43 (NewEventFromQuarkEvent)
  • Upstream ebpfevents v0.12.0 release itself was a kernel-rename compatibility bump; dependency is now removed instead of upgraded.
  • Security/CVE notes: no CVE/GHSA was identified in the ebpfevents release note body.
Usage in this repository
  • Previous direct usage existed in base commit in:
    • auditbeat/module/file_integrity/event_linux.go:31 (import)
    • auditbeat/module/file_integrity/eventreader_ebpf.go:29 (import)
  • Current head has no remaining Go import matches for github.com/elastic/ebpfevents.
Compatibility assessment
  • This is not a pure version bump: it is a backend dependency swap in file-integrity event production.
  • Behavioral differences are explicitly surfaced in code/docs updates (PID namespace handling, quark process-cache attribution path).
  • High merge risk right now from unresolved conflict markers in changed files:
    • go.sum:377, go.sum:490
    • NOTICE.txt:52422
    • auditbeat/module/file_integrity/_meta/docs.md:6
    • docs/reference/auditbeat/auditbeat-module-file_integrity.md:18
    • docs/reference/auditbeat/running-on-docker.md:159

Dependency 2: github.com/elastic/elastic-agent-client/v7 v7.18.1 → v7.19.0 (go.sum)

Ecosystem: Go

Check Result
Breaking changes ✅ None found in release notes affecting observed usage
Testable in PR ✅ Yes
Changelog highlights (v7.18.1 → v7.19.0)
  • Mostly dependency/tooling updates and agent-tags work in upstream release.
  • Security-relevant entries include grpc/x-net dependency bumps and workflow permission hardening.
Usage in this repository
  • Widely used across x-pack management/agent integration code, e.g. imports in x-pack/libbeat/management/* and beat cmd roots (pkg/client, pkg/proto).
Compatibility assessment
  • No direct API-break signal in upstream notes for this bump.
  • However, unresolved go.sum conflict markers block confidence in deterministic module resolution until fixed.

Dependency 3: github.com/go-jose/go-jose/v4 v4.1.4 → v4.1.6 (go.sum)

Ecosystem: Go

Check Result
Breaking changes ⚠️ Upstream notes a JWK RSA modulus cap (4096-bit default)
Testable in PR ✅ Yes
Changelog highlights (v4.1.4 → v4.1.6)
  • Release includes fix for GHSA-mgcc-cww5-fp2q.
  • Breaking note: JWK parsing now caps RSA modulus size unless MaxRSAModulusBits is adjusted.
  • Also includes CEK length validation hardening for JWE.
Usage in this repository
  • No direct Go import matches for github.com/go-jose/go-jose/v4 were found; appears transitive.
Compatibility assessment
  • As a transitive update, direct blast radius in this repo is limited.
  • Security posture likely improves via advisory fix, but unresolved merge markers still dominate merge risk.

Labels Applied

No labels applied (oblt-aw/ai/merge-ready not applied because overall risk is high until conflict markers are resolved).


What is this? | From workflow: Observability Agentic Workflow — Pull Request

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/9.4/pr-53507 upstream/mergify/bp/9.4/pr-53507
git merge upstream/9.4
git push upstream mergify/bp/9.4/pr-53507

@christos68k

Copy link
Copy Markdown
Member

Closing as 9.4 is EOL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auditbeat backport cleanup conflicts There is a conflict in the backported pull request dependencies Pull requests that update a dependency file Team:Security-Linux Platform Linux Platform Team in Security Solution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant