Table of Contents
autrace runs a command under the Linux Audit framework and records events for that execution. Use it in a disposable test VM with an empty audit ruleset. It requires exclusive use of the ruleset, so use existing audit records or strace when the host already has audit rules.

Trace a command in a test VM
Check that the Linux Audit tools are installed, that auditd is active, and that sudo auditctl -l shows no configured rules. If rules are present, leave them in place and use another machine or another tool. The autrace manual describes the ruleset requirement.
systemctl is-active auditd
sudo auditctl -l
sudo autrace "$(command -v df)" -h
Run the final command only after the checks succeed. It starts a new df process and reports the PID to search for. With auditd active, the default audit log is usually /var/log/audit/audit.log, though local configuration can change it.
Audit and trace screenshots from the original walkthrough



Read events and summarize files
Replace 12345 with the PID that autrace reports. Limiting the search to recent events helps avoid confusing this run with older records that have the same PID.
sudo ausearch --start recent -p 12345 -i
sudo ausearch --start recent -p 12345 --raw | aureport --file --summary
-i interprets numeric audit fields for reading. --raw passes records in the format aureport expects. For a narrower resource-use trace, use autrace -r with the target command on the test system.
Event search and file report screenshots





If the system has existing audit rules, search the events already collected. For a short, authorized syscall trace that doesn’t change the audit ruleset, use strace on a command you start yourself. See the Linux service and log troubleshooting lesson for choosing between service logs and deeper tracing.
Reader Comments 0
Sign in with email or Google to join the discussion.