0

I'm trying to create an Azure Alert to notify me when someone adds a user to an Azure Active Directory Group. I found the query below but its not working

SecurityEvent
 | where EventID in (4728, 4729, 4732, 4733, 4756, 4757) and TargetAccount contains 
 "Admin" 
and TimeGenerated > ago(24h)
 | summarize AggregatedValue = count() by TargetAccount
 | order by AggregatedValue desc
Venkat V
  • 2,197
  • 1
  • 1
  • 10
user770022
  • 2,899
  • 19
  • 52
  • 79

1 Answers1

0

I'm trying to create an Azure Alert to notify me when someone adds a user to an Azure Active Directory Group.

I have used below KQL query to check the Azure AD group activity logs.

AuditLogs
| where OperationName contains "Add member to group"
| where TargetResources contains "newgrp"
| extend prop = parse_json(InitiatedBy)
| extend InitialedBy=prop.user.userPrincipalName
|project InitialedBy , TimeGenerated,OperationName,Category,InitiatedBy,Result,ActivityDisplayName

Output

enter image description here

If you want to check removed users from Azure AD Group, use below query.

AuditLogs
| where Category contains_cs "GroupManagement"
| where OperationName contains "Remove member from group"
| where TargetResources contains "newgrp"
| extend prop = parse_json(InitiatedBy)
| extend InitialedBy=prop.user.userPrincipalName
|project InitialedBy , TimeGenerated,OperationName,Category,InitiatedBy,Result,ActivityDisplayName

Output:

enter image description here

Create an alert by clicking New alert rule

enter image description here

Create an Action Group to trigger the email.

enter image description here

Once you add the user to the Azure AD Group, you will get the alert as below.

Alert triggered in portal

enter image description here

Received email

enter image description here

Venkat V
  • 2,197
  • 1
  • 1
  • 10