Security for AI - MITRE ATLAS Overall Coverage Statistics
MDXDR Security For AI MITRE ATLAS 03 Overall Coverage Statistics
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 AIAlertCoverage = 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)
| summarize
AlertCount = dcount(AlertId),
AlertIds = make_set(AlertId),
DetectionTitles = make_set(Title)
by TechniqueId
);
MitreAtlas
| join kind=leftouter AIAlertCoverage on TechniqueId
| extend AlertCount = coalesce(AlertCount, 0)
| extend IsSubTechnique = coalesce(IsSubTechnique, false)
| summarize
TotalTechniques = dcount(TechniqueId),
ObservedTechniques = dcountif(TechniqueId, AlertCount > 0),
TotalParentTechniques = dcountif(TechniqueId, IsSubTechnique == false),
ObservedParentTechniques = dcountif(TechniqueId, IsSubTechnique == false and AlertCount > 0),
TotalSubTechniques = dcountif(TechniqueId, IsSubTechnique == true),
ObservedSubTechniques = dcountif(TechniqueId, IsSubTechnique == true and AlertCount > 0),
AlertIds = make_set(AlertIds),
DetectionTitles = make_set(DetectionTitles)
| extend
NotObservedTechniques = TotalTechniques - ObservedTechniques,
UniqueAlertCount = array_length(AlertIds),
DetectionCount = array_length(DetectionTitles),
CoveragePercentage = round(100.0 * ObservedTechniques / TotalTechniques, 2),
ParentCoveragePercentage = iff(TotalParentTechniques > 0,
round(100.0 * ObservedParentTechniques / TotalParentTechniques, 2), 0.0),
SubTechniqueCoveragePercentage = iff(TotalSubTechniques > 0,
round(100.0 * ObservedSubTechniques / TotalSubTechniques, 2), 0.0)
| project TotalTechniques, ObservedTechniques, NotObservedTechniques,
CoveragePercentage, TotalParentTechniques, ObservedParentTechniques,
ParentCoveragePercentage, TotalSubTechniques, ObservedSubTechniques,
SubTechniqueCoveragePercentage, UniqueAlertCount, DetectionCount, DetectionTitlesAbout this query
Explanation
This KQL query is designed to assess the coverage of security alerts related to AI techniques as mapped by the MITRE ATLAS framework. Here's a simplified breakdown of what the query does:
-
Data Source: It pulls data from an external JSON file that contains information about MITRE ATLAS techniques. This data includes technique IDs, names, descriptions, and whether they are sub-techniques.
-
Alert Data: It retrieves alert data from the
AlertInfotable, specifically focusing on alerts generated by "Security for AI" and "Microsoft Defender for AI Services." It extracts technique IDs from these alerts. -
Join and Analysis: The query joins the MITRE ATLAS data with the alert data to see which techniques have associated alerts. It calculates several statistics:
- Total number of techniques and sub-techniques.
- Number of techniques and sub-techniques that have been observed (i.e., have associated alerts).
- Coverage percentages for overall techniques, parent techniques, and sub-techniques.
-
Output: The query outputs statistics such as the total number of techniques, observed techniques, coverage percentages, and the number of unique alerts and detection titles.
In essence, this query helps identify how well AI-related security techniques are covered by alerts, highlighting potential gaps in detection capabilities.