Course contentsShow
← Security
Lesson 2318 of 3,05245. Security Operations and MonitoringFree lesson

Correlation Rules and Detection Logic

Writing rules that connect multiple events across time and systems to detect complex attack patterns and anomalies.

Correlation Rules and Detection Logic

You'll learn how security teams write rules that connect multiple events over time and across different systems to spot sophisticated attacks that single logs can't reveal.


The Core Idea

Individual security events rarely tell the complete story. A single failed login might be a typo. But five failed logins from different geographic locations in ten minutes, followed by a successful login and immediate privilege escalation, paints a very different picture.

Correlation rules are the detective logic that connects these dots. They define conditions where multiple events—potentially from different sources and timestamps—match patterns indicating malicious behavior. Your SIEM (which you learned collects and normalizes logs) executes these rules continuously, searching for suspicious sequences.

How Correlation Works

Think of it like a recipe with ingredients arriving at different times. The rule says: "If condition A happens, then watch for condition B within X minutes from source Y, and condition C occurs with matching user ID, then trigger an alert."

For example:

  • Event 1: User account locked (from Active Directory)
  • Event 2: Same username attempts VPN login from new country (from VPN logs)
  • Event 3: Successful admin login to sensitive server (from server logs)
  • Time window: All within 15 minutes

A correlation rule connects these normalized events by matching the username field, checking the time relationships, and recognizing this sequence as a potential account compromise.

Detection Logic Components

Effective rules typically include:

  • Field matching (user ID, IP address, hostname)
  • Temporal relationships (within X seconds/minutes)
  • Thresholds (more than N occurrences)
  • Whitelists/blacklists (exclude known-good sources)
  • Stateful tracking (remembering past events)

Key Takeaway: Correlation rules transform isolated log events into meaningful threat narratives by defining the logical relationships, timing, and patterns that reveal complex attacks your SIEM couldn't detect from single events alone.