Skip to content

RFE: accept input format compatible with other logging systems Β #130

@topimiettinen

Description

@topimiettinen

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

  1. 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' 
  1. Add new audit format for journalctl which 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'
  1. Perhaps (some) search options of ausearch could be easily implemented also in journalctl. But format compatibility between journalctl and audit tools would still be needed in order to use the other audit tools like audit2allow to process SELinux AVC denials. Reimplementing audit2allow by journalctl does 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions