How the attack works
Azure role-based access control (RBAC) is managed through role assignments: a principal, a role and a scope (management group, subscription, resource group or resource). Owner, User Access Administrator and Role Based Access Control Administrator can create further role assignments, and Contributor can manage every resource in scope, including running commands on virtual machines and reading Key Vault data through the resources that use it.
Attackers who control an identity with Microsoft.Authorization/roleAssignments/write assign one of these roles to an account they control, frequently a guest user or a service principal that is less likely to be reviewed. A Global Administrator can also elevate to User Access Administrator at the root scope and assign roles anywhere. Some built-in roles cannot grant access and still give control of what runs in the scope: Virtual Machine Contributor can execute scripts on machines, Website Contributor has access to an app's deployment credentials, Key Vault Contributor can grant itself data access in vaults that use access policies, Managed Identity Operator can assign an existing identity to a resource, and Resource Policy Contributor can change Azure Policy. A second rule on this page matches the assignment of ten such roles. Roles can also be assigned through Privileged Identity Management, as an eligible assignment that the member activates later or as a time-bound active one. PIM records these in the Microsoft Entra audit log under the category ResourceManagement, and a third rule on this page reads them.
What an attacker needs
- An identity with permission to write role assignments at the target scope (Owner, User Access Administrator, Role Based Access Control Administrator, a custom role with roleAssignments/write, or an elevated Global Administrator).
Impact
Control over every resource in the scope: data stores, virtual machines, managed identities and their tokens, and the ability to grant access to others. At subscription or management group scope this is effectively a full cloud environment compromise.
Detection rules
Privileged Azure Role Assigned (Owner, User Access Administrator, RBAC Administrator or Contributor)
Detects an Azure role assignment request for Owner, User Access Administrator, Role Based Access Control Administrator or Contributor, identified by the built-in role definition IDs in the request body. Microsoft documents the request body on the event that records the start of the operation (status Start in AzureActivity, Started in the REST schema), and its own alert for privileged role assignments reads that event. A started request can still fail, so check that the assignment exists. Confirm the match on a real event in your own workspace before you rely on this rule.
title: Privileged Azure Role Assigned (Owner, User Access Administrator, RBAC Administrator or Contributor)
id: ab723665-6d25-4885-8f9e-115433e81d90
status: experimental
description: >-
Detects an Azure role assignment request for Owner, User Access
Administrator, Role Based Access Control Administrator or Contributor,
identified by the built-in role definition IDs in the request body.
Microsoft documents the request body on the event that records the start of
the operation (status Start in AzureActivity, Started in the REST schema),
and its own alert for privileged role assignments reads that event. A
started request can still fail, so check that the assignment exists.
Confirm the match on a real event in your own workspace before you rely on
this rule.
references:
- https://attack.mitre.org/techniques/T1098/003/
- https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles
- https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-alert
- https://learn.microsoft.com/en-us/azure/role-based-access-control/change-history-report
author: Forestall
date: 2026-11-10
tags:
- attack.privilege-escalation
- attack.persistence
- attack.t1098.003
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue: MICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/WRITE
ActivityStatusValue:
- Start
- Started
Properties|contains:
- 8e3af657-a8ff-443c-a75c-2fe8c4bcb635
- 18d7d88d-d35e-4fb5-a5c3-7773c20a72d9
- f58310d9-a9f6-439a-9e8d-f62e7b41a168
- b24988ac-6180-42a0-ab88-20f7382dd24c
condition: selection
falsepositives:
- Planned access changes by platform administrators or infrastructure-as-code pipelines; correlate with change records.
- Role Based Access Control Administrator assigned with a condition that limits what the holder can assign, which is the delegation pattern Microsoft recommends; read the condition in the request body.
- A request that starts and then fails validation (for example a duplicate assignment); confirm the assignment exists.
level: high
False positives
- Planned access changes by platform administrators or infrastructure-as-code pipelines; correlate with change records.
- Role Based Access Control Administrator assigned with a condition that limits what the holder can assign, which is the delegation pattern Microsoft recommends; read the condition in the request body.
- A request that starts and then fails validation (for example a duplicate assignment); confirm the assignment exists.
Azure Role Assigned That Gives Control of a Workload or Its Identity
Detects an Azure role assignment request for one of ten built-in roles that do not manage access themselves but give control of workloads, of the identities they run with or of the guardrails around them: Virtual Machine Contributor, Virtual Machine Administrator Login, Azure Kubernetes Service Contributor Role, Automation Contributor, Logic App Contributor, Website Contributor, Key Vault Contributor, Avere Contributor, Managed Identity Operator and Resource Policy Contributor. The roles are identified by the built-in role definition IDs in the request body. Microsoft documents the request body on the event that records the start of the operation (status Start in AzureActivity, Started in the REST schema). A started request can still fail, so check that the assignment exists. These roles are assigned in normal operations far more often than Owner, so use the rule to review who receives them and at which scope. Confirm the match on a real event in your own workspace before you rely on this rule.
title: Azure Role Assigned That Gives Control of a Workload or Its Identity
id: b4b893f3-4f09-47e7-9989-f09b6fc4c91d
status: experimental
description: >-
Detects an Azure role assignment request for one of ten built-in roles that
do not manage access themselves but give control of workloads, of the
identities they run with or of the guardrails around them: Virtual Machine
Contributor, Virtual Machine Administrator Login, Azure Kubernetes Service
Contributor Role, Automation Contributor, Logic App Contributor, Website
Contributor, Key Vault Contributor, Avere Contributor, Managed Identity
Operator and Resource Policy Contributor. The roles are identified by the
built-in role definition IDs in the request body. Microsoft documents the
request body on the event that records the start of the operation (status
Start in AzureActivity, Started in the REST schema). A started request can
still fail, so check that the assignment exists. These roles are assigned in
normal operations far more often than Owner, so use the rule to review who
receives them and at which scope. Confirm the match on a real event in your
own workspace before you rely on this rule.
references:
- https://attack.mitre.org/techniques/T1098/003/
- https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles
- https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-alert
- https://learn.microsoft.com/en-us/azure/role-based-access-control/change-history-report
author: Forestall
date: 2026-11-18
tags:
- attack.privilege-escalation
- attack.persistence
- attack.t1098.003
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue: MICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/WRITE
ActivityStatusValue:
- Start
- Started
Properties|contains:
- 9980e02c-c2be-4d73-94e8-173b1dc7cf3c
- 1c0163c0-47e6-4577-8991-ea5c82e286e4
- ed7f3fbd-7b88-4dd4-9017-9adb7ce333f8
- f353d9bd-d4a6-484e-a77a-8050b599b867
- 87a39d53-fc1b-424a-814c-f7e04687dc9e
- de139f84-1756-47ae-9be6-808fbbe84772
- f25e0fa2-a7c8-4377-a976-54943a77a395
- 4f8fab4f-1852-4a58-a46a-8eaf358af14a
- f1a07417-d97a-45cb-824c-7a7467783830
- 36243c78-bf99-498c-9df9-86d9f8d28608
condition: selection
falsepositives:
- Onboarding of operators, applications and deployment pipelines, which receive these roles as part of normal work. Correlate with change records and exclude the identities that assign them routinely in a filter_ selection by Caller.
- Assignments at the scope of a single resource to the team that owns it. The scope is in the request body.
- A request that starts and then fails validation (for example a duplicate assignment). Confirm the assignment exists.
level: medium
False positives
- Onboarding of operators, applications and deployment pipelines, which receive these roles as part of normal work. Correlate with change records and exclude the identities that assign them routinely in a filter_ selection by Caller.
- Assignments at the scope of a single resource to the team that owns it. The scope is in the request body.
- A request that starts and then fails validation (for example a duplicate assignment). Confirm the assignment exists.
Azure Resource Role Assigned Through Privileged Identity Management
Detects an eligible or active assignment of an Azure resource role that was completed through Privileged Identity Management (PIM). PIM writes these activities to the Microsoft Entra audit log under the category ResourceManagement, which separates them from the same activity names for Microsoft Entra roles (RoleManagement) and for groups (GroupManagement). An eligible assignment gives no access until it is activated, which makes it a quiet way to keep a path to Owner or another privileged role. Microsoft's security operations guide for PIM lists the eligible assignment as an activity to always alert on. The rule matches on the category and the activity name only and so fires for every role. Microsoft documents that the role is one of the targets of the audit event (type Role), so read the role, the member and the scope there.
title: Azure Resource Role Assigned Through Privileged Identity Management
id: ffae3795-f9ee-4aa8-82b3-c930f4256243
status: experimental
description: >-
Detects an eligible or active assignment of an Azure resource role that was
completed through Privileged Identity Management (PIM). PIM writes these
activities to the Microsoft Entra audit log under the category
ResourceManagement, which separates them from the same activity names for
Microsoft Entra roles (RoleManagement) and for groups (GroupManagement). An
eligible assignment gives no access until it is activated, which makes it a
quiet way to keep a path to Owner or another privileged role. Microsoft's
security operations guide for PIM lists the eligible assignment as an
activity to always alert on. The rule matches on the category and the
activity name only and so fires for every role. Microsoft documents that
the role is one of the targets of the audit event (type Role), so read the
role, the member and the scope there.
references:
- https://attack.mitre.org/techniques/T1098/003/
- https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
- https://learn.microsoft.com/en-us/entra/architecture/security-operations-privileged-identity-management
- https://learn.microsoft.com/en-us/entra/id-governance/privileged-identity-management/azure-pim-resource-rbac
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098.003
logsource:
product: azure
service: auditlogs
detection:
selection:
Category: ResourceManagement
OperationName:
- Add eligible member to role in PIM completed (permanent)
- Add eligible member to role in PIM completed (timebound)
- Add member to role in PIM completed (permanent)
- Add member to role in PIM completed (timebound)
filter_failed:
Result: failure
condition: selection and not filter_failed
falsepositives:
- Planned assignments by the administrators who run PIM for Azure resources, including renewals of expiring assignments. Match each one to an access request, and exclude roles with little privilege in a filter_ selection on TargetResources once you know how role names appear in your events.
level: medium
False positives
- Planned assignments by the administrators who run PIM for Azure resources, including renewals of expiring assignments. Match each one to an access request, and exclude roles with little privilege in a filter_ selection on TargetResources once you know how role names appear in your events.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
Privileged role assigned, then the new assignee changes resources for the first time
A role assignment only matters once it is used. An assignee that starts to write, delete or run actions on resources shortly after it received the role, and never did so in the scope before, is the difference between an access change on paper and an attacker who granted the role in order to use it.
- In the Azure Activity log, take the start event of
MICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/WRITEand readPrincipalId,PrincipalType,RoleDefinitionIdandScopefrom the request body inProperties. Confirm the Success event with the same correlation ID. - Resolve the
PrincipalIdin Microsoft Entra ID. Microsoft documentsCalleras the email address or user principal name of a user, and as the object ID when a service principal writes role assignments, so search for the assignee in both forms. - Within 24 hours, look for Activity log events with that
Callerand a resource ID under the assignedScope. - Keep the cases where the same
Callerhas no event under that scope in the 30 days before the assignment.
EventsMICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/WRITE
LimitsA new team member or a new pipeline identity behaves the same way on its first day, so the result has to be matched with change records. The Activity log has no read operations, so an assignee that only reads data is not seen. The windows of 24 hours and 30 days are starting points.
Privileged role assigned to a principal that was created shortly before
Attackers prefer to give a role to an account they made themselves, such as a new user, an invited guest or a new service principal, because nobody misses it. A privileged assignment whose assignee did not exist a few hours earlier joins two events that look harmless one by one.
- In the Microsoft Entra audit log, collect the object IDs in
TargetResourcesof the activitiesAdd user,Invite external userandAdd service principal. - In the Azure Activity log, take the start events of
MICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/WRITEwhose request body inPropertiescarries one of the role definition IDs of the rules on this page. - Join the
PrincipalIdof the request body with the object IDs of the first step, where the creation is at most 24 hours older than the assignment.
EventsMICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/WRITEAdd userInvite external userAdd service principal
LimitsOnboarding and infrastructure-as-code create an identity and assign its role in one run, so the creating identities have to be excluded by name. It needs the Microsoft Entra audit log next to the Activity log. The 24 hours are a starting point, and an attacker who waits longer does not match.
Privileged role assigned and removed again shortly after
An attacker who needs the role for one action assigns it, uses it and deletes the assignment, so that a later access review shows nothing. An assignment and its deletion within a short time, outside Privileged Identity Management, is rarely administrative work.
- In the Azure Activity log, a privileged role is assigned:
MICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/WRITEwith one of the role definition IDs of the rules on this page in the request body. Keep the resource ID of the event, which names the role assignment. - Within 4 hours the same role assignment is deleted:
MICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/DELETEwith status Success and the same resource ID. - Between the two events, review the Activity log events of the assignee under the assigned scope.
EventsMICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/WRITEMICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/DELETE
LimitsJust-in-time access tools and test pipelines assign and remove roles on purpose and have to be excluded by caller. The 4 hours are a starting point. An assignment that is kept does not match and is covered by the single-event rules.
Triage
- Identify the role, the scope and the new assignee from the request body in the event Properties, and who made the change (Caller). Confirm that the operation completed by finding the second event with the same correlation ID and status Success.
- Check whether the assignee is a guest, a newly created account or a service principal with fresh credentials.
- Remove unexplained assignments and review activity by the assignee since the change.
Response
Once the attack is confirmed:
- Block the assignee, not only the assignment. Disable the guest or user, or remove the credentials of the service principal, so the same identity cannot be given the role again unnoticed.
- Contain the caller that made the assignment. Revoke its sessions, rotate its credentials and remove its right to write role assignments until the change is explained.
- If the role was Owner, User Access Administrator or Role Based Access Control Administrator, list the role assignments the assignee created in turn and remove them. Each of them can outlive the first one.
- Review what the assignee could reach in the scope and rotate it, such as Key Vault contents, storage account keys, credentials on virtual machines and the access of managed identities.
- List the role assignments at the scope, at its parent scopes and at root scope after cleanup, and compare them with the approved state.
Mitigation
- Use Privileged Identity Management for eligible, time-bound Owner and User Access Administrator assignments with approval.
- Avoid assigning privileged roles to guests and service principals; scope assignments to resource groups instead of subscriptions.
- Alert on privileged role assignments and on use of the Global Administrator elevate-access option.
Frequently asked questions
How do we confirm that the role assignment was really created?
The rules match the event that records the start of the request, because that is where Microsoft documents the request body with the role definition ID. A started request can still fail. Look for the second event with the same correlation ID and status Success, or list the role assignments at the scope.
Does the rule catch a custom role that carries the same rights?
No. One rule identifies Owner, User Access Administrator, Role Based Access Control Administrator and Contributor by their built-in role definition IDs, and a second rule does the same for ten built-in roles that give control of workloads, identities or policy. A custom role that includes the right to write role assignments is not matched, and neither are the remaining built-in roles. Monitor changes to custom role definitions separately.
Is every Role Based Access Control Administrator assignment a problem?
No. Assigning that role with a condition that limits what the holder can assign is the delegation pattern Microsoft recommends. Read the condition in the request body. An assignment without a condition lets the holder create further role assignments in the scope.
Why is Contributor in the rule when it cannot assign roles?
Contributor can manage every resource in the scope. That includes running commands on virtual machines and reading Key Vault data through the resources that use it, which gives control over the workloads and identities there. The rule therefore treats it as a privileged role.
References
- MITRE ATT&CK T1098.003: Additional Cloud Roles
- Azure built-in roles
- Elevate access to manage all Azure subscriptions
- View activity logs for Azure RBAC changes
- Alert on privileged Azure role assignments
- Azure permissions for Management and governance
- Microsoft Entra audit log activity reference
- Configure deployment credentials for Azure App Service
- Azure built-in roles for Security