Kusto Query LanguageMicrosoft Defender for EndpointMicrosoft SentinelSECURE

List Active Directory Group Additions

Description

This KQL query can be used to list all Active Directory group additions. The query uses 2 variables as input, the Group names on which you want to search and the time frame used for the search. This could help in your investigation by knowing if accounts have been added to high privileged groups in order for them to have more privileges.

Query

Microsoft Defender For Endpoint
Kusto
let Groups = dynamic(['Domain Admins', 'GroupName2']); // Add your sensitive groups to this list
let SearchWindow = 48h; //Customizable h = hours, d = days
IdentityDirectoryEvents
| where Timestamp > (now() - SearchWindow)
| where ActionType == "Group Membership changed"
| extend Group = parse_json(AdditionalFields).['TO.GROUP']
| extend GroupAdditionInitiatedBy = parse_json(AdditionalFields).['ACTOR.ACCOUNT']
| project-reorder Group, GroupAdditionInitiatedBy
| where Group has_any (Groups)

Microsoft Sentinel
Kusto
let Groups = dynamic(['Domain Admins', 'GroupName2']); // Add your sensitive groups to this list
let SearchWindow = 48h; //Customizable h = hours, d = days
IdentityDirectoryEvents
| where Timestamp > (now() - SearchWindow)
| where ActionType == "Group Membership changed"
| extend Group = parse_json(AdditionalFields).['TO.GROUP']
| extend GroupAdditionInitiatedBy = parse_json(AdditionalFields).['ACTOR.ACCOUNT']
| project-reorder Group, GroupAdditionInitiatedBy
| where Group has_any (Groups)

References

Leave a Reply

Your email address will not be published. Required fields are marked *