Collect kernel audit records in journald #579

Merged
benvin merged 4 commits from benvin/journald-audit into develop 2026-11-17 21:45:03 +11:00
Member

EL drops systemd-journald-audit.socket from journald's Sockets=, so kernel audit records never reach the journal or the victorialogs upload. journald only picks up listen fds at start, so the drop-in needs a restart to apply.

  • add a systemd-journald drop-in listing the audit socket when journald upload is enabled
  • remove the drop-in when upload is disabled
  • restart journald on drop-in add or removal via the drop-in notifying the service puppet-systemd already manages
EL drops systemd-journald-audit.socket from journald's Sockets=, so kernel audit records never reach the journal or the victorialogs upload. journald only picks up listen fds at start, so the drop-in needs a restart to apply. - add a systemd-journald drop-in listing the audit socket when journald upload is enabled - remove the drop-in when upload is disabled - restart journald on drop-in add or removal via the drop-in notifying the service puppet-systemd already manages
unkin-agent added 1 commit 2026-11-16 22:32:42 +11:00
Collect kernel audit records in journald
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
cc191ffe67
Add a systemd-journald drop-in pulling in systemd-journald-audit.socket and restart journald on change so audit events ship to VictoriaLogs.
Author
Member
  • nit: modules/victorialogs/manifests/client/journald.pp:57 — the else (disable) branch removes the upload conf but leaves audit.conf behind → add ensure => absent for the drop-in there, or move the drop-in out of the enable conditional if audit-in-journal is meant to be unconditional.
- nit: modules/victorialogs/manifests/client/journald.pp:57 — the `else` (disable) branch removes the upload conf but leaves `audit.conf` behind → add `ensure => absent` for the drop-in there, or move the drop-in out of the `enable` conditional if audit-in-journal is meant to be unconditional.
unkin-agent added 1 commit 2026-11-16 22:36:21 +11:00
Remove journald audit drop-in when disabled
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was canceled
ci/woodpecker/pr/puppet-validate Pipeline was canceled
b007206051
Author
Member
  • modules/victorialogs/manifests/client/journald.pp:71 — disable branch removes the drop-in but Service['systemd-journald'] only exists in the enable branch, so dropin_file's notify collector matches nothing: journald keeps the audit fd (and systemd-journald-audit.socket stays active) until reboot → declare service {'systemd-journald': ensure => running} outside the if/else (or in both branches), and stop systemd-journald-audit.socket on disable.
  • PR body — "restart systemd-journald when the drop-in changes" holds only for the enable branch → fix the code per above or state that disable needs a manual restart.
- modules/victorialogs/manifests/client/journald.pp:71 — disable branch removes the drop-in but `Service['systemd-journald']` only exists in the enable branch, so dropin_file's notify collector matches nothing: journald keeps the audit fd (and systemd-journald-audit.socket stays active) until reboot → declare `service {'systemd-journald': ensure => running}` outside the if/else (or in both branches), and stop `systemd-journald-audit.socket` on disable. - PR body — "restart systemd-journald when the drop-in changes" holds only for the enable branch → fix the code per above or state that disable needs a manual restart.
unkin-agent added 1 commit 2026-11-16 22:38:18 +11:00
restart journald when the audit drop-in is added or removed
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
c61081708c
Author
Member
  • modules/victorialogs/manifests/client/journald.pp:73 — service {'systemd-journald':} duplicates the one declared by systemd::journald (puppet-systemd 8.1.0, systemd::manage_journald defaults true, not overridden in hieradata; systemd::dropin_file does include systemd in both branches) → catalog compile fails on every host via profiles::base. Delete the block; the dropin_file collector already notifies the existing Service['systemd-journald'] with daemon-reload ordered before it.
  • PR body — third bullet ("manage the systemd-journald service") is wrong once the block is removed → replace with: the restart comes from puppet-systemd's existing journald service via the drop-in notify.
- modules/victorialogs/manifests/client/journald.pp:73 — `service {'systemd-journald':}` duplicates the one declared by `systemd::journald` (puppet-systemd 8.1.0, `systemd::manage_journald` defaults true, not overridden in hieradata; `systemd::dropin_file` does `include systemd` in both branches) → catalog compile fails on every host via profiles::base. Delete the block; the dropin_file collector already notifies the existing `Service['systemd-journald']` with daemon-reload ordered before it. - PR body — third bullet ("manage the systemd-journald service") is wrong once the block is removed → replace with: the restart comes from puppet-systemd's existing journald service via the drop-in notify.
unkin-agent added 1 commit 2026-11-16 22:45:39 +11:00
drop duplicate systemd-journald service; puppet-systemd manages it
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
6a0179db85
benvin merged commit f6f93d855e into develop 2026-11-17 21:45:03 +11:00
benvin deleted branch benvin/journald-audit 2026-11-17 21:45:04 +11:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/puppet-prod#579