← Back to SOC feed Coverage →

Entra ID role adds in the last 7 days

kql MEDIUM Azure-Sentinel
T1548
CloudAppEvents
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-07T11:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may be adding malicious roles in Entra ID to gain unauthorized access to cloud resources. SOC teams should proactively hunt for these role additions in Azure Sentinel to identify potential privilege escalation attempts and limit lateral movement within the environment.

KQL Query

let LookBack = 7d; CloudAppEvents | where ActionType in ("Add member to role.") and Timestamp > ago(LookBack) | extend FirstElement = ActivityObjects[0], SecondElement = ActivityObjects[1], ThirdElement = ActivityObjects[2] | extend Type = FirstElement.ServiceObjectType | extend RoleName = FirstElement.Name | extend UserAddedName = SecondElement.Name  | extend UserAddedObjectId = SecondElement.Id | project Timestamp,Type,ActionType,RoleName,UserAddedName,UserAddedObjectId,PerformedByObjectId = AccountId,PerformedByDisplayName

Analytic Rule Definition

id: d7f6e5c4-b3a2-4e9f-8d7c-6a5b4c3d2e1f
name: Entra ID role adds in the last 7 days
description: |
  This query looks for Entra ID role adds identified by Microsoft Defender for Cloud Apps. It will require an corresponding app connector in Microsoft Defender for Cloud Apps.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - CloudAppEvents
tactics:
- Privilege Escalation
relevantTechniques:
- T1548
query: >
  let LookBack = 7d;
  CloudAppEvents
  | where ActionType in ("Add member to role.") and Timestamp > ago(LookBack)
  | extend FirstElement = ActivityObjects[0], SecondElement = ActivityObjects[1], ThirdElement = ActivityObjects[2]
  | extend Type = FirstElement.ServiceObjectType
  | extend RoleName = FirstElement.Name
  | extend UserAddedName = SecondElement.Name 
  | extend UserAddedObjectId = SecondElement.Id
  | project Timestamp,Type,ActionType,RoleName,UserAddedName,UserAddedObjectId,PerformedByObjectId = AccountId,PerformedByDisplayName
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: DisplayName
        columnName: UserAddedName
      - identifier: ObjectGuid
        columnName: UserAddedObjectId
      - identifier: ObjectGuid
        columnName: PerformedByObjectId
      - identifier: DisplayName
        columnName: PerformedByDisplayName
version: 1.0.0

Required Data Sources

Sentinel TableNotes
CloudAppEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Cloud Apps/aad-role-adds.yaml