Security for AI - MITRE ATLAS Parent Technique Coverage
MDXDR Security For AI MITRE ATLAS 05 Parent Technique Coverage
Query
let MitreAtlas =
externaldata(objects: dynamic)
[
@"https://raw.githubusercontent.com/mitre-atlas/atlas-navigator-data/main/dist/stix-atlas.json"
]
with (format="multijson")
| mv-expand objects
| where objects.type == "attack-pattern"
| mv-expand Reference = objects.external_references
| where Reference.source_name == "mitre-atlas"
| project
TechniqueId = tostring(Reference.external_id),
TechniqueName = tostring(objects.name),
Description = tostring(objects.description),
Tactics = objects.kill_chain_phases,
IsSubTechnique = tobool(objects.x_mitre_is_subtechnique),
Url = tostring(Reference.url),
Created = todatetime(objects.created),
Modified = todatetime(objects.modified)
| mv-expand Tactics
| extend Tactic = tostring(Tactics.phase_name)
| project-away Tactics;
let AIParentCoverage = materialize(
AlertInfo
| where DetectionSource in (
"Security for AI",
"Microsoft Defender for AI Services"
)
| summarize arg_max(Timestamp, *) by AlertId
| extend TechniqueIds = extract_all(
@"(AML\.T\d{4}(?:\.\d{3})?)",
tostring(AttackTechniques))
| mv-expand TechniqueId = TechniqueIds to typeof(string)
| where isnotempty(TechniqueId)
| extend ParentTechniqueId = extract(@"^(AML\.T\d{4})", 1, TechniqueId)
| summarize
AlertCount = dcount(AlertId),
DirectAlerts = dcountif(AlertId, TechniqueId == ParentTechniqueId),
SubTechniqueAlerts = dcountif(AlertId, TechniqueId != ParentTechniqueId),
ObservedSubTechniques = make_set_if(TechniqueId, TechniqueId != ParentTechniqueId),
DetectionTitles = make_set(Title),
DetectionSources = make_set(DetectionSource),
Severities = make_set(Severity),
FirstSeen = min(Timestamp),
LastSeen = max(Timestamp)
by ParentTechniqueId
);
MitreAtlas
| where coalesce(IsSubTechnique, false) == false
| join kind=leftouter AIParentCoverage on $left.TechniqueId == $right.ParentTechniqueId
| extend AlertCount = coalesce(AlertCount, 0),
DirectAlerts = coalesce(DirectAlerts, 0),
SubTechniqueAlerts = coalesce(SubTechniqueAlerts, 0)
| extend CoverageStatus = case(
DirectAlerts > 0 and SubTechniqueAlerts > 0, "Direct and SubTechnique",
DirectAlerts > 0, "Direct",
SubTechniqueAlerts > 0, "Via SubTechnique", "Not Observed")
| project Tactic, TechniqueId, TechniqueName, CoverageStatus, AlertCount,
DirectAlerts, SubTechniqueAlerts, ObservedSubTechniques, DetectionTitles,
DetectionSources, Severities, FirstSeen, LastSeen, Description, Url
| order by AlertCount desc, Tactic asc, TechniqueId ascAbout this query
Explanation
This KQL query is designed to analyze security alerts related to AI by mapping observed sub-techniques to their parent techniques using the MITRE ATLAS framework. Here's a simplified breakdown of what the query does:
-
Data Source: It uses the
AlertInfotable from Microsoft Defender XDR to gather alert data. -
MITRE ATLAS Data: It retrieves MITRE ATLAS data from an external JSON file, focusing on attack patterns and their details like technique IDs, names, descriptions, and associated tactics.
-
Alert Analysis:
- It filters alerts that originate from "Security for AI" or "Microsoft Defender for AI Services".
- It extracts technique IDs from the alerts and identifies whether they are parent techniques or sub-techniques.
- It summarizes the alerts by counting how many are directly related to parent techniques and how many are related to sub-techniques.
-
Coverage Evaluation:
- It joins the MITRE ATLAS data with the summarized alert data to evaluate the coverage of each parent technique.
- It categorizes the coverage status as "Direct", "Via SubTechnique", "Direct and SubTechnique", or "Not Observed" based on the presence of alerts.
-
Output:
- The query outputs a list of tactics, technique IDs, technique names, coverage status, alert counts, and other relevant details.
- The results are ordered by the number of alerts, tactic, and technique ID.
Overall, this query helps identify which MITRE ATLAS parent techniques have been observed in alerts and distinguishes between direct and inherited observations, providing insights into potential gaps in detection capabilities.