Skip to content

Expert · Threat intelligence and frameworks · topic 39 of 43 · 35 min

Using frameworks in detection and threat hunting

Explanation

Frameworks become useful when they drive daily work. SOCs tag every detection rule with ATT&CK techniques, measure which priority techniques they can detect (coverage), write portable rules in formats like Sigma, and run hypothesis-based threat hunts for attackers that no rule has caught yet. With permission, purple-team exercises test whether detections really fire.

From framework to practice

Knowing ATT&CK IDs does not stop attacks. What helps is using the framework to answer practical questions: Which techniques matter most for us? Which of them can we detect today? Where are the gaps? Did our new rule really work?

Detection engineering

Detection engineering is the work of designing, testing and maintaining detection rules. A typical cycle:

  1. Choose a technique to cover, based on threat intelligence (for example T1059.001 PowerShell, used by groups targeting your sector).
  2. Check data: do we collect the logs needed (Sysmon process creation, PowerShell script block logging)?
  3. Write the rule, and tag it with the ATT&CK technique.
  4. Test it safely, ideally by simulating the behaviour in a lab or approved test.
  5. Tune false positives, document the response steps, and deploy.
  6. Review regularly: is it still firing correctly?

Sigma: rules you can share

Sigma is an open, generic format for detection rules written in YAML. A Sigma rule can be converted into the query language of many SIEMs (Splunk SPL, Sentinel KQL, Elastic and others). Here is a rule for the Office-spawns-PowerShell pattern:

yaml
title: Office Application Spawning PowerShell
status: experimental
logsource:
  product: windows
  category: process_creation
detection:
  selection:
    ParentImage|endswith:
      - '\winword.exe'
      - '\excel.exe'
    Image|endswith: '\powershell.exe'
  condition: selection
level: high
tags:
  - attack.execution
  - attack.t1059.001
A Sigma rule tagged with its ATT&CK tactic and technique.

Measuring coverage

Coverage means: of the techniques we care about, how many do we have a working detection for? Teams often show this as a heat map on the ATT&CK matrix (MITRE's free ATT&CK Navigator tool can draw one). Coverage is a guide, not a score to game: one weak rule does not mean a technique is truly covered.

python
priority = {"T1566.001", "T1059.001", "T1053.005", "T1003", "T1021.001", "T1486", "T1490"}
rules = {"Office spawns PowerShell": "T1059.001", "Shadow copy deletion": "T1490", "New scheduled task": "T1053.005"}
covered = priority & set(rules.values())
print(f"{len(covered)}/{len(priority)} covered:", sorted(covered))
print("Gaps:", sorted(priority - covered))
Shows 3/7 covered and lists the four gaps to work on next.

Threat hunting

Threat hunting is proactively searching for attackers that existing rules have missed, instead of waiting for alerts. A good hunt starts with a hypothesis based on intelligence and ATT&CK, for example: "If an attacker used valid accounts with RDP for lateral movement (T1078, T1021.001), we will see logon type 10 events between workstations, which our staff never do." The hunter queries the SIEM, investigates anything odd, and turns useful queries into new detection rules.

Purple teaming

In a purple-team exercise, attackers (red team) and defenders (blue team) work together. With written approval and a clear scope, the red team safely performs a technique in the company's own environment, and the blue team checks whether the logs and alerts appear. Gaps are fixed on the spot. Open-source test libraries exist for this, but they must only be run in approved test environments.

Common mistakes

  • Colouring the ATT&CK matrix green without testing that rules fire.
  • Writing rules for data you do not collect.
  • Hunting with no hypothesis, just browsing logs.
  • Running attack simulations on production systems without approval.
Tip: A great beginner portfolio project: pick five techniques, write a Sigma rule for each, test them in a home lab with Sysmon and a free SIEM, and publish the results.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

Using frameworks in detection and threat hunting · 1/7

Framework → action

Frameworks help when they drive daily work: priorities, gaps and testing.

Prefer a video by a teacher? Find free videos on “detection engineering sigma rules MITRE ATT&CK coverage threat hunting” on YouTube ↗

In real life: Closing a gap before it mattered

A SOC at a Bengaluru fintech mapped its 60 rules to ATT&CK and compared them with techniques used by groups targeting financial services. It found no detection for T1490 (deleting shadow copies), which ransomware gangs do minutes before encrypting. The detection engineer wrote a rule, tested it in the lab, and deployed it. Three months later, the rule fired on a compromised server, and the team isolated it before encryption began.

Practice (0/3 done)

Task 1 · Question

What is the first step of a good threat hunt?

Task 2 · Code · Python

Write coverage(priority, rules) where priority is a set of technique ids and rules is a dict of rule name → technique id. Return a tuple (percent, gaps): percent is the share of priority techniques with at least one rule, rounded to a whole number, and gaps is a sorted list of uncovered priority techniques. If priority is empty, return (100, []).

Task 3 · Practice

Write one hunt plan: a hypothesis linked to an ATT&CK technique, the data sources needed, a query idea (in plain words or SPL/KQL), what "suspicious" would look like, and what you would do with the results.

Quick quiz

Question 1

1.What is Sigma?

Question 2

2.Why tag detection rules with ATT&CK technique IDs?

Question 3

3.What makes purple teaming legitimate?

Question 4

4.A technique is marked "covered" but the rule was never tested. What is the risk?

Question 5

5.Threat hunting differs from alert triage because it…

Read more (free)

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

What is Sigma?

Answer: An open, generic format for SIEM detection rules

Sigma rules are written in YAML and converted to many SIEM query languages.

Why tag detection rules with ATT&CK technique IDs?

Answer: To measure coverage and find gaps against priority techniques

Tags let you map and measure what you can detect.

What makes purple teaming legitimate?

Answer: Written approval, a clear scope and red and blue teams working together

Authorised, scoped and collaborative.

A technique is marked "covered" but the rule was never tested. What is the risk?

Answer: The rule may never fire, giving false confidence

Coverage must be tested, not assumed.

Threat hunting differs from alert triage because it…

Answer: Proactively looks for attackers that rules have missed

Hunting is proactive and hypothesis-driven.

What does T1566 represent in ATT&CK?Related

Answer: Phishing

T1566 is Phishing (Initial Access).

From MITRE ATT&CK: tactics and techniques

What is the most common first job title for beginners in Indian security teams?Related

Answer: SOC analyst (L1)

MSSPs and in-house SOCs hire many L1 analysts.

From Career paths in cyber security

What does MTTD measure?Related

Answer: Average time to detect an attack

Mean time to detect: lower is better.

From A SOC analyst's day and playbooks

Which type of intelligence is a board-level report on ransomware trends?Related

Answer: Strategic

Strategic intelligence supports long-term, high-level decisions.

From Threat intelligence and indicators of compromise

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. This is the last topic of “Threat intelligence and frameworks”. The module exam comes next.
  2. Module 9 exam: Threat intelligence and frameworks · 12 questions · 20 min, without help. 4 topics of this module still to finish first.
  3. Then the next module, Careers and certifications. 43 topics left in the course before the final exam.

← Previous: The Lockheed Martin Cyber Kill Chain