Skip to content

Drop ebpfevents as a dependency, move auditbeat FIM to quark - #53507

Merged
christos68k merged 23 commits into
mainfrom
ck/ebpfevents
Nov 3, 2026
Merged

christos68k merged 23 commits into
mainfrom
ck/ebpfevents

Conversation

@christos68k

@christos68k christos68k commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

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

@christos68k
christos68k requested review from a team as code owners September 30, 2026 14:04
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 30, 2026
@christos68k
christos68k marked this pull request as draft September 30, 2026 14:04
@github-actions

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 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @christos68k? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@christos68k christos68k added the Team:Security-Linux Platform Linux Platform Team in Security Solution label Sep 30, 2026
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 30, 2026
@christos68k christos68k added Auditbeat needs_team Indicates that the issue/PR needs a Team:* label labels Sep 30, 2026
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 30, 2026
@christos68k christos68k added dependencies Pull requests that update a dependency file cleanup labels Sep 30, 2026
@mergify

mergify Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

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 ck/ebpfevents upstream/ck/ebpfevents
git merge upstream/main
git push upstream ck/ebpfevents

This is the first commit towards rewriting auditbeat's file integrity
module logic to work on top of quark.
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.
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

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

@christos68k
christos68k enabled auto-merge (squash) October 30, 2026 22:33
@christos68k

Copy link
Copy Markdown
Member Author

@elastic/ski-docs Can I get a quick review? It's the last one needed before merge.

@vishaangelova vishaangelova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments to scope the docs changes to the correct version.

christos68k and others added 3 commits November 3, 2026 15:33
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
@christos68k christos68k added the backport-active-all Automated backport with mergify to all the active branches label Nov 3, 2026

@vishaangelova vishaangelova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the docs.

@christos68k
christos68k disabled auto-merge November 3, 2026 15:13
@mergify

mergify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@christos68k
christos68k merged commit de78e8d into main Nov 3, 2026
230 checks passed
@christos68k
christos68k deleted the ck/ebpfevents branch November 3, 2026 16:54
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@Mergifyio backport 9.6 9.5 9.4 8.19

@mergify

mergify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

backport 9.6 9.5 9.4 8.19

✅ Backports have been created

Details

Cherry-pick of de78e8d has failed:

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

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:   NOTICE.txt
	modified:   auditbeat/module/file_integrity/_meta/docs.md
	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:   docs/reference/auditbeat/auditbeat-module-file_integrity.md
	modified:   docs/reference/auditbeat/running-on-docker.md
	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:   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

Cherry-pick of de78e8d has failed:

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

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:   NOTICE.txt
	modified:   auditbeat/module/file_integrity/_meta/docs.md
	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:   docs/reference/auditbeat/auditbeat-module-file_integrity.md
	modified:   docs/reference/auditbeat/running-on-docker.md
	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:   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

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

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

christos68k added a commit that referenced this pull request Nov 11, 2026
…t FIM to quark (#54418)

* Drop ebpfevents as a dependency, move auditbeat FIM to quark (#53507)

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)

Co-authored-by: Christos Kalkanis <christos.kalkanis@elastic.co>
christos68k added a commit that referenced this pull request Nov 12, 2026
…t FIM to quark (#54419)

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)

Co-authored-by: Christos Kalkanis <christos.kalkanis@elastic.co>
christos68k added a commit that referenced this pull request Nov 12, 2026
…at FIM to quark (#54421)

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)

Co-authored-by: Christos Kalkanis <christos.kalkanis@elastic.co>
@vishaangelova vishaangelova mentioned this pull request Nov 23, 2026
1 of 3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auditbeat backport-active-all Automated backport with mergify to all the active branches cleanup 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.

6 participants