systemctl status auditdChecks the current operational status of the audit daemon service.
The Linux Audit daemon: records system calls, file access and command execution according to rules, for compliance and detection.
sudo apt install auditdsystemctl status auditdChecks the current operational status of the audit daemon service.
systemctl start auditdStarts the audit daemon if it is currently stopped.
systemctl stop auditdStops the audit daemon service completely.
systemctl restart auditdRestarts the audit daemon to reload configurations.
systemctl enable auditdEnables the audit daemon to start automatically at system boot.
service auditd rotateForces the rotation of audit log files immediately.
service auditd resumeResumes logging after auditd was suspended due to disk space issues.
auditctl -sDisplays the current status, variables, and settings of the kernel audit system.
auditctl -e 1Enables the audit system if it has been disabled.
auditctl -e 0Temporarily disables the audit system and stops logging.
auditctl -e 2Locks the audit configuration so it cannot be changed until reboot.
auditctl -b 8192Increases the audit buffer size to 8192 messages to prevent loss.
auditctl -f 1Sets failure mode to print a message to syslog on critical errors.
auditctl -f 2Sets failure mode to trigger a kernel panic on critical errors.
auditctl -r 0Disables the rate limit for generated audit messages.
auditctl -w /etc/passwd -p wa -k passwd_changesWatches /etc/passwd for write or attribute changes and tags with key.
auditctl -w /etc/shadow -p wa -k shadow_accessWatches /etc/shadow for write or attribute changes.
auditctl -w /bin/bash -p x -k shell_execLogs every execution of the bash binary.
auditctl -w /etc/sudoers -p wa -k sudo_modMonitors the sudoers file for unauthorized modifications.
auditctl -W /etc/passwdRemoves the watch rule specifically for /etc/passwd.
auditctl -a always,exit -F arch=b64 -S openat -k file_openAudits the openat syscall on 64-bit architecture upon exit.
auditctl -a always,exit -F arch=b64 -S execve -k process_spawnAudits process creation via execve on 64-bit systems.
auditctl -a always,exit -F arch=b64 -S unlink -S rmdir -k deletionAudits file and directory deletion events.
auditctl -a always,exit -F arch=b64 -S chmod -S fchmod -S chown -k perm_modAudits changes to file permissions or ownership.
auditctl -a always,exit -F arch=b64 -S mount -S umount2 -k storage_mountAudits mounting and unmounting of filesystems.
auditctl -a always,exit -F arch=b64 -S settimeofday -S clock_settime -k time_changeAudits attempts to change the system time.
auditctl -a always,exit -F arch=b64 -S init_module -S delete_module -k kernel_modAudits loading and unloading of kernel modules.
auditctl -a always,exit -F arch=b64 -S all -F auid=1001 -k user_monitorAudits all syscalls made by the user with Audit UID 1001.
auditctl -a always,exit -F arch=b64 -S execve -F uid=0 -k root_execAudits command execution attempted by the root user.
auditctl -a always,exit -F arch=b64 -S all -F gid=100 -k group_monitorAudits all actions performed by members of GID 100.
auditctl -a always,exit -F arch=b64 -S execve -F euid=0 -k effective_rootAudits executions where the effective user ID is root.
auditctl -a always,exit -F arch=b64 -S connect -k net_connectAudits outgoing network connection attempts.
auditctl -a always,exit -F arch=b64 -S accept -k net_acceptAudits incoming network connection acceptances.
auditctl -a always,exit -F arch=b64 -S bind -k net_bindAudits attempts to bind a socket to a local address or port.
ausearch -m USER_LOGINSearches logs for user login events.
ausearch -m USER_AUTHSearches logs for authentication attempts.
ausearch -m SYSCALL -sv noSearches for system call events that failed.
ausearch -ua 1000Searches for events triggered by the user with UID 1000.
ausearch -k passwd_changesSearches for events tagged with the key 'passwd_changes'.
ausearch -f /etc/shadowSearches for any events related to the file /etc/shadow.
ausearch -p 1234Searches for events generated by process ID 1234.
ausearch -ts todaySearches for events that occurred today.
ausearch -ts recentSearches for events that occurred in the last 10 minutes.
ausearch -ts 08:00:00 -te 17:00:00Searches for events between 8 AM and 5 PM today.
ausearch -tm pts/0Searches for events originating from terminal pts/0.
ausearch -i -k shell_execSearches for 'shell_exec' events and interprets numeric IDs to names.
ausearch -x /usr/bin/passwdSearches for execution events of the passwd binary.
ausearch -c httpdSearches for events generated by the command name 'httpd'.
ausearch --rawOutputs search results in raw format suitable for parsing.
aureportGenerates a general summary report of all audit events.
aureport -auGenerates a report of all authentication attempts.
aureport -lGenerates a report of all login events.
aureport -pGenerates a report of process related events.
aureport -fGenerates a report of all file related events.
aureport -uGenerates a report summarizing events by user.
aureport -sGenerates a report summarizing system call events.
aureport -tGenerates a report of events by log time range.
aureport -cGenerates a report of configuration change events.
aureport -mGenerates a report of account modification events.
aureport -xGenerates a report of executable execution events.
aureport --failedGenerates a summary report of only failed events.
aureport --successGenerates a summary report of only successful events.
aureport -ts yesterday -te todayGenerates a report covering events from yesterday to today.
aureport -u -iGenerates a user summary report with numeric IDs resolved to names.
auditctl -a always,exit -F arch=b64 -S ptrace -k tracingAudits attempts to trace processes (often used by debuggers or malware).
auditctl -a always,exit -F arch=b64 -S mknod -S mknodat -k special_filesAudits creation of special device files.
auditctl -a always,exit -F arch=b64 -S rename -S renameat -k file_renameAudits file renaming operations.
auditctl -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time_modificationAudits advanced time adjustment syscalls.
auditctl -a always,exit -F arch=b64 -S swapon -S swapoff -k swap_modAudits enabling or disabling of swap space.
auditctl -w /var/log/audit/ -p wa -k audit_log_tamperingWatches the audit log directory itself for tampering attempts.
auditctl -w /sbin/insmod -p x -k module_insertionWatches the insmod binary for execution.
auditctl -w /sbin/rmmod -p x -k module_removalWatches the rmmod binary for execution.
ausearch -k net_connect | aureport -f -iFinds network connection events and reports which files (sockets) were accessed.
ausearch -ul 1000 -m USER_LOGIN -iInvestigates all login events for a specific user ID.
ausearch -k passwd_changes -ts today | aureport -u -iIdentifies which users modified password files today.
ausearch -m PROCTITLE -iSearches for events containing process title information (command line args).
ausearch -k root_exec -i | grep ' /bin/bash'Filters root execution logs specifically for bash shells.
auditctl -s | grep 'enabled'Validates that the audit service is currently enabled.
ausearch -m DAEMON_ABORTChecks logs for instances where the audit daemon crashed or aborted.
ausearch -m ANOM_PROMISCUOUSSearches for network interfaces entering promiscuous mode (sniffing).
ausearch -m ANOM_ABENDSearches for applications that terminated abnormally (segfaults).
ausearch -f /root/.ssh/authorized_keys -iMonitors access to root SSH keys for unauthorized persistence.
auditctl -a always,exit -F arch=b64 -S fchown -S fchownat -k ownership_changeCompliance rule to track all file ownership changes.
auditctl -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -k attr_modCompliance rule to track extended attribute modifications.
auditctl -w /var/log/tallylog -p wa -k loginsMonitors the tallylog file for failed login attempt tracking.
auditctl -w /etc/group -p wa -k group_modMonitors the group file for changes to user groups.
auditctl -w /etc/issue -p wa -k banner_modMonitors changes to the system login banner.
ausearch --start recent -m EXECVE -i | grep 'nc -e'Hunts for recent executions of netcat reverse shells.
ausearch -f /tmp -i | grep 'EXECVE'Investigates any binaries executed from the /tmp directory.
ausearch -f /dev/shm -iChecks for suspicious file activity in shared memory (malware staging).
ausearch -k kernel_mod -iChecks for unauthorized kernel module loading (rootkits).
ausearch -m USER_CMD -i --failedReviews failed sudo commands to detect privilege escalation attempts.
ausearch -ts today -m LOGIN -F success=noLists all failed login attempts from the current day.
ausearch -k deletion -i | grep '/var/log'Detects attempts to delete log files to cover tracks.
auditctl -a always,exit -F arch=b64 -S socket -F a0=2 -k ipv4_socketAudits creation of IPv4 sockets specifically.
auditctl -a always,exit -F arch=b64 -S socket -F a0=10 -k ipv6_socketAudits creation of IPv6 sockets specifically.
auditctl -a always,exit -F dir=/home -F uid=0 -C auid!=obj_uid -k admin_home_accessAudits root accessing home directories not belonging to them.
auditctl -a always,exit -F arch=b64 -S execve -F exe=/usr/bin/wget -k suspicious_downloadSpecifically audits execution of wget.
auditctl -a always,exit -F arch=b64 -S execve -F exe=/usr/bin/curl -k suspicious_downloadSpecifically audits execution of curl.
auditctl -a always,exit -F arch=b64 -S execve -F exe=/usr/bin/ncat -k reverse_shell_toolAudits ncat execution, often used for reverse shells.
sh -c 'auditctl -R /etc/audit/audit.rules'Manually reloads rules from the legacy audit.rules file.
grep -i 'backlog' /var/log/syslogChecks system logs for audit backlog limit exceeded warnings.
auditctl -m 'Audit checkpoint: System update started'Injects a custom text message into the audit log for marking events.
aureport --summaryProvides a high-level statistical summary of all audit events.
ausearch -te now -ts recent -i | aureport -fPipelines recent logs into a file access report.
ausearch -k deletion | aureport -f -iReports exactly which files were deleted based on the deletion key.
ausearch -m AVC -iSearches for SELinux Access Vector Cache denials.
ausearch -m USER_TTY -iSearches for TTY (terminal) allocation events.
auditctl -a always,exit -F arch=b64 -S clone -S fork -S vfork -k process_forkAudits all process forking methods.
auditctl -a always,exit -F arch=b64 -S kill -k process_killAudits the kill syscall to track process termination signals.
auditctl -a always,exit -F arch=b64 -S ptrace -F a0=4 -k process_injectionAudits PTRACE_POKETEXT/DATA calls, indicative of code injection.
auditctl -a always,exit -F arch=b64 -S memfd_create -k memory_execAudits creation of memory file descriptors, used by fileless malware.
auditctl -a always,exit -F arch=b64 -S prctl -k process_controlAudits process control operations.
sed -i 's/immutable = 0/immutable = 1/' /etc/audit/auditd.confConfigures auditd to start in immutable mode via config file.
grep 'max_log_file' /etc/audit/auditd.confChecks the maximum size of a single audit log file.
grep 'max_log_file_action' /etc/audit/auditd.confChecks what action auditd takes when a log file fills up.
grep 'space_left_action' /etc/audit/auditd.confChecks action taken when disk space is running low.
grep 'admin_space_left_action' /etc/audit/auditd.confChecks action taken when disk space is critically low.
ausearch -k user_monitor -ts today -te 12:00:00Filters user monitor events for the morning session only.
ausearch -m CRYPTO_KEY_USERSearches for events related to cryptographic key usage.
ausearch -m SERVICE_START -iSearches for service start events.
ausearch -m SERVICE_STOP -iSearches for service stop events.
auditctl -a always,exit -F arch=b64 -S unshare -k container_creationAudits namespace unsharing, often used in container creation.
auditctl -a always,exit -F arch=b64 -S setns -k container_entryAudits entry into an existing namespace (container exec).
auditctl -a always,exit -F arch=b64 -S pivot_root -k container_pivotAudits pivoting of the root filesystem.
ausearch -ts today -m AVC --raw | audit2allowPipes raw AVC denials to audit2allow to generate SELinux policies.
aureport --input /var/log/audit/audit.log.1Generates a report from a rotated (archived) log file.
ausearch -if /var/log/audit/audit.log.1 -m LOGINSearches for login events within a specific rotated log file.
Exposes the operating system as a SQL database: query processes, users, ports, packages and more across Linux, macOS and Windows.
Microsoft Sysinternals System Monitor: logs process creation, network connections, file changes and more to the Windows (and Linux) event log.
Queries the systemd journal: logs by service, boot, time range, priority and more.
Watches log files for repeated failures — SSH, web logins, mail — and bans offending IPs with firewall rules.
The endpoint agent for the open-source Wazuh SIEM/XDR: log collection, file-integrity monitoring and vulnerability detection.