Agent Foskett Academy • SOC Analyst Academy • Module 9 • Lesson 90 • Detection Engineering: Turning Findings into Protection

Lesson 90 — From Hunt to Production Detection

The hunt found something real.

The behaviour was repeatable.

The evidence was strong.

Now it had to become protection.

A successful hunt becomes more valuable when the SOC can detect the behaviour next time.
Agent Foskett taking a threat hunt through the production detection lifecycle
A hunt is evidence. A detection is an operational control.

The journey from one to the other requires testing, tuning, explanation, ownership and monitoring.

✓ Hypothesis
✓ Backtest
✓ Deploy
✓ Maintain

Case briefing

THREAT HUNT FOUND: Browser → PowerShell → suspicious command → external connection CONFIRMED: Malicious REPEATABLE: Yes TELEMETRY: Available QUESTION: HOW DO WE TURN THIS INVESTIGATION INTO RELIABLE PRODUCTION DETECTION?

Investigation objective

Take a validated threat-hunting finding through the complete detection-engineering lifecycle: hypothesis, telemetry, logic, baseline, backtesting, tuning, explainability, deployment, monitoring and ownership.

Investigator's rule

Do not productionise the hunt query. Productionise the security hypothesis.

Stage 1 — extract the security hypothesis

HUNT FINDING A user visited malicious content. Browser launched PowerShell. PowerShell executed suspicious script behaviour. Network activity followed. SECURITY HYPOTHESIS A browser spawning PowerShell with suspicious execution context may indicate web-originated script execution or compromise. THIS IS WHAT THE DETECTION MUST PRESERVE.

The hunt query was built to investigate

It may contain temporary filters, known IOCs, analyst pivots or case-specific values. Those helped answer the hunt question but may not belong in a reusable detection.

The hypothesis should survive changing IOCs

Where possible, preserve repeatable attacker behaviour rather than tying the rule only to the domain, hash or IP from the original case.

Stage 2 — identify the minimum telemetry

RequirementTelemetry needed
Browser ancestryProcess creation telemetry
PowerShell executionProcess name and command line
User and device contextAccount and device identifiers
Follow-on activityNetwork, file or additional process telemetry where required
Production reliabilityConsistent data-source availability

Detection begins with observable evidence

A strong hypothesis cannot become a reliable detection if the required telemetry is missing, inconsistent or delayed beyond the intended response window.

Know the dependency

Document which data source and fields the rule relies on. Later, telemetry health becomes part of detection health.

Stage 3 — build the first candidate

01-candidate-detection.kql
123456789101112
DeviceProcessEvents
| where Timestamp > ago(1h)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where InitiatingProcessFileName in~ (
    "msedge.exe", "chrome.exe", "firefox.exe"
)
| project Timestamp,
          DeviceId,
          DeviceName,
          AccountName,
          InitiatingProcessFileName,
          ProcessCommandLine

Keep the first candidate understandable

Start with the smallest logic that expresses the behaviour. Complexity should be added because evidence requires it, not because sophisticated queries look impressive.

Do not tune yet

Before adding exclusions, thresholds or allowlists, learn how the behaviour actually appears across the environment.

Stage 4 — build the baseline

02-baseline-the-behaviour.kql
1234567891011
DeviceProcessEvents
| where Timestamp > ago(30d)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where InitiatingProcessFileName in~ (
    "msedge.exe", "chrome.exe", "firefox.exe"
)
| summarize Events=count(),
            FirstSeen=min(Timestamp),
            LastSeen=max(Timestamp)
  by DeviceId, DeviceName, AccountName
| order by Events desc

Ask what normal looks like

Which devices generate the behaviour? Which accounts? Is it rare, concentrated, seasonal or associated with a known workflow?

The baseline informs engineering

It may justify contextual filtering, segmentation or a threshold. It should not automatically become an exclusion list.

Stage 5 — backtest against history

Backtest questionWhat it tells you
How many matches occur?Expected detection volume
How concentrated are the matches?Whether a small population drives noise
Does the original malicious case match?Positive control coverage
Do other known malicious cases match?Generalisability
What benign cases dominate?Tuning opportunities

The original attack is a positive control

If the production candidate cannot reproduce the behaviour that justified its creation, stop and understand why before proceeding.

One attack is not enough

Where possible, test multiple known examples so the detection does not become an overfit reconstruction of one incident.

Stage 6 — tune without deleting the hypothesis

RAW CANDIDATE ↓ MEASURE NOISE ↓ IDENTIFY EXPLAINABLE BENIGN PATTERNS ↓ ADD NARROW CONTEXT ↓ RETEST MALICIOUS CASES ↓ MEASURE AGAIN TUNE THE IMPLEMENTATION. PRESERVE THE HYPOTHESIS.

Every tuning change has a cost

An exclusion, threshold or suppression decision can reduce analyst workload while also creating a blind spot. Measure both sides.

Search the boundary

Review behaviour close to thresholds and inside exclusions. False negatives do not generate tickets complaining about themselves.

Stage 7 — check for duplicate coverage

QuestionDecision value
Does another rule detect the same hypothesis?Possible redundancy
Do both rules fire on the same incidents?Possible duplicate analyst work
Does either rule have unique coverage?Reason to preserve both
Could one alert preserve both signals?Consolidation opportunity

New does not automatically mean additional protection

Before deploying another alert, understand what existing detections already cover and whether the new rule adds unique value.

Reduce duplicate work, not useful resilience

Overlapping signals may still be valuable when they detect different attack stages or rely on independent telemetry.

Stage 8 — make the alert explainable

ALERT TITLE Browser Spawned PowerShell with Suspicious Execution Context WHY IT FIRED Browser process launched PowerShell. WHY IT MATTERS May indicate web-originated script execution. KEY EVIDENCE Device Account Parent process Command line Timestamp FIRST PIVOTS Process tree Network activity File activity Related account behaviour

The SOC receives an alert, not your design session

The production output must carry enough context for another analyst to understand the behaviour and begin investigating.

Test with another analyst

Give them the alert without explaining the query. Can they say what happened, why it matters and what they would check next?

Stage 9 — define production ownership

Production requirementDecision
OwnerWho maintains the detection?
SeverityHow should the SOC prioritise it?
ResponseWhat investigation path should follow?
Data dependencyWhat telemetry must remain healthy?
Review cadenceWhen should assumptions be revisited?
RollbackHow can a harmful change be reversed?

Production needs an owner

A detection without ownership can slowly become stale, noisy or misleading while everyone assumes somebody else is maintaining it.

Define success before deployment

Expected volume, acceptable false-positive patterns, known attack coverage and analyst workflow should be understood before the rule enters production.

Stage 10 — deploy, observe and measure

PRODUCTION DAY 1 Observe DAY 7 Measure volume DAY 14 Review analyst outcomes DAY 30 Review false positives and missed behaviour ONGOING Monitor drift Monitor telemetry Retest assumptions Review tuning Preserve coverage DEPLOYMENT IS NOT THE END.

Watch the first production period closely

Historical backtesting cannot reproduce every operational condition. Early production observation validates how the rule behaves with real SOC workflows.

Measure analyst outcomes

How often is the alert actionable? What verdicts are analysts reaching? Are multiple alerts representing one investigation? Those results feed the next engineering cycle.

Stage 11 — monitor for drift

03-monitor-behaviour-volume.kql
12345678910
DeviceProcessEvents
| where Timestamp > ago(30d)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where InitiatingProcessFileName in~ (
    "msedge.exe", "chrome.exe", "firefox.exe"
)
| summarize Events=count(),
            Devices=dcount(DeviceId)
  by bin(Timestamp, 1d)
| order by Timestamp asc

The environment will change

New software, workflows, devices and identities can change what the detection sees even when the query itself remains untouched.

Revisit assumptions, not just thresholds

If the environment changes significantly, the original distinguishing behaviour may need to be re-evaluated rather than merely tuned around the new noise.

Stage 12 — preserve the engineering record

DETECTION RECORD ORIGIN: Threat hunt HYPOTHESIS: Documented TELEMETRY: Documented BASELINE: Measured BACKTEST: Completed POSITIVE CONTROLS: Passed TUNING: Justified DUPLICATE REVIEW: Completed ALERT EXPLANATION: Validated OWNER: Assigned MONITORING: Defined REVIEW DATE: Scheduled

The reasoning matters as much as the query

Future analysts need to know why the detection exists, what evidence justified its design and which assumptions must remain true.

This makes future changes safer

When the environment drifts or new detections overlap, the team can revisit evidence rather than guessing what the original engineer intended.

The complete detection-engineering lifecycle

HUNT ↓ VALIDATE BEHAVIOUR ↓ WRITE HYPOTHESIS ↓ CONFIRM TELEMETRY ↓ BUILD CANDIDATE ↓ BASELINE ↓ BACKTEST ↓ TUNE ↓ CHECK COVERAGE ↓ MAKE EXPLAINABLE ↓ ASSIGN OWNERSHIP ↓ DEPLOY ↓ MONITOR ↓ REVIEW ↺ FROM FINDING TO PROTECTION.

The hunt found the opportunity

Detection engineering turns that opportunity into repeatable protection for the next analyst, the next device and the next incident.

The lifecycle never really closes

Production feedback, environment changes and new attacker behaviour send the detection back through testing and refinement. Good detections are maintained, not merely created.

Lesson 90 key takeaways

  • Do not simply convert a threat-hunt query into a production alert.
  • Extract and preserve the underlying security hypothesis.
  • Confirm the telemetry required to observe the behaviour reliably.
  • Build the simplest candidate that expresses the hypothesis.
  • Baseline the behaviour before tuning.
  • Backtest against historical telemetry and known malicious cases.
  • Tune noise without deleting meaningful attack coverage.
  • Review existing detections before creating duplicate analyst work.
  • Make the alert understandable to analysts who did not build it.
  • Define ownership, severity, response expectations and data dependencies.
  • Observe production behaviour and analyst outcomes after deployment.
  • Monitor environmental and telemetry drift.
  • Preserve the reasoning, assumptions and validation evidence.
  • Detection engineering is a continuous lifecycle from finding to protection.

Module 9 complete — Detection Engineering: Turning Findings into Protection

You have taken investigation findings and threat-hunting evidence through the full detection-engineering lifecycle: choosing what deserves detection, tuning false positives, building baselines, backtesting, managing alert volume, protecting against false negatives, reviewing duplicate coverage, monitoring drift and building explainable alerts.

Module 9 complete • Lessons 81–90

Continue your SOC Analyst training

Module 9 focuses on turning validated investigation findings into transparent, tested and operationally useful detections.

🔎 SOC Analyst Academy — Module 9: Detection Engineering: Turning Findings into Protection

Turn validated investigation and hunting findings into transparent, tested and operationally useful detections.

How do you turn a threat hunt into a production detection?

Lesson 90 of the Agent Foskett SOC Analyst Academy completes the detection-engineering lifecycle by taking a validated threat-hunting finding through security hypothesis development, telemetry validation, baselining, backtesting, tuning, deployment and ongoing monitoring.

Production detection engineering lifecycle

Learn how to preserve attack coverage, reduce false positives and duplicate analyst work, create explainable alerts, assign detection ownership and monitor production rules for environmental and telemetry drift.