Skip to content

03 Threat Detection

Welcome to:

Module 03 — Threat Detection

In the previous module, you learned how enterprise SOC teams collect and monitor security telemetry from:

Identity
Endpoints
Networks
Cloud
Applications
Email
SaaS

Now you will learn how to turn that telemetry into:

Detections

A detection is not simply:

A SIEM Rule

A strong detection connects:

Threat Behavior
Relevant Telemetry
Detection Logic
Alert
Investigation

The goal of this module is to help you understand not only:

How to Write
a Detection

but:

Why the Detection
Should Exist
What Threat
It Addresses
Which Evidence
It Requires
How to Validate It
How to Improve It

By the end of this module, you will understand how to:

  • explain the purpose of threat detection.

  • distinguish prevention from detection.

  • understand detection engineering fundamentals.

  • identify detection use cases.

  • connect attacker behavior to telemetry.

  • distinguish IOCs from behavioral indicators.

  • understand signature-based detection.

  • understand behavior-based detection.

  • understand threshold-based detection.

  • understand correlation-based detection.

  • understand anomaly detection.

  • understand sequence-based detection.

  • understand identity detections.

  • understand endpoint detections.

  • understand network detections.

  • understand cloud detections.

  • understand email detections.

  • map detections to MITRE ATT&CK.

  • build detection coverage matrices.

  • understand detection logic.

  • understand detection fields and conditions.

  • understand rule thresholds and time windows.

  • understand alert severity and confidence.

  • understand false positives.

  • understand false negatives.

  • understand benign true positives.

  • tune detection rules.

  • validate detections.

  • test detections safely.

  • identify telemetry dependencies.

  • identify detection gaps.

  • measure detection quality.

  • document detection use cases professionally.

Threat detection is the process of identifying activity that may indicate:

Attack
Compromise
Abuse
Policy Violation
Suspicious Behavior

Threat detection attempts to answer:

Is Something
Potentially Malicious
Happening?

Prevention tries to stop an attack.

Examples:

MFA
Firewall
Application Control
Least Privilege

Detection tries to identify:

Suspicious
or
Malicious Activity

Examples:

Impossible Travel
Credential Dumping
Suspicious PowerShell
Malicious Domain Access

The relationship is:

Prevent
Where Possible
Detect
What Prevention
May Miss

A detection can be viewed as:

If This
Behavior Occurs
It May Indicate
This Threat

Example:

IF
A User Has
20 Failed Logins
FOLLOWED BY
A Successful Login
WITHIN
5 Minutes
THEN
Investigate
Potential Credential Attack

Remember:

Detection Match
Alert

but:

Alert
Confirmed Attack

The alert still requires investigation.

A detection should begin with a:

Use Case

A good detection use case explains:

What Threat
Are We Trying
to Detect?

Example:

Detect Potential
Privileged Account
Compromise

A professional use case may contain:

Use Case ID
Threat Scenario
MITRE ATT&CK
Required Telemetry
Detection Logic
Severity
Confidence
Investigation Steps
Known False Positives
Validation Method

Do not begin with:

Which Logs
Do We Have?

Begin with:

What Threat
Do We Need
to Detect?

Then identify:

What Would
That Threat
Look Like?

Then:

Which Telemetry
Would Show It?

Use:

Threat Scenario
Attacker Behavior
Required Telemetry
Observable Events
Detection Logic
Alert
Validation
Tuning

Threat:

Credential
Compromise

Behavior:

Repeated
Authentication Failure
Successful Login
Privilege Change

Telemetry:

Identity Logs
MFA Logs
Privilege Events

Detection:

Failures
+
Success
+
Privilege Change

IOCs may include:

IP Address
Domain
Hash
URL
File Name
Registry Value

Example:

Known Malicious
SHA-256 Hash

Conceptually:

IF
File Hash
=
Known Malicious Hash
THEN
Generate Alert

Advantages:

Simple
Precise
Fast

Limitations:

Easy for
Attackers to Change

Indicators may become obsolete.

Example:

Attacker Uses
IP A Today
IP B Tomorrow

Therefore:

Old IOC
Current Threat

Behavior detections identify:

What the
Attacker Is Doing

instead of only:

Which Artifact
They Use

Example:

Office Application
PowerShell
Network Download

Attackers can change:

Hash
IP
Domain
File Name

but may still need to:

Execute
Persist
Escalate
Dump Credentials
Move Laterally
Exfiltrate

Behavior-based detection focuses on those actions.

Signature detection matches known patterns.

Examples:

Malware Signature
Exploit Pattern
Known Network Sequence

Best for:

Known
Threat Patterns

Threshold detections identify:

Unusual Volume

Example:

More Than
25 Failed Logins
Within
5 Minutes

A threshold should consider:

Normal Behavior
User Type
Asset Type
Environment
Business Process

A threshold that works for:

Employee Account

may not work for:

Service Account

Correlation combines multiple events.

Example:

Failed Login
+
Successful Login
+
New MFA Method

within a defined period.

Sequence detection evaluates:

Order

of activity.

Example:

Phishing Email
Suspicious Login
Mailbox Rule Creation

Order adds context.

Anomaly detection identifies behavior that differs from a baseline.

Examples:

New Country
New Device
Rare Process
Unusual Data Volume
Unexpected Login Time

Remember:

Anomalous
Malicious

A user may legitimately:

Travel
Change Device
Work Late
Transfer Large Files

Risk-based detection combines multiple low-confidence signals.

Example:

New Country
+20 Risk
MFA Denials
+30 Risk
New Admin Role
+50 Risk

Total:

100

may trigger a higher-priority alert.

A detection may have:

Low
Medium
High

confidence.

Example:

Known malware hash:

High Confidence

Rare process execution:

Lower Confidence

depending on context.

These are different.

Severity asks:

How Bad
Could This Be?

Confidence asks:

How Strongly
Does the Evidence
Suggest the Threat?

Example:

Potential Domain
Admin Compromise

may be:

Severity:
Critical
Confidence:
Medium

Identity detections may monitor:

Failed Logins
Successful Logins
MFA
Role Changes
New Accounts
Password Resets
Session Activity

Password spray typically involves:

One or Few
Passwords
Against
Many Accounts

Possible logic:

Same Source IP
Many Users
Authentication Failures
Short Time Window

Brute force may involve:

Many Password Attempts
Against
One Account

Possible logic:

Same User
Multiple Failures
Short Time Window

Credential stuffing uses:

Previously
Stolen Credentials

against multiple services or users.

Detection may require:

Authentication Pattern
IP Reputation
Device Context
Failure / Success Pattern

Conceptually:

User Login
Country A
10 Minutes Later
User Login
Country B

Potential alert:

Impossible Travel

But check:

VPN
Proxy
Mobile Network
GeoIP Error

Potential pattern:

MFA Denied
MFA Denied
MFA Denied
MFA Approved

within a short period.

Questions:

Was User
Expecting Login?
Which Device?
Which Source IP?
What Happened
After Approval?

A high-value detection:

User
Added to
Privileged Group

Investigate:

Who Made Change?
Was It Approved?
Which User?
Which System?
What Happened Next?

Potential detection:

Account
Not Used
for 90 Days
Successful Login

This may indicate:

Account Abuse
Return from Leave
Service Change

Context required.

Endpoint detections analyze:

Processes
Command Lines
Files
Registry
Services
Network Connections
User Behavior

PowerShell itself is legitimate.

Detection should focus on behavior such as:

Encoded Command
Download Cradle
Hidden Execution
Unusual Parent Process
Credential Access

Example:

winword.exe
powershell.exe

may be suspicious.

Another:

excel.exe
cmd.exe

may also deserve investigation.

A process may be suspicious because:

It Rarely
Runs

in the environment.

But rare does not automatically mean malicious.

Potential signals:

LSASS Access
Credential Tool Execution
Suspicious Memory Access
Known Dumping Commands

This is usually high-value activity.

Monitor:

Scheduled Tasks
Services
Startup Locations
Registry Run Keys
New Accounts
Cloud Persistence

Potential logic:

New Scheduled Task
Created by
Unusual User
Running
Suspicious Command

Attackers may create services for:

Persistence
Execution
Lateral Movement

Monitor:

New Service
Binary Path
Creator
Target System

Signals include:

Executable
Written to
Temporary Directory
Script Created
in Startup Folder
Known Malicious Hash

Network detections may analyze:

IP
Domain
Port
Protocol
Bytes
Session Duration
Connection Frequency

Potential C2 indicators:

Periodic Beaconing
Rare Domain
Known Malicious IP
Long-Lived Connection
Unusual Protocol

Beaconing may appear as:

Endpoint
Same Destination
Regular Interval

Example:

Every 60 Seconds

This pattern can be suspicious.

Potential detections:

Known Malicious Domain
Newly Registered Domain
High-Entropy Subdomain
Large DNS Volume
DNS Tunneling Pattern

Potential indicators:

Long DNS Queries
High Query Volume
Encoded-Looking Subdomains
Unusual Record Types

Potential signals:

Large Outbound Transfer
Rare Destination
Unusual Time
Sensitive System
New External Service

Examples:

Repeated Blocked Connections
Unexpected Inbound Access
Connection to Known C2
High-Risk Port Exposure

Cloud detections may monitor:

IAM
API Calls
Storage
Network
Compute
Security Services

Possible indicators:

API Calls
from New Country
Unusual User Agent
New Access Key
Privilege Escalation
Multiple Services Accessed

High-value detection:

Audit Logging
Disabled

This may indicate:

Defense Evasion
Administrative Change
Troubleshooting

Investigation required.

Example:

Storage Resource
Changed
Public Access Enabled

Investigate:

Who Changed It?
Was It Approved?
What Data?
Was It Accessed?
How Long?

Potential events:

Admin Role Assigned
Policy Modified
Access Key Created
Permission Boundary Changed

Monitor:

New IAM User
New Service Principal
New Access Key
New Role

especially in:

Production

Detect:

EDR Disabled
Logging Disabled
Security Agent Stopped
Cloud Security Service Disabled

These may indicate:

Defense Evasion

Email detections may analyze:

Sender
Headers
URLs
Attachments
Authentication
Delivery
Mailbox Actions

Potential indicators:

Spoofed Domain
Suspicious URL
Malicious Attachment
Failed DMARC
Lookalike Domain

Possible signals:

Suspicious Login
New Inbox Rule
External Forwarding
Unusual Payment Request
Mailbox Search

Attackers may create rules to:

Hide Messages
Forward Messages
Delete Alerts

Detect:

New Rule
Rule Modification
External Forwarding

Application detections may monitor:

Admin Actions
Authentication
Bulk Export
Privilege Changes
API Calls
Sensitive Transactions

Potential logic:

User Downloads
100,000 Records
When Normal
Daily Activity
Is 500

This may require context.

Potential patterns:

SQL Injection
Path Traversal
Command Injection
Web Shell
Repeated Exploit Attempts

A single:

HTTP 404

is normal.

Thousands of unusual requests across:

Many Paths

may indicate scanning.

Each detection should map to relevant ATT&CK techniques where appropriate.

Example:

Detection:
Suspicious PowerShell
ATT&CK:
Execution
Command and
Scripting Interpreter

ATT&CK mapping supports:

Coverage Analysis
Threat Modeling
Purple Team Testing
Detection Prioritization
Reporting

Do not map every detection to:

10 Techniques

just because words seem similar.

Map:

Actual Behavior
the Detection
Can Observe

Create:

ATT&CK Technique Telemetry Detection Status
Credential Dumping Endpoint LSASS access Covered
PowerShell Endpoint Suspicious PowerShell Covered
Account Discovery Endpoint None Gap
Cloud Account Creation Cloud New IAM user Covered

68 — Coverage Does Not Equal Effectiveness

Section titled “68 — Coverage Does Not Equal Effectiveness”

A detection may exist.

But:

Rule Exists
Rule Works

You need:

Validation

A detection usually contains:

Fields
Conditions
Threshold
Time Window
Exclusions
Severity

Example authentication fields:

User
Source IP
Destination
Result
Country
Device
MFA Status
Timestamp

Example:

result = failure

is one condition.

A more useful detection may combine:

result = failure
AND
account_type = privileged

Many detections need:

Time Context

Example:

15 Failures
Within
5 Minutes

Time windows dramatically affect rule behavior.

A detection may group events by:

User
Source IP
Host
Device
Destination

Example:

Count Failures
By User

versus:

Count Failures
By Source IP

detects different attack patterns.

Some activity may be expected.

Example:

Known Vulnerability
Scanner

might generate large connection volumes.

You may exclude it.

But exclusions must be:

Documented
Specific
Reviewed

Avoid:

Exclude All
Administrator Activity

This could hide real attacks.

Tuning aims to improve:

Signal
to
Noise

Possible tuning:

Threshold Change
Scope Change
Known-Benign Exclusion
Asset Context
Identity Context
Sequence Logic
Risk Weighting

A false positive occurs when:

Detection
Alerts
Incorrectly

Example:

Legitimate backup activity triggers an exfiltration rule.

The detection accurately identifies suspicious behavior.

But the behavior is:

Authorized

Example:

Red team credential dump during approved testing.

A false negative occurs when:

Malicious Activity
Occurs
but
No Detection
Alerts

These are especially important because:

You May
Never Know
They Happened

A false negative may occur because:

Telemetry Missing
Rule Missing
Rule Incorrect
Threshold Too High
Exclusion Too Broad
Attack Technique Different

Every important detection should be tested.

Validation asks:

Does the
Required Behavior
Generate Telemetry?
Does the
Detection Match?
Does the
Alert Contain
Useful Context?
Simulate Behavior
Generate Telemetry
Collect Telemetry
Parse Event
Detection Executes
Alert Generated
SOC Receives Alert

Testing should occur in:

Authorized
Controlled
Approved

environments.

Do not simulate potentially disruptive activity against unauthorized systems.

A positive test checks:

Does Malicious-Like
Behavior Trigger
the Detection?

A negative test checks:

Does Normal
Behavior Avoid
Unnecessary Alerting?

Both matter.

Create:

Test Case
Expected Telemetry
Expected Detection
Expected Alert
Observed Result
Pass / Fail

If simulation produces logs but no alert:

Telemetry Exists
Detection Failed

Investigate:

Parsing
Query Logic
Threshold
Time Window
Rule Status

If simulation occurs but required telemetry does not exist:

Detection Cannot
Work Reliably

The problem is:

Telemetry Coverage

not only rule logic.

Create:

Detection_Use_Case.md

with:

Use Case ID
Detection Name
Threat Scenario
MITRE ATT&CK
Telemetry
Logic
Severity
Confidence
Investigation Steps
False Positives
Validation Method
Owner
Status

Every detection should have:

Owner
Reviewer
Review Date

Otherwise detections may become outdated.

Threat Need
Design
Build
Test
Deploy
Monitor
Tune
Review
Retire

Track:

Rule Version
Logic Change
Reason
Date
Reviewer

especially when tuning changes detection behavior.

Changing:

Threshold
10
100

may reduce alerts.

But it may also:

Create
False Negatives

A good detection should be:

Relevant
Reliable
Actionable
Explainable
Testable
Maintainable

An alert should provide enough information for the analyst to begin.

Useful fields may include:

User
Host
IP
Timestamp
Process
Detection Reason
Severity
Related Events

Avoid alerts that only say:

Suspicious Activity
Detected

without context.

Precision asks:

Of the Alerts
Generated
How Many
Are Useful?

Conceptually, recall asks:

Of the Threat
Activity That Occurred
How Much
Did We Detect?

High precision with very low recall may still miss important threats.

Too sensitive:

Many Alerts
Many False Positives

Too strict:

Few Alerts
Potential False Negatives

The goal is balance.

Prioritize detections based on:

Threat Likelihood
Business Impact
Asset Criticality
Attack Stage
Existing Coverage
Incident History

Examples:

Privileged Access
Identity
Credential Theft
Persistence
Lateral Movement
Cloud IAM
Security Control Disablement
Data Exfiltration

Detection programs can accumulate:

Old Rules
Broken Rules
Duplicate Rules
High-Noise Rules
Unused Rules

This creates:

Detection Debt

Periodically review:

Alert Volume
True Positives
False Positives
Rule Usage
Last Triggered
Telemetry Dependency
ATT&CK Mapping

Retire rules when:

Technology Removed
Threat No Longer Relevant
Rule Replaced
Data Source Removed

but preserve history where required.

A detection gap exists when:

Threat Behavior
Telemetry Exists
No Detection

A telemetry gap exists when:

Threat Behavior
Required Event
Not Available

A broader visibility gap may involve:

Asset Not Monitored
Platform Not Integrated
Logs Missing
Retention Insufficient

Not every ATT&CK technique needs equal priority.

Use:

Threat Relevance
Environment
Assets
Business Risk
Attack History

Threat-informed defense asks:

Which Threats
Actually Matter
to Our Organization?

Then focuses detection coverage accordingly.

Threat intelligence may help identify:

Campaign
Malware
Infrastructure
Techniques
Targets

You can translate this into:

Detection Requirements

111 — Detection From Threat Intelligence

Section titled “111 — Detection From Threat Intelligence”

Example:

Threat report says attackers:

Use PowerShell
Create Scheduled Tasks
Access LSASS

Detection team can review coverage for:

PowerShell
Scheduled Tasks
Credential Dumping

Incidents are valuable detection sources.

After an incident ask:

What Did
the Attacker Do?
Which Telemetry
Captured It?
Which Alerts
Triggered?
What Did
We Miss?
Incident
Attack Timeline
Detection Gaps
New Rules
Validation
Improved Coverage

Threat hunts may uncover:

Undetected
Behavior

That hunt can become:

New Detection

Purple team exercises answer:

Can Our
Defenses Detect
This Technique?

Workflow:

Simulate Technique
Observe Telemetry
Check Detection
Investigate Alert
Improve Rule

Do not ask only:

Can I Write
a Query?

Ask:

What Threat
Does This Detect?
Which Telemetry
Does It Depend On?
What Will
the Analyst See?
How Will
We Validate It?
How Could
an Attacker Avoid It?

Practical Exercise 1 — Detection Use Case

Section titled “Practical Exercise 1 — Detection Use Case”

Create:

DET-001
Privileged Account
Compromise

Document:

Threat Scenario
Telemetry
Detection Logic
ATT&CK Mapping
Severity
False Positives
Investigation Steps

Design a detection using:

Source IP
Multiple Accounts
Failed Logins
Time Window

Explain why grouping only by:

User

may fail to detect password spraying.

Create logic for:

Multiple MFA Denials
Successful MFA

within a defined window.

Document possible benign scenarios.

Practical Exercise 4 — Suspicious PowerShell

Section titled “Practical Exercise 4 — Suspicious PowerShell”

Create a behavior detection considering:

Parent Process
Command Line
Encoded Command
Network Activity
User

Do not classify all PowerShell as malicious.

Practical Exercise 5 — Cloud Logging Disabled

Section titled “Practical Exercise 5 — Cloud Logging Disabled”

Create a detection for:

Cloud Audit
Logging Disabled

Document:

Telemetry
Severity
Investigation Questions
Potential Benign Cause

Practical Exercise 6 — Data Exfiltration

Section titled “Practical Exercise 6 — Data Exfiltration”

Design a candidate detection using:

User
Asset
Data Volume
Destination
Time
Baseline

Practical Exercise 7 — MITRE ATT&CK Coverage

Section titled “Practical Exercise 7 — MITRE ATT&CK Coverage”

Create a matrix for:

10 ATT&CK Techniques

including:

Telemetry
Detection
Validation Status
Gap

Practical Exercise 8 — False Positive Analysis

Section titled “Practical Exercise 8 — False Positive Analysis”

Take this detection:

Office
Spawns
PowerShell

Identify:

5 Potential
Benign Causes

and determine what context could reduce false positives.

Practical Exercise 9 — Detection Test Plan

Section titled “Practical Exercise 9 — Detection Test Plan”

Create a test plan containing:

Detection
Test Behavior
Expected Telemetry
Expected Alert
Negative Test
Observed Result

Practical Exercise 10 — Detection Gap Assessment

Section titled “Practical Exercise 10 — Detection Gap Assessment”

For a fictional environment, analyze:

Credential Dumping
Persistence
Lateral Movement
Cloud Privilege Escalation
Data Exfiltration

and classify each as:

Covered
Partial
Gap
Unknown
  1. What is threat detection?

  2. How is detection different from prevention?

  3. Why should detection begin with a threat use case?

  4. What is a detection use case?

  5. What is an IOC?

  6. What are the limitations of IOC-only detection?

  7. What is behavior-based detection?

  8. Why can behavior detection remain useful when attacker infrastructure changes?

  9. What is signature-based detection?

  10. What is threshold detection?

  11. What is correlation detection?

  12. What is sequence detection?

  13. What is anomaly detection?

  14. Why does anomalous not mean malicious?

  15. What is risk-based detection?

  16. What is detection confidence?

  17. How is severity different from confidence?

  18. How might password spraying differ from brute force?

  19. What telemetry is useful for MFA-fatigue detection?

  20. Why is a new administrator event important?

  21. Why should PowerShell detections consider behavior?

  22. What is parent-child process analysis?

  23. What signals may indicate credential dumping?

  24. What are common persistence signals?

  25. What is beaconing?

  26. What signals may indicate DNS tunneling?

  27. What signals may indicate data exfiltration?

  28. What cloud activities should have high-value detections?

  29. Why is disabling logging suspicious?

  30. What email events can indicate business email compromise?

  31. Why should detections map to MITRE ATT&CK?

  32. What is a detection coverage matrix?

  33. Why does detection coverage not prove detection effectiveness?

  34. What fields typically make up detection logic?

  35. Why are time windows important?

  36. What is event grouping?

  37. Why must exclusions be carefully controlled?

  38. What is a false positive?

  39. What is a benign true positive?

  40. What is a false negative?

  41. What can cause a false negative?

  42. What is detection validation?

  43. What is a positive detection test?

  44. What is a negative detection test?

  45. Why should detections be tested end to end?

  46. What is detection debt?

  47. What is a detection gap?

  48. What is a telemetry gap?

  49. What is threat-informed detection?

  50. How can incidents improve detection engineering?

Threat detection follows:

Threat
Behavior
Telemetry
Detection Logic
Alert
Investigation

Detection engineering follows:

Use Case
Design
Build
Test
Deploy
Monitor
Tune

Remember:

IOC Match
Confirmed Attack
Anomaly
Malicious Activity
Rule Exists
Rule Works
Detection Coverage
Detection Effectiveness
Alert
Incident

A strong detection program connects:

Threat Intelligence
Attack Behavior
Telemetry
Detection Logic
SOC Investigation
Incident Lessons

Threat detection knowledge is essential for:

SOC Analysts
Blue Team Analysts
Detection Engineers
Threat Hunters
Incident Responders
SIEM Engineers
Security Analysts

During interviews, you should be able to explain:

How You Design
a Detection
What Telemetry
You Need
How You Reduce
False Positives
How You Identify
False Negatives
How You Map
to MITRE ATT&CK
How You Validate
a Detection

The professional skill is not simply:

Writing Queries

It is being able to connect:

Threat
Behavior
Telemetry
Detection
Investigation

➡️ Next: 04 — Threat Hunting

You now understand how Blue Teams create detections for known or anticipated attacker behaviors.

But detections can miss activity.

The next question is:

What If
the Attacker
Is Already Inside
and
No Alert
Has Triggered?

In the next module, you will move from:

Alert-Driven
Investigation

to:

Proactive
Threat Hunting

You will learn:

Threat Hunting Fundamentals
Hunt Hypotheses
Threat-Informed Hunting
MITRE ATT&CK-Based Hunting
Baseline Analysis
Anomaly Hunting
Identity Hunting
Endpoint Hunting
Network Hunting
Cloud Hunting
IOC and Behavioral Hunting
Hunt Queries
Evidence Collection
Hunt Documentation
Hunt-to-Detection Conversion

You will move from:

What Alerts
Do We Have?

to:

What Threat
Might Be Present
That Our Alerts
Did Not Detect?

➡️ Next: 04 — Threat Hunting