| name | building-attack-pattern-library-from-cti-reports |
| description | Parse cyber threat intelligence reports (Mandiant, CrowdStrike, Talos, Microsoft) with stix2, mitreattack-python, and spaCy to extract adversary behaviors, map them to MITRE ATT&CK technique IDs, and build a searchable STIX 2.1 attack-pattern library with detection templates. Use when cataloging attack patterns from CTI reports for threat-informed detection engineering, or generating Sigma/YARA templates from documented behaviors. |
| domain | cybersecurity |
| subdomain | threat-intelligence |
| tags | ["attack-pattern","cti-reports","mitre-attack","stix","detection-engineering","threat-intelligence","nlp","extraction"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
| d3fend_techniques | ["File Metadata Consistency Validation","Application Protocol Command Analysis","Identifier Analysis","Content Format Conversion","Message Analysis"] |
| nist_csf | ["ID.RA-01","ID.RA-05","DE.CM-01","DE.AE-02"] |
| mitre_attack | ["T1566.001","T1059.001","T1003.001","T1558.003","T1550.002"] |
Building Attack Pattern Library from CTI Reports
Overview
Cyber threat intelligence (CTI) reports from vendors like Mandiant, CrowdStrike, Talos, and Microsoft contain detailed descriptions of adversary behaviors that can be extracted, normalized, and cataloged into a structured attack pattern library. This skill covers parsing CTI reports to extract adversary techniques, mapping behaviors to MITRE ATT&CK technique IDs, creating STIX 2.1 Attack Pattern objects, building a searchable library indexed by tactic, technique, and threat actor, and generating detection rule templates from documented patterns.
When to Use
- When deploying or configuring building attack pattern library from cti reports capabilities in your environment
- When establishing security controls aligned to compliance requirements
- When building or improving security architecture for this domain
- When conducting security assessments that require this implementation
Prerequisites
- Python 3.9+ with
stix2, mitreattack-python, spacy, requests libraries
- Collection of CTI reports (PDF, HTML, or text format)
- MITRE ATT&CK STIX data (local or via TAXII)
- Understanding of ATT&CK technique structure and naming conventions
- Familiarity with detection engineering concepts (Sigma, YARA)
Key Concepts
Attack Pattern Extraction
CTI reports describe adversary behaviors in natural language. Extraction involves identifying action verbs and technical terms that map to ATT&CK techniques, recognizing tool names and malware families, identifying infrastructure indicators, and mapping sequences of behaviors to attack chains (kill chain phases).
STIX 2.1 Attack Pattern Objects
STIX defines Attack Pattern as a Structured Domain Object (SDO) that describes ways threat actors attempt to compromise targets. Each pattern links to ATT&CK via external references, includes kill chain phases (tactics), and can be related to Intrusion Sets, Malware, and Tool objects.
Detection Rule Generation
Extracted attack patterns inform detection engineering by providing: specific procedure examples for Sigma rule creation, behavioral sequences for correlation rules, IOC patterns for YARA and Snort rules, and data source requirements for telemetry gaps.
Workflow
Step 1: Parse CTI Reports and Extract Behaviors
import re
import json
from collections import defaultdict
:
BEHAVIOR_INDICATORS = [
, , , , ,
, , , , ,
, , , , ,
, , , ,
, , , ,
]
TOOL_PATTERNS = [
,
,
,
,
]
TECHNIQUE_KEYWORDS = {
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
}
():
sentences = re.split(, text)
behaviors = []
sentence sentences:
sentence_lower = sentence.lower()
indicator .BEHAVIOR_INDICATORS:
indicator sentence_lower:
behavior = {
: sentence.strip(),
: indicator,
: ._extract_tools(sentence),
: ._match_techniques(sentence_lower),
}
behavior[]:
behaviors.append(behavior)
()
behaviors
():
tools = ()
pattern .TOOL_PATTERNS:
matches = re.findall(pattern, text, re.IGNORECASE)
tools.update(matches)
(tools)
():
matches = []
keyword, tech_id .TECHNIQUE_KEYWORDS.items():
keyword text:
matches.append({: keyword, : tech_id})
matches
parser = CTIReportParser()
sample_report =
behaviors = parser.parse_report(sample_report)