|
# Modern Linux Audit baseline |
|
# Intended for current 64-bit Debian- and RHEL-family systemd servers. |
|
# Add matching b32 syscall rules only where 32-bit userspace is intentionally supported. |
|
|
|
## Audit subsystem - protect audit configuration and record human access to audit logs. |
|
-a always,exit -F arch=b64 -F dir=/etc/audit/ -F perm=wa -F key=audit_config |
|
-a always,exit -F arch=b64 -F dir=/var/log/audit/ -F perm=r -F auid>=1000 -F auid!=unset -F key=audit_log_access |
|
|
|
|
|
## Identity - record changes to local users, groups, passwords, and login defaults. |
|
-a always,exit -F arch=b64 -F path=/etc/passwd -F perm=wa -F key=identity |
|
-a always,exit -F arch=b64 -F path=/etc/group -F perm=wa -F key=identity |
|
-a always,exit -F arch=b64 -F path=/etc/shadow -F perm=wa -F key=identity |
|
-a always,exit -F arch=b64 -F path=/etc/gshadow -F perm=wa -F key=identity |
|
-a always,exit -F arch=b64 -F path=/etc/login.defs -F perm=wa -F key=identity |
|
|
|
|
|
## PAM - record changes to authentication and account policy. |
|
-a always,exit -F arch=b64 -F dir=/etc/pam.d/ -F perm=wa -F key=pam_config |
|
-a always,exit -F arch=b64 -F dir=/etc/security/ -F perm=wa -F key=pam_config |
|
|
|
|
|
## SSH - record changes to ssh client/server configuration and drop-ins. |
|
-a always,exit -F arch=b64 -F dir=/etc/ssh/ -F perm=wa -F key=ssh_config |
|
|
|
|
|
## sudo - record sudo policy changes and human execution of privilege-transition tools. |
|
-a always,exit -F arch=b64 -F path=/etc/sudoers -F perm=wa -F key=sudo_config |
|
-a always,exit -F arch=b64 -F dir=/etc/sudoers.d/ -F perm=wa -F key=sudo_config |
|
-a always,exit -F arch=b64 -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=unset -F key=privilege_escalation |
|
-a always,exit -F arch=b64 -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=unset -F key=privilege_escalation |
|
-a always,exit -F arch=b64 -F path=/usr/bin/systemd-run -F perm=x -F auid>=1000 -F auid!=unset -F key=privilege_escalation |
|
|
|
|
|
## Privileged execution - tie root commands back to the original human login identity. |
|
-a always,exit -F arch=b64 -S execve,execveat -F euid=0 -F auid>=1000 -F auid!=unset -F key=human_root_exec |
|
|
|
## Alternate identities - catch human sessions executing as non-root service/user accounts. |
|
-a always,exit -F arch=b64 -S execve,execveat -F euid!=0 -F auid>=1000 -F auid!=unset -C euid!=auid -F key=human_alt_identity_exec |
|
|
|
|
|
## Shell persistence - record changes to system-wide interactive shell startup files. |
|
-a always,exit -F arch=b64 -F path=/etc/profile -F perm=wa -F key=shell_config |
|
-a always,exit -F arch=b64 -F dir=/etc/profile.d/ -F perm=wa -F key=shell_config |
|
|
|
|
|
## systemd - record administrator-created or modified units, timers, and overrides. |
|
-a always,exit -F arch=b64 -F dir=/etc/systemd/system/ -F perm=wa -F key=systemd_config |
|
|
|
|
|
## Host identity - record hostname/domain changes and persistent hostname configuration. |
|
-a always,exit -F arch=b64 -S sethostname,setdomainname -F key=host_identity |
|
-a always,exit -F arch=b64 -F path=/etc/hostname -F perm=wa -F key=host_identity |
|
-a always,exit -F arch=b64 -F path=/etc/hosts -F perm=wa -F key=host_identity |
|
|
|
|
|
## Time - record manual clock changes and timezone changes. |
|
-a always,exit -F arch=b64 -S adjtimex,settimeofday,clock_settime,clock_adjtime -F key=time_change |
|
-a always,exit -F arch=b64 -F path=/etc/localtime -F perm=wa -F key=time_change |
|
|
|
|
|
## Dynamic linker - record changes to system library search configuration. |
|
-a always,exit -F arch=b64 -F path=/etc/ld.so.conf -F perm=wa -F key=library_config |
|
-a always,exit -F arch=b64 -F dir=/etc/ld.so.conf.d/ -F perm=wa -F key=library_config |
|
|
|
|
|
## Kernel parameters - record persistent sysctl configuration changes. |
|
-a always,exit -F arch=b64 -F path=/etc/sysctl.conf -F perm=wa -F key=sysctl_config |
|
-a always,exit -F arch=b64 -F dir=/etc/sysctl.d/ -F perm=wa -F key=sysctl_config |
|
|
|
|
|
## Kernel modules - record persistent module policy and runtime module loading/unloading. |
|
-a always,exit -F arch=b64 -F dir=/etc/modprobe.d/ -F perm=wa -F key=module_config |
|
-a always,exit -F arch=b64 -F dir=/etc/modules-load.d/ -F perm=wa -F key=module_config |
|
-a always,exit -F arch=b64 -S init_module,finit_module,delete_module -F key=kernel_module |
|
|
|
|
|
## Mounts - record classic and modern mount namespace/filesystem mount operations. |
|
-a always,exit -F arch=b64 -S mount,umount2,move_mount,open_tree,fsopen,fsmount,fspick,mount_setattr -F key=mount |
|
|
|
|
|
## Special files - record creation of device nodes and other special filesystem objects. |
|
-a always,exit -F arch=b64 -S mknod,mknodat -F key=special_file |
|
|
|
|
|
## Kernel/power - record reboot and kexec operations. |
|
-a always,exit -F arch=b64 -S reboot,kexec_load,kexec_file_load -F key=power |
|
|
|
|
|
## Denied access - record human permission failures against system configuration. |
|
-a always,exit -F arch=b64 -S open,openat,openat2,creat -F dir=/etc/ -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=access_denied |
|
-a always,exit -F arch=b64 -S open,openat,openat2,creat -F dir=/etc/ -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=access_denied |