-
Notifications
You must be signed in to change notification settings - Fork 230
Description
See also systemd/systemd#15921
Is your feature request related to a problem? Please describe.
Currently auditd stores separate logs in /var/log/audit. I'd like to discontinue using auditd for logging (but not for other audit control) and use only systemd-journald logs also for ausearch etc. ausearch is able to read logs also from standard input. The output format of journalctl is quite similar to format of /var/log/audit/audit.log and traditional format used by syslogd, but ausearch does not understand it.
Describe the solution you'd like
Enhance audit tools (especially ausearch) to understand some existing journalctl output format (for example syslog/short-unix or JSON). This could be useful even when not using journald. For example, /var/log/audit/* might be damaged or lost but other logs (syslog, journal etc) could contain same information.
Describe alternatives you've considered
- Postprocess journalctl output to match audit.log (no changes required to journalctl or audit tools):
# journalctl -b _TRANSPORT=audit --output=short-unix | awk '{ print "type="$4" msg=audit("$1") " $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17 }' | ausearch -r
----
type=SERVICE_START msg=audit(1590476099.070000) pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=modprobe@rfkill comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
- Add new
auditformat forjournalctlwhich can be directly read by audit tools, for example:journalctl -b --output=audit | ausearch.
So, this record from journalctl --output=short-unix
1590476099.070000 loora audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=modprobe@rfkill comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
should be printed when --output=audit is specified in the format in /var/log/audit/audit.log:
type=SERVICE_START msg=audit(1590476099.070:34): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=modprobe@rfkill comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
- Perhaps (some) search options of
ausearchcould be easily implemented also injournalctl. But format compatibility between journalctl and audit tools would still be needed in order to use the other audit tools likeaudit2allowto process SELinux AVC denials. Reimplementingaudit2allowbyjournalctldoes not seem to make sense.
As requested by the issue form, I created an account on Red Hat Bugzilla to report this but unfortunately I wasn't able to find the right product.