Skip to content

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

Merged
christos68k merged 7 commits into
8.19from
mergify/bp/8.19/pr-53507
Nov 12, 2026
Merged

christos68k merged 7 commits into
8.19from
mergify/bp/8.19/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/8.19/pr-53507
Your branch is up to date with 'origin/8.19'.

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/rm <file>..." as appropriate to mark resolution)
	both modified:   NOTICE.txt
	deleted by us:   auditbeat/module/file_integrity/_meta/docs.md
	deleted by us:   docs/reference/auditbeat/auditbeat-module-file_integrity.md
	deleted by us:   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 review from a team as code owners 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 leehinman and removed request for 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.

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

@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 8.19 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 includes a Go dependency removal (github.com/elastic/ebpfevents), but it also introduces unresolved merge-conflict markers in dependency artifacts (go.sum, NOTICE.txt), so overall risk is high and not merge-ready.

github.com/elastic/ebpfevents v0.12.0 → removed

Ecosystem: Go

Check Result
Breaking changes ⚠️ Found (runtime behavior change documented; details below)
Testable in PR ✅ Yes (Go/code + system test files changed in this PR context)
Changelog highlights (v0.12.0 → removed)

No upstream vOLD→vNEW release-note path applies because this is a dependency removal. Local changelog fragment (changelog/fragments/1793136201-auditbeat-fim-ebpf-docker-pid-host.yaml) states the eBPF backend moved to github.com/elastic/go-quark and now requires host PID namespace in Docker/K8s for correct attribution.

Usage in this repository

Previous usage existed in FIM/libbeat eBPF paths (pre-change), e.g. auditbeat/module/file_integrity/event_linux.go and libbeat/ebpf/watcher_linux.go (seen in HEAD~1). Current code imports github.com/elastic/go-quark instead (for example auditbeat/module/file_integrity/event_linux.go:32, auditbeat/module/file_integrity/eventreader_ebpf.go:29).

Compatibility assessment

go.mod removes github.com/elastic/ebpfevents from direct requirements. However, there is a blocking integrity issue: unresolved merge-conflict markers are present in dependency artifacts:

  • go.sum:370, go.sum:375, go.sum:378, go.sum:483, go.sum:488, go.sum:491
  • NOTICE.txt:48828, NOTICE.txt:49072, NOTICE.txt:49073

These markers also surround apparent pseudo-bumps (github.com/elastic/elastic-agent-client/v7 and github.com/go-jose/go-jose/v4) and make the dependency state ambiguous/non-mergeable until resolved.

Labels Applied

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

@github-actions

This comment has been minimized.

@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 (v0.12.0) from Beats and migrates Auditbeat FIM eBPF event ingestion to github.com/elastic/go-quark; overall risk is moderate due runtime behavior changes in the ebpf backend.

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

Ecosystem: Go

Check Result
Breaking changes ⚠️ Found (runtime behavior changes in auditbeat file_integrity ebpf backend)
Testable in PR ✅ Yes (code + tests changed in PR context)
Changelog highlights (v0.12.0 → removed)
  • Upstream ebpfevents v0.12.0 release notes: “bump ebpf to support kernel v7 renames” (elastic/ebpfevents release v0.12.0).
  • This PR removes that dependency rather than upgrading it.
  • CVE/security signal: no CVE/GHSA entries were found in the v0.12.0 release body; removing a dependency reduces direct supply-chain exposure to that module.
Usage in this repository
  • Before this PR, ebpfevents was used by Auditbeat FIM and shared eBPF watcher code (for example auditbeat/module/file_integrity/event_linux.go, auditbeat/module/file_integrity/eventreader_ebpf.go, libbeat/ebpf/watcher_linux.go).
  • In this PR, those ebpfevents usages 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 ebpf backend 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.
  • These changes are documented and scoped to technical-preview backends, but they are still breaking for affected ebpf users.
  • 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.

@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/8.19/pr-53507 upstream/mergify/bp/8.19/pr-53507
git merge upstream/8.19
git push upstream mergify/bp/8.19/pr-53507

@christos68k
christos68k marked this pull request as ready for review November 10, 2026 22:37
@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is merged.

@christos68k
christos68k marked this pull request as draft November 10, 2026 22:37
@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

Buildkite failed before tests/build steps: the PR head cannot be merged into 8.19 in the repository post-checkout hook. Resolve the merge conflicts in the backport branch, push the updated branch, then rerun CI.

Remediation

  • Rebase/merge origin/8.19 into mergify/bp/8.19/pr-53507 and resolve conflicts in:
    • auditbeat/module/file_integrity/ebpfreader_supported.go
    • auditbeat/module/file_integrity/eventreader_ebpf.go
    • go.mod
  • Run go mod tidy (if needed) and commit the conflict resolution.
  • Re-run Buildkite (/test) after pushing the resolved branch.
Investigation details

Root Cause

This 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 (pr_merge_54421), and the auto-merge fails.

Evidence

  • Build: https://buildkite.com/elastic/beats/builds/56093
  • Job/step: :pipeline::arrow_up: Upload Pipeline: .buildkite/pipeline.yml
  • Key log excerpt (/tmp/gh-aw/buildkite-logs/beats-pipelinearrow_up-upload-pipeline-buildkitepipelineyml.txt):
    • Auto-merging auditbeat/module/file_integrity/ebpfreader_supported.go
    • CONFLICT (content): Merge conflict in auditbeat/module/file_integrity/ebpfreader_supported.go
    • CONFLICT (content): Merge conflict in auditbeat/module/file_integrity/eventreader_ebpf.go
    • CONFLICT (content): Merge conflict in go.mod
    • Automatic merge failed; fix conflicts and then commit the result.
    • --- Merge failed: 1
    • 🚨 Error: running "repository post-checkout" shell hook: the repository post-checkout hook exited with status 1

Verification

  • Reviewed pre-fetched Buildkite event and failure summary files.
  • Reviewed the failing step log listed in the summary.
  • Did not run local tests: failure occurs before test execution and is deterministic from merge conflict output.

Follow-up

  • I checked prior accessible detective comments and posted only because this run’s failing signature is the current merge-conflict blocker for build 56093.
  • I could not fully verify whether a matching flaky-test issue already exists because newer PR comments/issues are filtered by integrity policy in this run context.

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.
@christos68k
christos68k force-pushed the mergify/bp/8.19/pr-53507 branch from 0d18d74 to 20b9b52 Compare November 12, 2026 15:04
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Dependency Update Analysis

Summary: This PR removes github.com/elastic/ebpfevents (Go) and migrates Auditbeat FIM eBPF handling to github.com/elastic/go-quark; overall risk is moderate because behavior/runtime requirements changed for Docker/K8s deployments.

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

Ecosystem: Go

Check Result
Breaking changes ⚠️ Found (behavior/runtime impact documented below)
Testable in PR ✅ Yes (repo has pull_request CI workflows, e.g. .github/workflows/check-default.yml:4)
Changelog highlights (v0.12.0 → removed)
  • Direct module removed from go.mod (go.mod base had github.com/elastic/ebpfevents v0.12.0 at line 172; head no longer has it, go.mod:165-180).
  • Local changelog fragment marks this as a breaking change and states FIM eBPF now uses quark, with Docker/K8s PID namespace requirements (changelog/fragments/1793136201-auditbeat-fim-ebpf-docker-pid-host.yaml:22-42).
  • Security/CVE notes: no CVE/GHSA/security-fix entries were identified in this PR-local changelog metadata.
  • Transitive cleanup in go.sum/NOTICE.txt is consistent with removing ebpfevents and elastic/ebpf.
Usage in this repository
  • Prior usage (base commit) was concentrated in Auditbeat FIM eBPF code:
    • auditbeat/module/file_integrity/event_linux.go:31,37-39 (ebpfevents import + event mapping)
    • auditbeat/module/file_integrity/eventreader_ebpf.go:30,44,51 (record stream + event mask)
    • auditbeat/module/file_integrity/eventreader_ebpf_test.go:28-43 (event-type tests)
  • Current head uses quark in the same area:
    • auditbeat/module/file_integrity/eventreader_ebpf.go:29,45-56,63-74
    • auditbeat/module/file_integrity/event_linux.go:32,40-44,58-63
Compatibility assessment
  • The migration is internally wired through matching file-integrity modules and tests, so code-level integration is coherent.
  • However, documented runtime behavior changed: without --pid=host / hostPID: true in containerized deployments, attribution/drop issues can occur (...pid-host.yaml:36-42).
  • This is a production-facing behavior change (even if backend is technical preview), so risk is moderate rather than low/low-to-moderate.

Labels Applied

No labels applied (oblt-aw/ai/merge-ready not applied due moderate risk and documented breaking operational impact).


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

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

@christos68k
christos68k merged commit 0b40429 into 8.19 Nov 12, 2026
227 of 228 checks passed
@christos68k
christos68k deleted the mergify/bp/8.19/pr-53507 branch November 12, 2026 17:24
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