The alert says 40 failed SSH logins against one host in six minutes. Most analysts open it, see "brute force", and close it as blocked. That is the wrong half of the log to read.
Failed attempts are noise. The line that decides the ticket is what came after them.
Step one: who is knocking
On a Debian-style box the failures sit in /var/log/auth.log. Count them by source address:
grep 'Failed password' /var/log/auth.log | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn On a line ending from 203.0.113.5 port 52114 ssh2, the fourth field from the end is the address. One address with 40 hits is a scanner. Ten addresses with four hits each is someone trying to stay under a lockout threshold, which is a different story.
Step two: did anyone get in
Take the top address and look for a success:
grep 'Accepted' /var/log/auth.log | grep 203.0.113.5 No Accepted line from that address means the alert was noise, and you can write that down in one sentence. An Accepted password for line after a run of failures means the guessing worked. Now the ticket is an incident, and the timestamps tell you how long that account has been in someone else's hands.
One caveat: Accepted can also be a legitimate admin who mistyped a password a few times. Check whether the address belongs to a known jump host or VPN range before you escalate. If it does, the ticket is a user-support note. If the address is unfamiliar, treat it as compromised until shown otherwise.
Also check which auth method the success used. Accepted publickey after a flood of password failures is odd, because the attacker was guessing passwords but got in with a key. That points to a stolen key or a different path in, and the failures were a distraction.
Step three: what did the account do next
Look at the same user's lines after the login: sudo entries, new sessions, useradd, authorized_keys changes. A successful login followed by a sudo to root inside a minute is a very different ticket from a login that sits idle.
Write down the order you found things in. A handover that says "40 failures, then one success from the same address at 02:14, then sudo at 02:15" lets the next analyst act without redoing your work.
Practise it before the real alert
The free Linux authentication logs lab on Codelivly walks through an auth.log where a ticketed sudo grant ended up as full root, which is the same habit of reading what happened after the noisy part.
For the whole loop, the SOC Analyst Level 1 playbook covers a 6-step triage loop, the Big Five alert playbooks and SIEM mechanics. Codelivly's Black Friday sale, up to 70% off selected books and bundles, ends 1 Dec 2026. The product page shows whether it applies to this one.