ausearch builds one event from several lines. The main one is SYSCALL: it holds both the process and the user (all fields).
commandexe— the short name and full path of the program that reached the file (heresed);uid— which user the process ran as (the effective user);auid— who logged in and started the chain (the login uid). For a service started at bootauid=unset: the system started it, with no person logged in. For an action by a logged-in user (via console, ssh or cron)auidis their name.
ppid in the event is the parent process. By it you see who started the program: ps -o unit= -p <ppid> names the service. That is how you get from a write to a file to the service or task that does it.
In the audit event for the /etc/hosts edit there is auid=unset, uid=root, comm="sed". What does this say about who changed the file?
-
A logged-in person's action would have
auidas their name, notunset.unsetmeans a service, not a login, started it. -
The event has
comm,exe,uidandppid— enough to name the program and traceppidto the service. -
auid=unsetis not a name but the absence of a login uid: no logged-in person started the chain. There would be a name if someone logged in via console, ssh or cron.
auid=unset means a boot-time service started the chain, not a logged-in person; comm/uid name the sed program as root. ppid shows what started it.
Key points
-
ausearchbuilds an event from lines; the main one,SYSCALL, holds the process and the user. -
comm/exeare the program,uidis the effective user,auidis who logged in (unsetfor a boot-time service). -
ppidleads to the parent:ps -o unit= -p <ppid>names the service that reached the file.