AUDITCTL(8) (NAME) auditctl - (SYNOPSIS) auditctl [] (DESCRIPTION) auditctl . (CONFIGURATION OPTIONS) -b backlog ( ) ( =64). (failure flag) . --backlog_wait_time wait_time ( : 60*HZ) auditd. . --reset_backlog_wait_time_actual . -c . . . -D (watches). (-k) . -e [0..2] . 0 . 1 . 2 . audit.rules . . . -f [0..2] (failure mode): 0=silent 1=printk 2=panic. . : . 1 . 2 . -h, --help -i . auditctl . -s . --loginuid-immutable loginuids . loginuids CAP_AUDIT_CONTROL . loginuid . -q mount-point,subtree bind move (mount) . . . -r rate (0=none). rate . 0 . --reset-lost . -R file auditctl file. . root . . '#' . auditctl . auditctl bash . <<>> . --signal signal . . : TERM, HUP, USR1, USR2, CONT : stop, reload, rotate, resume, state. -t (trim) mount. (STATUS OPTIONS) -l . : (-k) (-i) a0 a3 . -m text . CAP_AUDIT_WRITE ( root ). USER . -s . -e -f -r -b . pid . pid 0 . lost . backlog auditd . -i . -v auditctl. (RULE OPTIONS) -a [list,action|action,list] list action. . list,action action,list . list : task (per task list). -- fork() clone() . uid gid . exit (syscall exit list). . user . . : uid auid gid pid subj_user subj_role subj_type subj_sen subj_clr msgtype (executable name). . CAP_AUDIT_WRITE . never . exclude . . avc . (process ID) (user ID) (group ID) (login user ID) (message type) (subject context) . (action) "never" . filesystem . fstype . tracefs debugfs . io_uring io_uring. -S syscall . key . actions : never . . . always (audit context) . -A list,action list action. -C [f=f | f!=f] : . . -C . -F AND . : (=) (!=). : auid, uid, euid, suid, fsuid, obj_uid; and gid, egid, sgid, fsgid, obj_gid uid gid . obj_uid/gid . -d list,action list action. ( ) . -F [n=v | n!=v | nv | n<=v | n>=v | n&v | n&=v] : . . -F . ( -C) AND . : . AND AND . . . : a0, a1, a2, a3 . . . IPC . arch (CPU) . 'uname -m' . b32 arch . b64 . . x86_64 ppc . arch -S auditctl . auid ( audit uid). loginuid . . devmajor (Device Major Number). devminor (Device Minor Number). dir . . exit . -w . egid (Effective Group ID). . euid (Effective User ID). . exe . = != . . exit . errno . fsgid (Filesystem Group ID). . fstype . filesystem . : cgroup cgroup2 debugfs tracefs. fsuid (Filesystem User ID). . filetype . file dir socket link character block fifo . gid (Group ID). . inode Inode. key . . . . ausearch . (-D) (-l) . auditd . msgtype exclude user . obj_uid (Object's UID). obj_gid (Object's GID). obj_user SELinux (Resource's SE Linux User). obj_role SELinux (Resource's SE Linux Role). obj_type SELinux (Resource's SE Linux Type). obj_lev_low SELinux (Resource's SE Linux Low Level). obj_lev_high SELinux (Resource's SE Linux High Level). path path. (top level directory) . (Wildcards) . inode . exit . perm . : r=read w=write x=execute a=attribute change. . open . perm exit . . arch perm . arch . pers (OS Personality Number). pid (Process ID). ppid (Parent's Process ID). saddr_fam /usr/include/bits/socket.h . IPv4 IPv6 . sessionid (User's login session ID). subj_user SELinux (Program's SE Linux User). subj_role SELinux (Program's SE Linux Role). subj_type SELinux (Program's SE Linux Type). subj_sen SELinux (Program's SE Linux Sensitivity). subj_clr SELinux (Program's SE Linux Clearance). sgid (Saved Group ID). getresgid(2) . success >= 0 true/yes false/no . 1 true/yes 0 false/no . suid (Saved User ID). getresuid(2) . uid (User ID). . -k key . (watches) . . . -p [r|w|x|a] . . -S [Syscall name or number|all] name number . all . . . -S . . . ( x86_64) auditctl ( b64) . arch . . : arch b32 b64 . arch . -w path path. -F path . -F dir . -w . . -p -k . -W path path. . -d . (PERFORMANCE TIPS) . . . . : auditctl -a always,exit -F arch=b64 -S openat -F success=0 auditctl -a always,exit -F arch=b64 -S truncate -F success=0 : auditctl -a always,exit -F arch=b64 -S openat -S truncate -F success=0 . . open truncate /etc /usr /sbin : auditctl -a always,exit -F arch=b64 -S openat,truncate -F dir=/etc -F success=0 . . (EXAMPLES) : # By pid: auditctl -a always,exit -S all -F pid=1005 # By executable path auditctl -a always,exit -S all -F exe=/usr/bin/ls : auditctl -a always,exit -S openat -F auid=510 openat: auditctl -a always,exit -S openat -F success=0 ( ): auditctl -w /etc/shadow -p wa # Note this slows the system auditctl -a always,exit -F arch=b64 -F path=/etc/shadow -F perm=wa ( ): auditctl -w /etc/ -p wa # Note this slows the system auditctl -a always,exit -F arch=b64 -F dir=/etc/ -F perm=wa : auditctl -a always,exit -F dir=/home/ -F uid=0 -C auid!=obj_uid : # Remove all existing rules -D # Never record sudo invocations -A exclude,always -F exe=/usr/bin/sudo (DISABLED BY DEFAULT) auditd -a never,task . . . auditd 10-no-audit.rules 10-base-config.rules . auditctl -l never,task . (FILES) /etc/audit/audit.rules /etc/audit/audit-stop.rules (SEE ALSO) audit.rules(7), ausearch(8), aureport(8), auditd(8). (AUTHOR) Steve Grubb Red Hat AUDITCTL(8)