Changes to Blocked Teams Domains (NRT)
Description
This query detects changes to blocked Teams domains and can be used as an NRT detection.
Query · kql
CloudAppEvents | where ActionType == "TeamsAdminAction" | where RawEventData.AdminActionDetail has "Skype.Policy/configurations/TenantFederationSettings/configuration/Global" | where RawEventData.ModifiedProperties has "BlockedDomains" | extend ModifiedPropertiesName = RawEventData.ModifiedProperties[0].Name | extend ModifiedPropertiesNewValue = extract_all(@"Domain=([^,]+)", tostring(RawEventData.ModifiedProperties[0].NewValue)) | extend ModifiedPropertiesOldValue = extract_all(@"Domain=([^,]+)", tostring(RawEventData.ModifiedProperties[0].OldValue)) | extend Action = iff(array_length(ModifiedPropertiesNewValue) > array_length(ModifiedPropertiesOldValue) or isempty(ModifiedPropertiesOldValue), "Domain Added", "Domain Removed") | extend AddedFrom = iff(RawEventData.ExtraProperties has "80ccca67-54bd-44ab-8625-4b79c4dc7775", "TABL", "Teams Admin Centre") //Uncomment below to only show domains added //| where Action == "Domain Added" | project Timestamp, AccountObjectId, AccountDisplayName, Application, ActionType, Action, AddedFrom, ModifiedPropertiesName, ModifiedPropertiesNewValue, ModifiedPropertiesOldValue, RawEventData, ReportId