01 / 20

Detection
Tuning

Learn how security teams optimize alert rules to reduce noise, catch real threats, and balance false positives against false negatives.

Cyber Security

What Is Detection Tuning?

Detection tuning is the process of adjusting security alert rules and thresholds so that a monitoring system fires on real threats while staying quiet about harmless activity. Think of it as calibrating a smoke detector: too sensitive and it screams at burnt toast, too lax and it ignores a real fire.

Why Tuning Matters

Alert Fatigue
Too many false alarms cause analysts to ignore or deprioritize real threats.
Missed Attacks
Rules that are too relaxed let malicious activity slip through undetected.
Efficiency
Well-tuned detections free analyst time for threat hunting and incident response.

Key Vocabulary

False Positive (FP)
The system flags benign activity as malicious. The alert fires, but nothing bad actually happened.
False Negative (FN)
The system misses a real attack. The malicious activity occurs, but no alert is generated.
True Positive (TP)
The system correctly identifies a real threat. Alert fires and the activity is genuinely malicious.
True Negative (TN)
The system correctly stays silent for benign activity. No alert, no threat: everything working as intended.

The Confusion Matrix

ACTUAL CONDITION Malicious Benign ALERT FIRED? Yes No True Positive Caught the threat ✓ False Positive False alarm ✕ False Negative Missed attack ✕ True Negative Correctly silent ✓ Goal: Maximize TP + TN, Minimize FP + FN

The Core Trade-Off

Detection Sensitivity (Threshold) → Rate → Low High FP Rate FN Rate Sweet Spot

False Positive vs False Negative

False Positive False Negative
Definition Alert fires on benign activity No alert for real attack
Analogy Fire alarm at burnt toast Fire alarm silent during fire
Impact Analyst fatigue, wasted time Undetected breach, data loss
Fix Direction Tighten rule, add exceptions Broaden rule, lower threshold
Severity Annoying but visible Dangerous and invisible

Precision and Recall

Precision
Of all alerts that fired, what fraction were real threats?

\(\text{Precision} = \frac{TP}{TP + FP}\)
Recall
Of all real attacks, what fraction did the system actually catch?

\(\text{Recall} = \frac{TP}{TP + FN}\)

The Tuning Lifecycle

1. Deploy Rule 2. Collect Alerts 3. Analyze FP / FN 4. Adjust Thresholds 5. Validate Continuous Improvement

How to Tune a Detection Rule

1
Identify the problem: Is the alert producing too many false positives, or are known attacks slipping through (false negatives)?
2
Gather sample data: Collect 50-100 recent alert instances and classify each as TP, FP, FN, or TN.
3
Find patterns: What do the false positives have in common? A specific user group, time window, or source application?
4
Refine the rule: Add exclusion filters, adjust thresholds, or correlate with additional log sources.
5
Test and validate: Run the updated rule against historical data. Confirm FP drops without introducing new FN.

Example 1: Brute-Force Login Alert

Scenario: Your SIEM triggers an alert whenever a single account has 5 or more failed logins within 10 minutes. The SOC is drowning in alerts every Monday morning when employees return and mistype their passwords.

Before Tuning Threshold: 5 failures / 10 min Alerts per week: 340 FP Rate: ~85% FN Rate: ~2% After Tuning Threshold: 10 failures / 5 min Alerts per week: 42 FP Rate: ~15% FN Rate: ~5%

Example 2: Suspicious DNS Rule

Scenario: A detection rule flags DNS queries to newly registered domains (NRDs) as potential command-and-control (C2) traffic. However, the marketing team recently launched a campaign using a brand-new domain, generating 200+ false positives per day.

1
Identify the pattern: All FPs share the same destination domain owned by the marketing vendor.
2
Create an allowlist: Add the verified marketing domain to the rule's exclusion list.
3
Add context enrichment: Cross-reference NRD queries with threat intelligence feeds before alerting.
4
Validate: Confirm real C2 domains (from threat intel samples) are still caught by the updated rule.

Example 3: Calculating Precision

Scenario: Over one week, a detection rule produces 120 alerts. After investigation, the SOC classifies them: 18 true positives, 102 false positives. A separate red team exercise revealed 3 attacks that were missed (false negatives).

Common Tuning Techniques

Threshold Adjustment
Raise or lower numeric thresholds (e.g., failed login count) to shift the sensitivity balance.
Allowlisting
Exclude known-good IPs, domains, or user accounts that consistently trigger false positives.
Correlation
Require multiple conditions from different log sources to fire before generating an alert.
Time Windowing
Shorten or lengthen the observation window to capture bursty vs. slow-and-low attacks.
Severity Tiering
Instead of binary alert/no-alert, assign severity levels so analysts prioritize high-confidence detections.

Common Mistakes

✕ Over-Suppressing Alerts
Adding too many allowlist entries or raising thresholds too high creates dangerous blind spots (false negatives).
✕ Never Revisiting Rules
A rule tuned six months ago may no longer fit. Environments change, attackers adapt, and rules go stale.
✕ Tuning Without Data
Making gut-feeling changes without classifying a sample of alerts (TP/FP/FN) leads to unpredictable outcomes.

Detection Tuning Summary

Concept Description Key Metric
False Positive Alert on benign activity Precision drops
False Negative Missed real attack Recall drops
Precision \(\frac{TP}{TP+FP}\) Alert quality
Recall \(\frac{TP}{TP+FN}\) Threat coverage
Tuning Goal Balance both rates Maximize both

Question 1 of 5

A security analyst discovers that a detection rule flagged a legitimate software update as malware. This scenario is best described as a:

Question 2 of 5

If a detection rule has high recall but low precision, what is most likely happening?

Question 3 of 5

A SOC team completely disables a noisy detection rule instead of tuning it. What is the primary risk of this action?

Question 4 of 5

A rule generates 200 alerts in a week. After review: 30 are true positives and 170 are false positives. What is the rule's precision?

Question 5 of 5

Which tuning technique involves requiring events from multiple log sources to match before an alert fires?