Skip to content

auditbeat: update for quark 0.9 changes - #53284

Merged
biscout42 merged 4 commits into
mainfrom
ck/quark
Oct 6, 2026
Merged

biscout42 merged 4 commits into
mainfrom
ck/quark

Conversation

@christos68k

@christos68k christos68k commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Proposed commit message

Update auditbeat for the breaking changes in quark v0.9:

  • quark.TimeToWallclock() and quark.UpdateBoottime have been removed

Why it is important

Once beats picks up a go-quark release with quark ≥ 0.9, logic that depends on the removed APIs would break; this PR updates such logic.

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 N/A
  • I have made corresponding change to the default configuration files N/A
  • I have added tests that prove my fix is effective or that my feature works (updated existing tests in-place)
  • I have added an entry in ./changelog/fragments using the changelog tool.

How to test this PR locally

sudo go test -v ./x-pack/auditbeat/module/system/process/ -run 'Quark|Snapshot|ForkExec'

Related issues

@christos68k
christos68k requested a review from a team as a code owner September 16, 2026 21:36
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 16, 2026
@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 16, 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 marked this pull request as draft September 16, 2026 21:42
@christos68k christos68k changed the title DRAFT: auditbeat: update for quark 0.9 changes auditbeat: update for quark 0.9 changes Sep 16, 2026
biscout42 added a commit to biscout42/elastic-agent that referenced this pull request Sep 24, 2026
@christos68k christos68k added the Team:Security-Linux Platform Linux Platform Team in Security Solution label Sep 28, 2026
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 28, 2026
@christos68k
christos68k marked this pull request as ready for review September 29, 2026 08:53
@christos68k
christos68k requested a review from a team as a code owner September 29, 2026 08:53
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

@christos68k

Copy link
Copy Markdown
Member Author

CC: @nfritts @P1llus

@mergify

mergify Bot commented Sep 29, 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 added the dependencies Pull requests that update a dependency file label Sep 30, 2026
@biscout42
biscout42 merged commit 181205b into main Oct 6, 2026
236 of 237 checks passed
@biscout42
biscout42 deleted the ck/quark branch October 6, 2026 13:16
christos68k added a commit that referenced this pull request Nov 12, 2026
* [auditbeat] Replace use of QQ_ALL_BACKENDS (#52574)

The quark attribute flag QQ_ALL_BACKENDS is being removed in future versions of go-quark. This removes its use from auditbeat.

Instead of using QQ_ALL_BACKENDS, consumers will be responsible for explicitly setting the backend to be used, and retrying with a different backend in case of failure. Now auditbeat will attempt eBPF first, then attempt kprobe if it fails; this is the same behaviour quark has with QQ_ALL_BACKENDS

(cherry picked from commit 6861354)

* auditbeat: adapt to quark 0.8 backend flags and since-boot times (#52623)

* auditbeat: adapt to quark 0.8 since-boot timestamps

quark 0.8 hands out Proc.TimeBoot and Exit.ExitTimeProcess as
nanoseconds since boot instead of since the epoch (quark CHANGES
0.7->0.8): without conversion, process.start and process.end would be
dated shortly after 1970. Convert with the new quark.TimeToWallclock()
everywhere they feed process.start and process.end, in both quark
providers. Emitted events are unchanged.

quark's boottime epoch, cached at quark_queue_open(), also moves when
the system clock is stepped (say NTP correcting a clock that was wrong
at boot), and keeping it fresh is the consumer's job. Both providers
call quark.UpdateBoottime() on their existing 5-second stats cadence:
it re-reads /proc/stat btime, which is stable between reads and only
moves on a step, and quark stores it only when it actually changed.
Corrections apply retroactively to anything translated afterwards.

The backend flag changes (QQ_ALL_BACKENDS removal) landed separately
in #52574.

go-quark is pinned to a pre-release of the 0.8 update
(elastic/go-quark#40) and will be bumped to the tagged release before
merging.

* auditbeat: pin go-quark to v0.8.0

* auditbeat: fix goimports alignment in quark test

(cherry picked from commit 7b4b565)

* auditbeat: update for quark 0.9 changes (#53284)

* auditbeat: update for quark 0.9 changes

* auditbeat: update go-quark to v0.9.0

* auditbeat: add fragment

* auditbeat: review feedback on quark 0.9 update

(cherry picked from commit 181205b)

Co-authored-by: Michael Wolf <michael.wolf@elastic.co>
Co-authored-by: Nicholas Berlin <56366649+nicholasberlin@users.noreply.github.com>
christos68k added a commit that referenced this pull request Nov 12, 2026
* [auditbeat] Replace use of QQ_ALL_BACKENDS (#52574)

The quark attribute flag QQ_ALL_BACKENDS is being removed in future versions of go-quark. This removes its use from auditbeat.

Instead of using QQ_ALL_BACKENDS, consumers will be responsible for explicitly setting the backend to be used, and retrying with a different backend in case of failure. Now auditbeat will attempt eBPF first, then attempt kprobe if it fails; this is the same behaviour quark has with QQ_ALL_BACKENDS

(cherry picked from commit 6861354)

* auditbeat: adapt to quark 0.8 backend flags and since-boot times (#52623)

* auditbeat: adapt to quark 0.8 since-boot timestamps

quark 0.8 hands out Proc.TimeBoot and Exit.ExitTimeProcess as
nanoseconds since boot instead of since the epoch (quark CHANGES
0.7->0.8): without conversion, process.start and process.end would be
dated shortly after 1970. Convert with the new quark.TimeToWallclock()
everywhere they feed process.start and process.end, in both quark
providers. Emitted events are unchanged.

quark's boottime epoch, cached at quark_queue_open(), also moves when
the system clock is stepped (say NTP correcting a clock that was wrong
at boot), and keeping it fresh is the consumer's job. Both providers
call quark.UpdateBoottime() on their existing 5-second stats cadence:
it re-reads /proc/stat btime, which is stable between reads and only
moves on a step, and quark stores it only when it actually changed.
Corrections apply retroactively to anything translated afterwards.

The backend flag changes (QQ_ALL_BACKENDS removal) landed separately
in #52574.

go-quark is pinned to a pre-release of the 0.8 update
(elastic/go-quark#40) and will be bumped to the tagged release before
merging.

* auditbeat: pin go-quark to v0.8.0

* auditbeat: fix goimports alignment in quark test

(cherry picked from commit 7b4b565)

* auditbeat: update for quark 0.9 changes (#53284)

* auditbeat: update for quark 0.9 changes

* auditbeat: update go-quark to v0.9.0

* auditbeat: add fragment

* auditbeat: review feedback on quark 0.9 update

(cherry picked from commit 181205b)
(cherry picked from commit a998fe3)

Co-authored-by: Christos Kalkanis <christos.kalkanis@elastic.co>
Co-authored-by: Michael Wolf <michael.wolf@elastic.co>
Co-authored-by: Nicholas Berlin <56366649+nicholasberlin@users.noreply.github.com>
@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 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.

5 participants