Collect kernel audit records in journald (#579)

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

Reviewed-on: #579
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
This commit was merged in pull request #579.
This commit is contained in:
2026-11-17 21:45:03 +11:00
committed by BenVincent
parent 42c4e41508
commit f6f93d855e
@@ -52,11 +52,21 @@ class victorialogs::client::journald (
enable => true,
subscribe => File['/etc/systemd/journal-upload.conf.d/victorialogs.conf'],
}
# EL drops the audit socket from journald's Sockets=; journald only takes listen fds at start
systemd::dropin_file { 'audit.conf':
unit => 'systemd-journald.service',
content => "[Service]\nSockets=systemd-journald-audit.socket\n",
}
}else{
file {'/etc/systemd/journal-upload.conf.d/victorialogs.conf':
ensure => absent,
}
systemd::dropin_file { 'audit.conf':
ensure => absent,
unit => 'systemd-journald.service',
}
}
}