Linux Audit System

auditd, auditctl rules, ausearch, aureport, and using audit logs for forensic investigation.

Overview

The Linux Audit System is a kernel-level event logging framework that records security-relevant events with high fidelity — far beyond what traditional application logs capture. Every syscall, file access, user authentication event, and privilege escalation can be recorded with full context: who did it (UID, PID, process name), what they did, and when.

Architecture

The audit system has two layers, one in the kernel and one in user space.

The kernel audit subsystem intercepts system calls and file accesses according to rules. Events that match are written to an in-kernel buffer, where they wait for the daemon.

The auditd daemon reads from that kernel buffer over a netlink socket and writes events to /var/log/audit/audit.log (the default), or forwards them to a remote audit server via audisp. Splitting the work this way keeps the kernel side fast: it only filters and queues, and the daemon does the slower writing.

Key concepts

  • auditd
  • auditctl
  • ausearch
  • aureport
  • -k key
  • /etc/audit/rules.d/

Interview questions

  • A critical file /etc/sudoers was modified. How do you use auditd to find out who did it and when?
  • How do you set up persistent audit rules that survive reboots?

Sign up free to read the full topic

More Linux topics

Start free on Cariara · Coding problems · System design studio