Installing Agent
Introduction
This article is a guide to demonstrate how to install auditbeat agent on your end-points to start ingesting logs to the SIEM. Auditbeat is a lightweight linux service, part of the Elastic Beats family, designed to ship linux event logs to OpenSearch.
Cybersift recommends only onboarding your corporate servers rather than all of your endpoints to prevent throttling your network.
Requirements
If your SIEM is on Cybersift Cloud, please let support know the public IP from which data will be sent.
Download Agent
Please navigate to Elastic Download page to get the latest audit beat agent depending on your operating system.
Configuration
After installation, replace the default
auditbeat.ymlconfig file with the provided configuration.
This following step is important since Auditbeat will not run
Important: Stop and disable the default
auditdprocess using the following commands:service stop auditdsystemctl disable auditdsystemctl restart auditbeat
Auditbeat Configuration
Important: Search and change the IP: “
192.168.1.1” to match the CyberSift SIEM IP address
auditbeat.modules:
- module: auditd
resolve_ids: true
failure_mode: silent
backlog_limit: 8196
rate_limit: 0
include_raw_message: false
include_warnings: false
audit_rules: |
# Self Auditing ---------------------------------------------------------------
## Audit the audit logs
### Successful and unsuccessful attempts to read information from the audit records
-w /var/log/audit/ -k auditlog
## Auditd configuration
### Modifications to audit configuration that occur while the audit collection functions are operating
-w /etc/audit/ -p wa -k auditconfig
-w /etc/libaudit.conf -p wa -k auditconfig
-w /etc/audisp/ -p wa -k audispconfig
## Monitor for use of audit management tools
-w /sbin/auditctl -p x -k audittools
-w /sbin/auditd -p x -k audittools
-w /usr/sbin/augenrules -p x -k audittools
# Filters ---------------------------------------------------------------------
### We put these early because audit is a first match wins system.
## Ignore SELinux AVC records
-a always,exclude -F msgtype=AVC
## Ignore current working directory records
-a always,exclude -F msgtype=CWD
## Ignore EOE records (End Of Event, not needed)
-a always,exclude -F msgtype=EOE
## Cron jobs fill the logs with stuff we normally don't want (works with SELinux)
-a never,user -F subj_type=crond_t
-a never,exit -F subj_type=crond_t
## This prevents chrony from overwhelming the logs
-a never,exit -F arch=b64 -S adjtimex -F auid=unset -F uid=chrony -F subj_type=chronyd_t
## This is not very interesting and wastes a lot of space if the server is public facing
-a always,exclude -F msgtype=CRYPTO_KEY_USER
## VMWare tools
-a never,exit -F arch=b32 -S fork -F success=0 -F path=/usr/lib/vmware-tools -F subj_type=initrc_t -F exit=-2
-a never,exit -F arch=b64 -S fork -F success=0 -F path=/usr/lib/vmware-tools -F subj_type=initrc_t -F exit=-2
### High Volume Event Filter (especially on Linux Workstations)
-a never,exit -F arch=b32 -F dir=/dev/shm -k sharedmemaccess
-a never,exit -F arch=b64 -F dir=/dev/shm -k sharedmemaccess
#-a never,exit -F arch=b32 -F dir=/var/lock/lvm -k locklvm
#-a never,exit -F arch=b64 -F dir=/var/lock/lvm -k locklvm
## More information on how to filter events
### https://access.redhat.com/solutions/2482221
# Rules -----------------------------------------------------------------------
## Kernel parameters
-w /etc/sysctl.conf -p wa -k sysctl
-w /etc/sysctl.d -p wa -k sysctl
## Kernel module loading and unloading
-a always,exit -F perm=x -F auid!=-1 -F path=/sbin/insmod -k modules -k T1215_Kernel_Modules_and_Extensions
-a always,exit -F perm=x -F auid!=-1 -F path=/sbin/modprobe -k modules -k T1215_Kernel_Modules_and_Extensions
-a always,exit -F perm=x -F auid!=-1 -F path=/sbin/rmmod -k modules -k T1215_Kernel_Modules_and_Extensions
-a always,exit -F arch=b64 -S finit_module -S init_module -S delete_module -F auid!=-1 -k modules -k T1215_Kernel_Modules_and_Extensions
-a always,exit -F arch=b32 -S finit_module -S init_module -S delete_module -F auid!=-1 -k modules -k T1215_Kernel_Modules_and_Extensions
## Modprobe configuration
-w /etc/modprobe.conf -p wa -k modprobe -k T1215_Kernel_Modules_and_Extensions
-w /etc/modprobe.d -p wa -k modprobe -k T1215_Kernel_Modules_and_Extensions
## KExec usage (all actions)
-a always,exit -F arch=b64 -S kexec_load -k KEXEC
-a always,exit -F arch=b32 -S sys_kexec_load -k KEXEC
## Special files
-a always,exit -F arch=b32 -S mknod -S mknodat -k specialfiles
-a always,exit -F arch=b64 -S mknod -S mknodat -k specialfiles
## Mount operations (only attributable)
-a always,exit -F arch=b64 -S mount -S umount2 -F auid>=500 -F auid!=4294967295 -k T1052_Exfiltration_Over_Physical_Medium -k mount
-a always,exit -F arch=b32 -S mount -S umount -S umount2 -F auid>=500 -F auid!=4294967295 -k T1052_Exfiltration_Over_Physical_Medium -k mount
## Change swap (only attributable)
-a always,exit -F arch=b64 -S swapon -S swapoff -F auid!=-1 -k swap
-a always,exit -F arch=b32 -S swapon -S swapoff -F auid!=-1 -k swap
### Local time zone
-w /etc/localtime -p wa -k localtime -k T1099_Timestomp
## Stunnel
-w /usr/sbin/stunnel -p x -k stunnel -k T1079_Multilayer_Encryption
-w /usr/bin/stunnel -p x -k stunnel -k T1079_Multilayer_Encryption
## Cron configuration & scheduled jobs
-w /etc/cron.allow -p wa -k cron -k T1168_Local_Job_Scheduling
-w /etc/cron.deny -p wa -k cron -k T1168_Local_Job_Scheduling
-w /etc/cron.d/ -p wa -k cron -k T1168_Local_Job_Scheduling
-w /etc/cron.daily/ -p wa -k cron -k T1168_Local_Job_Scheduling
-w /etc/cron.hourly/ -p wa -k cron -k T1168_Local_Job_Scheduling
-w /etc/cron.monthly/ -p wa -k cron -k T1168_Local_Job_Scheduling
-w /etc/cron.weekly/ -p wa -k cron -k T1168_Local_Job_Scheduling
-w /etc/crontab -p wa -k cron -k T1168_Local_Job_Scheduling
-w /var/spool/cron/ -k cron -k T1168_Local_Job_Scheduling
-w /etc/inittab -p wa -k T1168_Local_Job_Scheduling
-w /etc/init.d/ -p wa -k T1168_Local_Job_Scheduling
-w /etc/init/ -p wa -k T1168_Local_Job_Scheduling
-w /etc/at.allow -p wa -k T1168_Local_Job_Scheduling
-w /etc/at.deny -p wa -k T1168_Local_Job_Scheduling
-w /var/spool/at/ -p wa -k T1168_Local_Job_Scheduling
-w /etc/anacrontab -p wa -k T1168_Local_Job_Scheduling
## User, group, password databases
-w /etc/group -p wa -k etcgroup
-w /etc/passwd -p wa -k etcpasswd
-w /etc/gshadow -k etcgroup
-w /etc/shadow -k etcpasswd
-w /etc/security/opasswd -k opasswd
## Sudoers file changes
-w /etc/sudoers -p wa -k actions -k T1078_Valid_Accounts
-w /etc/sudoers.d/ -p wa -k actions -k T1078_Valid_Accounts
## Passwd
-w /usr/bin/passwd -p x -k passwd_modification -k T1078_Valid_Accounts
## Tools to change group identifiers
-w /usr/sbin/groupadd -p x -k group_modification -k T1078_Valid_Accounts
-w /usr/sbin/groupmod -p x -k group_modification -k T1078_Valid_Accounts
-w /usr/sbin/addgroup -p x -k group_modification -k T1078_Valid_Accounts
-w /usr/sbin/useradd -p x -k user_modification -k T1078_Valid_Accounts
-w /usr/sbin/userdel -p x -k user_modification -k T1078_Valid_Accounts
-w /usr/sbin/usermod -p x -k user_modification -k T1078_Valid_Accounts
-w /usr/sbin/adduser -p x -k user_modification -k T1078_Valid_Accounts
## Data Copy(Local)
-w /usr/bin/dd -p x -k T1005_Data_from_Local_System
## AF_ALG socket creation by unprivileged login users.
-a always,exit -F arch=b64 -S socket -k af_alg
-a always,exit -F arch=b32 -S socket -k af_alg
# Suspicious splice usage by real users
-a always,exit -F arch=b64 -S splice -k splice_usage
-a always,exit -F arch=b32 -S splice -k splice_usage
## Login configuration and information
-w /etc/login.defs -p wa -k login
-w /etc/securetty -p wa -k login
-w /var/log/faillog -p wa -k login -k T1021_Remote_Services
-w /var/log/lastlog -p wa -k login -k T1021_Remote_Services
-w /var/log/tallylog -p wa -k login -k T1021_Remote_Services
## Network Environment
### Changes to hostname
-a always,exit -F arch=b32 -S sethostname -S setdomainname -k network_modifications
-a always,exit -F arch=b64 -S sethostname -S setdomainname -k network_modifications
##C2 Releated Events
#Log 64 bit processes (a2!=6e filters local unix socket calls)
-a exit,always -F arch=b64 -S connect -F a2!=110 -k T1043_Commonly_Used_Port
#Log 32 bit processes (a0=3 means only outbound sys_connect calls)
-a exit,always -F arch=b32 -S socketcall -F a0=3 -k T1043_Commonly_Used_Port
### Changes to other files
-w /etc/hosts -p wa -k network_modifications
-w /etc/sysconfig/network -p wa -k network_modifications
-w /etc/sysconfig/network-scripts -p w -k network_modifications
-w /etc/network/ -p wa -k network
-a always,exit -F dir=/etc/NetworkManager/ -F perm=wa -k network_modifications
### Changes to issue
-w /etc/issue -p wa -k etcissue
-w /etc/issue.net -p wa -k etcissue
## System startup scripts
-w /etc/inittab -p wa -k init
-w /etc/init.d/ -p wa -k init
-w /etc/init/ -p wa -k init
## Library search paths
-w /etc/ld.so.conf -p wa -k libpath
-w /etc/ld.so.conf.d -p wa -k libpath
## Systemwide library preloads (LD_PRELOAD)
-w /etc/ld.so.preload -p wa -k systemwide_preloads
## Pam configuration
-w /etc/pam.d/ -p wa -k pam -k T1071_Standard_Application_Layer_Protocol
-w /etc/security/limits.conf -p wa -k pam -k T1071_Standard_Application_Layer_Protocol
-w /etc/security/limits.d -p wa -k pam -k T1071_Standard_Application_Layer_Protocol
-w /etc/security/pam_env.conf -p wa -k pam -k T1071_Standard_Application_Layer_Protocol
-w /etc/security/namespace.conf -p wa -k pam -k T1071_Standard_Application_Layer_Protocol
-w /etc/security/namespace.d -p wa -k pam -k T1071_Standard_Application_Layer_Protocol
-w /etc/security/namespace.init -p wa -k pam -k T1071_Standard_Application_Layer_Protocol
-w /etc/pam.d/common-password -p wa -k T1201_Password_Policy_Discovery
## Mail configuration
-w /etc/aliases -p wa -k mail
-w /etc/postfix/ -p wa -k mail
-w /etc/exim4/ -p wa -k mail
## SSH configuration
-w /etc/ssh/sshd_config -k sshd -k T1021_Remote_Services
-w /etc/ssh/sshd_config.d -k sshd -k T1021_Remote_Services
## root ssh key tampering
-w /root/.ssh -p wa -k rootkey
# Systemd
-w /bin/systemctl -p x -k systemd
-w /etc/systemd/ -p wa -k systemd
## SELinux events that modify the system's Mandatory Access Controls (MAC)
-w /etc/selinux/ -p wa -k mac_policy
## Critical elements access failures
-a always,exit -F arch=b64 -S open -F dir=/etc -F success=0 -k unauthedfileaccess
-a always,exit -F arch=b64 -S open -F dir=/bin -F success=0 -k unauthedfileaccess
-a always,exit -F arch=b64 -S open -F dir=/sbin -F success=0 -k unauthedfileaccess
-a always,exit -F arch=b64 -S open -F dir=/usr/bin -F success=0 -k unauthedfileaccess
-a always,exit -F arch=b64 -S open -F dir=/usr/sbin -F success=0 -k unauthedfileaccess
-a always,exit -F arch=b64 -S open -F dir=/var -F success=0 -k unauthedfileaccess
-a always,exit -F arch=b64 -S open -F dir=/home -F success=0 -k unauthedfileaccess
-a always,exit -F arch=b64 -S open -F dir=/srv -F success=0 -k unauthedfileaccess
## Process ID change (switching accounts) applications
-w /bin/su -p x -k priv_esc -k T1169_Sudo
-w /usr/bin/sudo -p x -k priv_esc -k T1169_Sudo
-w /etc/sudoers -p rw -k priv_esc -k T1169_Sudo
-w /etc/sudoers.d -p rw -k priv_esc -k T1169_Sudo
## Power state
-w /sbin/shutdown -p x -k power
-w /sbin/poweroff -p x -k power
-w /sbin/reboot -p x -k power
-w /sbin/halt -p x -k power
## Session initiation information
-w /var/run/utmp -p wa -k session -k T1108_Redundant_Access
-w /var/log/btmp -p wa -k session -k T1108_Redundant_Access
-w /var/log/wtmp -p wa -k session -k T1108_Redundant_Access
## Discretionary Access Control (DAC) modifications
-a always,exit -F arch=b32 -S chmod -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S chown -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S fchmod -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S fchmodat -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S fchown -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S fchownat -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S fremovexattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S fsetxattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S lchown -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S lremovexattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S lsetxattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S removexattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S setxattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S chmod -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S chown -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S fchmod -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S fchmodat -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S fchown -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S fchownat -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S fremovexattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S fsetxattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S lchown -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S lremovexattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S lsetxattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S removexattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S setxattr -F auid>=1000 -F auid!=-1 -k perm_mod -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S setuid -S setgid -S setreuid -S setregid -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S setuid -S setgid -S setreuid -S setregid -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b64 -S setuid -S setgid -S setreuid -S setregid -F exit=EPERM -k T1166_Seuid_and_Setgid
-a always,exit -F arch=b32 -S setuid -S setgid -S setreuid -S setregid -F exit=EPERM -k T1166_Seuid_and_Setgid
# Special Rules ---------------------------------------------------------------
## Reconnaissance
-w /usr/bin/whoami -p x -k recon
-w /usr/bin/id -p x -k recon
-w /bin/hostname -p x -k recon
-w /bin/uname -p x -k recon
-w /etc/issue -p r -k recon
-w /etc/hostname -p r -k recon
## Suspicious activity
-w /usr/bin/wget -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /usr/bin/curl -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /usr/bin/base64 -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /bin/nc -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /bin/netcat -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /usr/bin/ncat -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /usr/bin/ssh -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /usr/bin/scp -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /usr/bin/sftp -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /usr/bin/ftp -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /usr/bin/socat -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /usr/bin/wireshark -p x -k susp_activity
-w /usr/bin/tshark -p x -k susp_activity
-w /usr/bin/rawshark -p x -k susp_activity
-w /usr/bin/rdesktop -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /usr/bin/nmap -p x -k susp_activity
## Added to catch netcat on Ubuntu
-w /bin/nc.openbsd -p x -k susp_activity -k T1219_Remote_Access_Tools
-w /bin/nc.traditional -p x -k susp_activity -k T1219_Remote_Access_Tools
## Recon Related Events
-w /etc/group -p wa -k T1087_Account_Discovery
-w /etc/passwd -p wa -k TT1087_Account_Discovery
-w /etc/gshadow -k T1087_Account_Discovery
-w /etc/shadow -k T1087_Account_Discovery
-w /etc/security/opasswd -k T1087_Account_Discovery
-w /usr/sbin/nologin -k T1087_Account_Discovery
-w /sbin/nologin -k T1087_Account_Discovery
-w /usr/bin/whoami -p x -k T1033_System_Owner_User_Discovery
-w /etc/hostname -p r -k T1082_System_Information_Discovery
-w /sbin/iptables -p x -k T1082_System_Information_Discovery
-w /sbin/ifconfig -p x -k T1082_System_Information_Discovery
-w /etc/login.defs -p wa -k T1082_System_Information_Discovery
-w /etc/resolv.conf -k T1016_System_Network_Configuration_Discovery
-w /etc/hosts.allow -k T1016_System_Network_Configuration_Discovery
-w /etc/hosts.deny -k T1016_System_Network_Configuration_Discovery
-w /etc/securetty -p wa -k T1082_System_Information_Discovery
-w /var/log/faillog -p wa -k T1082_System_Information_Discovery
-w /var/log/lastlog -p wa -k T1082_System_Information_Discovery
-w /var/log/tallylog -p wa -k T1082_System_Information_Discovery
-w /usr/sbin/tcpdump -p x -k T1049_System_Network_Connections_discovery
-w /usr/sbin/traceroute -p x -k T1049_System_Network_Connections_discovery
-w /usr/bin/wireshark -p x -k T1049_System_Network_Connections_discovery
-w /usr/bin/rawshark -p x -k T1049_System_Network_Connections_discovery
-w /usr/bin/grep -p x -k T1081_Credentials_In_Files
-w /usr/bin/egrep -p x -k T1081_Credentials_In_Files
-w /usr/bin/ps -p x -k T1057_Process_Discovery
## dbus-send invocation
### may indicate privilege escalation CVE-2021-3560
-w /usr/bin/dbus-send -p x -k dbus_send
## Injection
### These rules watch for code injection by the ptrace facility.
### This could indicate someone trying to do something bad or just debugging
-a always,exit -F arch=b32 -S ptrace -F a0=0x4 -k code_injection -k T1055_Process_Injection
-a always,exit -F arch=b64 -S ptrace -F a0=0x4 -k code_injection -k T1055_Process_Injection
-a always,exit -F arch=b32 -S ptrace -F a0=0x5 -k data_injection -k T1055_Process_Injection
-a always,exit -F arch=b64 -S ptrace -F a0=0x5 -k data_injection -k T1055_Process_Injection
-a always,exit -F arch=b32 -S ptrace -F a0=0x6 -k register_injection -k T1055_Process_Injection
-a always,exit -F arch=b64 -S ptrace -F a0=0x6 -k register_injection -k T1055_Process_Injection
-a always,exit -F arch=b32 -S ptrace -k tracing
-a always,exit -F arch=b64 -S ptrace -k tracing
## Privilege Abuse
### The purpose of this rule is to detect when an admin may be abusing power by looking in user's home dir.
-a always,exit -F dir=/home -F uid=0 -F auid>=1000 -F auid!=-1 -C auid!=obj_uid -k power_abuse
# Software Management ---------------------------------------------------------
# RPM (Redhat/CentOS)
-w /usr/bin/rpm -p x -k software_mgmt -k T1072_third_party_software
-w /usr/bin/yum -p x -k software_mgmt -k T1072_third_party_software
# DNF (Fedora/RedHat 8/CentOS 8)
-w /usr/bin/dnf -p x -k software_mgmt -k T1072_third_party_software
# YAST/Zypper/RPM (SuSE)
-w /sbin/yast -p x -k software_mgmt -k T1072_third_party_software
-w /sbin/yast2 -p x -k software_mgmt -k T1072_third_party_software
-w /bin/rpm -p x -k software_mgmt -k T1072_third_party_software
-w /usr/bin/zypper -k software_mgmt -k T1072_third_party_software
# DPKG / APT-GET (Debian/Ubuntu)
-w /usr/bin/dpkg -p x -k software_mgmt -k T1072_third_party_software
-w /usr/bin/apt -p x -k software_mgmt -k T1072_third_party_software
-w /usr/bin/apt-add-repository -p x -k software_mgmt -k T1072_third_party_software
-w /usr/bin/apt-get -p x -k software_mgmt -k T1072_third_party_software
-w /usr/bin/aptitude -p x -k software_mgmt -k T1072_third_party_software
-w /usr/bin/wajig -p x -k software_mgmt -k T1072_third_party_software
-w /usr/bin/snap -p x -k software_mgmt -k T1072_third_party_software
# PIP (Python installs)
-w /usr/bin/pip -p x -k software_mgmt -k T1072_third_party_software
-w /usr/bin/pip3 -p x -k software_mgmt -k T1072_third_party_software
# Special Software ------------------------------------------------------------
## GDS specific secrets
#-w /etc/puppet/ssl -p wa -k puppet_ssl
## IBM Bigfix BESClient
#-a always,exit -F arch=b64 -S open -F dir=/opt/BESClient -F success=0 -k soft_besclient
#-w /var/opt/BESClient/ -p wa -k soft_besclient
## CHEF https://www.chef.io/chef/
#-w /etc/chef -p wa -k soft_chef
## Docker
#-w /usr/bin/dockerd -k docker
#-w /usr/bin/docker -k docker
#-w /usr/bin/docker-containerd -k docker
#-w /usr/bin/docker-runc -k docker
#-w /var/lib/docker -k docker
#-w /etc/docker -k docker
#-w /etc/sysconfig/docker -k docker
#-w /etc/sysconfig/docker-storage -k docker
#-w /usr/lib/systemd/system/docker.service -k docker
## Kubelet
#-w /usr/bin/kubelet -k kubelet
# High Volume Events ----------------------------------------------------------
## Remove them if they cause to much volume in your environment
## Root command executions
-a always,exit -F arch=b64 -F euid=0 -S execve -k rootcmd -k T1078_Valid_Accounts
-a always,exit -F arch=b32 -F euid=0 -S execve -k rootcmd -k T1078_Valid_Accounts
## Privleged Command Execution Related Events
-a exit,always -F arch=b64 -F euid=0 -S execve -k T1078_Valid_Accounts
-a exit,always -F arch=b32 -F euid=0 -S execve -k T1078_Valid_Accounts
-a always,exit -F path=/usr/sbin/userdel -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/bin/umount -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/bin/mount -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/bin/su -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/bin/chgrp -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/sbin/pam_timestamp_check -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/sbin/unix_chkpwd -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/sbin/pwck -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/sbin/suexec -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/sbin/newusers -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/sbin/groupdel -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/sbin/semanage -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/sbin/usernetctl -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/sbin/ccreds_validate -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/sbin/userhelper -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/Xorg -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/rlogin -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/at -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/rsh -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/kgrantpty -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/staprun -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/rcp -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/chfn -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/newrole -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
-a always,exit -F path=/usr/bin/kpac_dhcp_helper -F perm=x -F auid>=500 -F auid!=4294967295 -k T1078_Valid_Accounts
## File Deletion Events by User
-a always,exit -F arch=b32 -S rmdir -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=-1 -k delete -k T1107_File_Deletion
-a always,exit -F arch=b64 -S rmdir -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=-1 -k delete -k T1107_File_Deletion
## File Access
### Unauthorized Access (unsuccessful)
-a always,exit -F arch=b32 -S creat -S open -S openat -S open_by_handle_at -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=-1 -k file_access
-a always,exit -F arch=b32 -S creat -S open -S openat -S open_by_handle_at -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=-1 -k file_access
-a always,exit -F arch=b64 -S creat -S open -S openat -S open_by_handle_at -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=-1 -k file_access
-a always,exit -F arch=b64 -S creat -S open -S openat -S open_by_handle_at -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=-1 -k file_access
### Unsuccessful Creation
-a always,exit -F arch=b32 -S creat,link,mknod,mkdir,symlink,mknodat,linkat,symlinkat -F exit=-EACCES -k file_creation
-a always,exit -F arch=b64 -S mkdir,creat,link,symlink,mknod,mknodat,linkat,symlinkat -F exit=-EACCES -k file_creation
-a always,exit -F arch=b32 -S link,mkdir,symlink,mkdirat -F exit=-EPERM -k file_creation
-a always,exit -F arch=b64 -S mkdir,link,symlink,mkdirat -F exit=-EPERM -k file_creation
## Shell configuration Persistence Related Events
-w /etc/profile.d/ -k T1156_bash_profile_and_bashrc
-w /etc/profile -k T1156_bash_profile_and_bashrc
-w /etc/shells -k T1156_bash_profile_and_bashrc
-w /etc/bashrc -k T1156_bash_profile_and_bashrc
-w /etc/csh.cshrc -k T1156_bash_profile_and_bashrc
-w /etc/csh.login -k T1156_bash_profile_and_bashrc
### Unsuccessful Modification
-a always,exit -F arch=b32 -S rename -S renameat -S truncate -S chmod -S setxattr -S lsetxattr -S removexattr -S lremovexattr -F exit=-EACCES -k file_modification
-a always,exit -F arch=b64 -S rename -S renameat -S truncate -S chmod -S setxattr -S lsetxattr -S removexattr -S lremovexattr -F exit=-EACCES -k file_modification
-a always,exit -F arch=b32 -S rename -S renameat -S truncate -S chmod -S setxattr -S lsetxattr -S removexattr -S lremovexattr -F exit=-EPERM -k file_modification
-a always,exit -F arch=b64 -S rename -S renameat -S truncate -S chmod -S setxattr -S lsetxattr -S removexattr -S lremovexattr -F exit=-EPERM -k file_modification
## 32bit API Exploitation
### If you are on a 64 bit platform, everything _should_ be running
### in 64 bit mode. This rule will detect any use of the 32 bit syscalls
### because this might be a sign of someone exploiting a hole in the 32
### bit API.
-a always,exit -F arch=b32 -S all -k 32bit_api
- module: file_integrity
paths:
- /bin
- /usr/bin
- /sbin
- /usr/sbin
- /etc
- /opt
exclude_files:
- '(?i)\.sw[nop]