Skip to content
Lesson: Event CorrelationSwitch
← Security Operations

Security investigations

Event Correlation

Join records from different sources into one reliable timeline.

One log line rarely tells the whole story. Correlation means connecting related events, often from different sources, to see what happened.

Get the clocks right

Timelines depend on time. Keep hosts synchronised with NTP and check with timedatectl. Note each source's time zone. UTC avoids daylight saving confusion:

bash
journalctl --utc -o short-iso --since "2026-03-03 09:00" --until "2026-03-03 10:00"

The times given to --since and --until are read as local time unless you say otherwise, for example by adding UTC after the time.

Find shared keys

Link events through fields they have in common: user name, source address, host, process ID, session ID or a request ID. Be careful: process IDs are reused, many people can share one address, and a user name may mean different accounts on different hosts.

Build a timeline

Gather the lines and order them by time:

text
09:14:02Z web1 sshd: Failed password for alice from 203.0.113.9
09:14:09Z web1 sshd: Failed password for alice from 203.0.113.9
09:14:31Z web1 sshd: Accepted password for alice from 203.0.113.9
09:15:10Z web1 sudo: alice : COMMAND=/usr/sbin/useradd backup2

These lines are shortened for reading. Together they show failures, a success from the same address, then a new account. That deserves urgent checking. It is still not proof of an attack: Alice may have mistyped her password and created a planned account. Ask her and check the change records.

Simple rules

A correlation rule describes a pattern over a time window, for example "five failed logins followed by a success from one address within ten minutes". Tools can run such rules continuously. Test each one with safe, made up events. If a field is named differently from what the rule expects, the rule may silently match nothing.

Record your reasoning

Keep the original lines unchanged and work on copies. Write down what each event shows, what you infer, and what is still unknown. A missing log is a gap, not evidence that nothing happened.

Try it

On your own test machine, log in over SSH and then run sudo id. Collect both messages with the journalctl command above, adjusted to the current time, and write a three line timeline. For a troubleshooting exercise, try the alert that never fired.

Check your understanding

Event Correlation

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.