AegisShield provides direct integration with the MITRE ATT&CK framework, mapping identified threats to specific attack techniques using local STIX data and AI-powered technique selection.
Application type determining which matrices to load
Returns:dict - STIX data with attack patterns, tactics, and techniques
mitre_attack.py:52-94
from mitre_attack import fetch_mitre_attack_data# Automatically selects appropriate matrixstix_data = fetch_mitre_attack_data("Web application")# Returns enterprise-attack.jsonstix_data = fetch_mitre_attack_data("Mobile application")# Returns both mobile and enterprise datastix_data = fetch_mitre_attack_data("ICS or SCADA System")# Returns both ICS and enterprise data
Extract keywords from threat’s “MITRE ATT&CK Keywords” field and match against attack pattern names and descriptions.Maximum of 25 techniques per threat to keep processing manageable.
2
AI-Powered Selection
Send matched techniques to GPT-4o with application context to select the single most relevant technique.Includes exponential backoff (0-5 seconds) between API calls to avoid rate limiting.
Technique selection from mitre_attack.py:145-269
# Phase 1: Keyword matchingfor obj in stix_data["objects"]: if obj["type"] == "attack-pattern": name = obj.get("name", "").lower() description = obj.get("description", "").lower() for keyword in threat["MITRE ATT&CK Keywords"]: if keyword.lower() in name or keyword.lower() in description: relevant_techniques.append(obj) breakrelevant_techniques = relevant_techniques[:25] # Limit to top 25# Phase 2: AI selectionprompt = create_mitre_prompt(app_details, threat, relevant_techniques)time.sleep(random.randint(0, 5)) # Rate limitingtop_technique_id = get_relevant_techniques(prompt, openai_api_key)
Rate limiting is critical. The code sleeps 0-5 seconds between API calls to respect OpenAI’s rate limits.