A security event is a recorded action that matters for protecting a system: a login, a failed password, a command run as root, a new account. Most events are normal. Their value is that you can look back and answer who did what, and when.
Event, alert, incident
An event is something that happened. An alert flags an event, or a pattern of events, for attention. An incident is a confirmed problem that harms, or threatens, your system or data. One failed login is an event. Hundreds in a minute may raise an alert. Investigation decides whether there is an incident.
Where to look
Authentication messages are usually in /var/log/auth.log on Debian and Ubuntu, and /var/log/secure on Fedora and RHEL. Some minimal or newer installations have no such file and use only the systemd journal.
sudo journalctl --facility=auth,authpriv --since todayThis selects the two syslog facilities used for security and authorization messages. The --facility option needs a reasonably recent systemd.
Separate tools record other things. The Linux audit system can record file access and system calls. Applications keep their own logs.
What a useful record contains
Look for when (with time zone), where (host), who (user and source address), what (action) and the result.
Mar 3 09:14:02 web1 sshd[2211]: Failed password for alice from 203.0.113.9 port 51022 ssh2This traditional timestamp has no year or time zone. Newer setups often write ISO 8601 times instead. On newer OpenSSH versions the process name may appear as sshd-session.
Keep evidence trustworthy
Someone who gains root can edit local logs. Forward copies to a separate log server, limit who can read them, and keep clocks synchronised. timedatectl shows whether the clock is synchronised. Decide how long to keep records, and never log passwords or private keys.
Missing events matter too. A host that suddenly stops sending logs deserves a check.
Try it
On your own test machine, run sudo -k and then sudo true. Look at the authentication messages with the journalctl command above. Write down the when, who, what and result for one line. The streams and text lab helps you filter output.
Check your understanding
Security Events
All 4 sections · no timer
Unlimited retries
Questions from every section are combined into one assessment. Answer them all correctly to complete the article.
Your completion saves in this browser. Sign in to sync it to your account.