Join our Newsletter — 33% off our NHI Course
Home› Guides› How to detect new privileged Azure role assignments:…
Guide SOC & Detection Engineering

How to detect new privileged Azure role assignments: alerts for Owner, UAA, PIM and elevation

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 28 November 2026 15 min read
On this page

A new Owner or User Access Administrator assignment in Azure hands an identity the power to grant itself or anyone else access to everything in scope, and the event that records it is easy to miss among thousands of routine changes. This runbook covers detection, not the audit of standing access: which log records each kind of privileged grant (Azure RBAC role assignments, PIM activations and assignments, and the Global Administrator elevate access toggle), how to get those logs somewhere you can query them, sample alert logic, and how to triage a hit. It is for detection engineers and cloud security teams running Azure subscriptions under one or many management groups. For the one-off clean-up of existing assignments, see How to Audit Azure Owner and User Access Administrator Assignments.

This is an independent guide from NHI Mgmt Group, based on Microsoft's public Azure RBAC documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.

Key takeaways

  • Three privileged grant paths, three logs. Direct RBAC assignments land in the Azure activity log, PIM requests and activations in the Microsoft Entra audit log, and elevate access in the Entra audit log under the service Azure RBAC (Elevated Access). A detection that watches only one of them has gaps.
  • The role is inside the request body. The activity log operation Microsoft.Authorization/roleAssignments/write does not carry the role as a top-level field; Microsoft documents that the role definition ID, principal ID, principal type and scope sit inside the requestbody string, so alert logic has to parse or match it.
  • Match role definition IDs, not names. Built-in role IDs are fixed GUIDs (Owner is 8e3af657-a8ff-443c-a75c-2fe8c4bcb635), while names can be duplicated by custom roles.
  • 90 days is the default ceiling. The activity log keeps events for 90 days; export it with diagnostic settings at subscription and management group level, or you lose history and cannot alert with complex logic.
  • A grant outside PIM is the high-value signal. PIM records "Add member to role outside of PIM (permanent)" for resource roles; in an estate where privileged roles are meant to be eligible only, any active grant that bypasses PIM deserves a page.

When you need this

Role assignment is the mechanism an intruder uses to keep and widen control in Azure. MITRE ATT&CK records it as T1098.003 Additional Cloud Roles, usually after a cloud account has been taken over (T1078.004 Cloud Accounts). Build or review these detections when:

  • Standing access has been cleaned up: after an audit reduced Owner and User Access Administrator holders, you need to know the day the count goes back up.
  • PIM has been rolled out: you want to confirm privileged roles are only ever activated through PIM, with approval and justification, and catch anything that bypasses it.
  • Workload identities hold role-granting rights: a service principal or managed identity with Owner, User Access Administrator or Role Based Access Control Administrator can create assignments without any human sign-in. See the Azure RBAC and Service Principals Guide.
  • Global Administrators exist: any of them can turn on elevate access and become User Access Administrator at root scope. See Elevate Access in Azure.

What counts as privileged

Microsoft groups the following built-in roles in the Privileged category of its built-in roles reference. Use the GUIDs in detection logic.

Built-in roleRole definition IDWhy it matters for detection
Owner8e3af657-a8ff-443c-a75c-2fe8c4bcb635Full management plus the right to assign roles
User Access Administrator18d7d88d-d35e-4fb5-a5c3-7773c20a72d9Manages access; can grant any role, including Owner
Role Based Access Control Administratorf58310d9-a9f6-439a-9e8d-f62e7b41a168Assigns roles through Azure RBAC; often conditioned, check the condition
Contributorb24988ac-6180-42a0-ab88-20f7382dd24cFull management without role assignment; high impact on production scopes
Reservations Administratora8889054-8d42-49c9-bc1c-52486c10e7cdTenant-wide reservation management; lower security impact, usually a lower severity

Add your own custom roles whose actions include Microsoft.Authorization/roleAssignments/write or *. A custom role with those actions is as dangerous as User Access Administrator and will not match a list of built-in GUIDs.

Before you start

  • Know the signals: the table below lists every event this guide uses.
  • Permissions: reading the activity log needs Reader on the scope; viewing PIM audit history for resources needs at least Privileged Role Administrator, according to Microsoft's PIM documentation; creating diagnostic settings needs a role with Microsoft.Insights/diagnosticSettings/write on each subscription or management group.
  • A workspace: a Log Analytics workspace (with or without Microsoft Sentinel) or a SIEM that receives Azure Monitor exports.
  • An approved change source: a ticketing or infrastructure-as-code pipeline whose identity and change IDs you can join to, so you can separate expected grants from unexpected ones.
Grant pathLog and tableEvent to matchKey fields
Direct RBAC assignment (portal, CLI, ARM, Bicep, Terraform, API)Azure activity log, category Administrative; AzureActivity in Log AnalyticsOperation Microsoft.Authorization/roleAssignments/write, status SucceededCaller, ResourceId (scope), requestbody with RoleDefinitionId, PrincipalId, PrincipalType, Scope
Assignment removedAzure activity logMicrosoft.Authorization/roleAssignments/deleteUseful to measure how long a suspect grant lived
Custom role created or changedAzure activity logMicrosoft.Authorization/roleDefinitions/writeActions list in the request; watch for role assignment rights
PIM activation of a resource roleEntra audit log, category ResourceManagement; AuditLogs"Add member to role requested (PIM activation)", "Add member to role completed (PIM activation)", "Add member to role request approved (PIM activation)"Actor, target role, resource, status reason (justification), ticket number
PIM active or eligible assignment createdEntra audit log, category ResourceManagement"Add member to role in PIM completed (permanent)", "Add member to role in PIM completed (timebound)", "Add eligible member to role in PIM completed (permanent)"Permanent active assignments are the ones to escalate
Grant made outside PIMEntra audit log, category ResourceManagement"Add member to role outside of PIM (permanent)"Actor, role, resource
Elevate access by a Global AdministratorEntra audit log, category AzureRBACRoleManagementElevateAccess, service Azure RBAC (Elevated Access)"User has elevated their access to User Access Administrator for their Azure Resources"Initiating user; removal message "The role assignment of User Access Administrator has been removed from the user"

Microsoft labels the elevate access entries in the Entra audit log as a preview. Keep a second detection on the activity log for assignments at root scope / so you are not relying on a preview feature alone. For field meanings in the Entra audit log, see the Entra ID Audit Log Detection Guide.

Step-by-step

  1. Export the activity log at every level. Create a diagnostic setting on each subscription that sends the Administrative category to your workspace, and one on the root or top management group. Microsoft states that a management group setting exports events for that group and every group beneath it, but does not capture every subscription-level event, so you need both. If both point at the same workspace you will see duplicates; Microsoft's activity log article gives a hash-based KQL pattern to remove them. Enforce subscription settings with Azure Policy so new subscriptions are not blind. See the Azure Monitor, Activity Log and Diagnostic Settings Guide.
  2. Export the Entra audit log. Add a Microsoft Entra diagnostic setting (or the Microsoft Entra ID data connector in Sentinel, with Audit Logs selected) so PIM and elevate access events reach the same workspace. This is a separate setting from the Azure activity log export.
  3. Write the base RBAC query. Start from Microsoft's own sample, which filters AzureActivity on Authorization contains "Microsoft.Authorization/roleAssignments/write" and ActivityStatus == "Succeeded". Then add a filter that matches the privileged role GUIDs inside the event properties. A sample to adapt (label: sample, test in your workspace before use):

    1 Sample only, based on the public documentation cited. Assess it independently against the current official documentation, test outside production and back up first.

    Sample 1
    // Sample: new privileged Azure role assignments
    let privRoles = dynamic(["8e3af657-a8ff-443c-a75c-2fe8c4bcb635",
      "18d7d88d-d35e-4fb5-a5c3-7773c20a72d9",
      "f58310d9-a9f6-439a-9e8d-f62e7b41a168"]);
    AzureActivity
    | where OperationNameValue =~ "Microsoft.Authorization/roleAssignments/write"
    | where ActivityStatusValue =~ "Success" or ActivityStatus =~ "Succeeded"
    | where Properties has_any (privRoles)
    | project TimeGenerated, Caller, CallerIpAddress, ResourceId, Properties
    Microsoft notes some field values differ in casing, so keep comparisons case-insensitive (=~). Column names and status values can vary between the legacy and current schema of AzureActivity; check a known test event first.
  4. Add severity by scope. Parse the scope from ResourceId or the request body and grade it: root / and management group scopes are highest, then production subscriptions, then resource groups. A User Access Administrator grant at a management group outranks a Contributor grant on a sandbox resource group.
  5. Add severity by principal type. PrincipalType in the request body is User, Group or ServicePrincipal. Group grants need a follow-up: who can change membership of that group? Service principal grants need the owner of the app registration or managed identity. If a service principal made the change, Microsoft notes that Caller is its object ID, not a name; resolve it with Get-AzADServicePrincipal or a lookup table.
  6. Join to approved change. Suppress, do not delete, events from your deployment pipeline identity when they carry a change reference, and alert on everything else. Keep the suppressed events in a weekly report so a compromised pipeline identity is still visible.
  7. Build the PIM rules. In AuditLogs, alert on "Add member to role outside of PIM (permanent)" and "Add member to role in PIM completed (permanent)" for privileged roles at high severity. Send activations ("Add member to role completed (PIM activation)") to a lower-severity rule that checks for activations at unusual hours, by users who rarely activate, or without a ticket number in the details.
  8. Turn on elevate access detection. Microsoft's elevate access article describes enabling the Azure RBAC (Elevate Access) analytics rule template in Microsoft Sentinel after connecting Entra audit logs. Without Sentinel, alert on the same audit message, and add the activity log check for assignments at scope /.
  9. Choose the alert type. Activity log alert rules are event-driven and can be scoped to a subscription or, through the tenantScope property, to a tenant or management group, but Microsoft describes them as matching top-level event properties. The role ID sits inside the request body, so use a log search alert (KQL) when you need to filter on the role, and keep an activity log alert on any roleAssignments/write at management group scope as a cheap backstop.
  10. Route and document. Send high-severity hits to the on-call channel with the principal, role, scope, caller and IP in the alert. Attach a triage runbook (see "Verify it worked" for what to check).

Choosing where to run it

OptionFitsTrade-off
Activity log alert ruleSmall estate, a few subscriptions, no workspace yetCheap and simple; cannot filter on the role inside the request body, so expect more noise
Log search alert in Log AnalyticsMost organisationsFull KQL with joins and severity logic; runs on a schedule, so allow for ingestion and evaluation delay
Microsoft Sentinel analytics rulesTeams with a SOC using SentinelIncident handling, entity mapping and the elevate access template; workspace cost
Third-party SIEM via Event Hubs exportMulti-cloud SOCs with an existing SIEMOne console for all clouds; you maintain parsing of requestbody yourself

Small vs large organisations: with one or two subscriptions, a log search alert on all three privileged roles plus elevate access is enough, and every hit can be reviewed by hand. With hundreds of subscriptions, severity grading by scope and change-record joins are what keep the rule usable; without them the alert is muted within weeks.

Verify it worked

Test in a non-production subscription with a test user, then remove the assignment.

  1. Direct grant: assign Reader, then Owner, to the test user on a test resource group. Confirm the Owner event reaches the workspace, fires the rule, and the Reader event does not.
  2. Management group grant: assign a role at a test management group and confirm the event arrives through the management group diagnostic setting.
  3. Service principal grant: grant a role to a test service principal and confirm PrincipalType is parsed and the alert names it.
  4. PIM: create a permanent active assignment and an activation for a test eligible user, and confirm both audit messages appear with the right severity.
  5. Elevate access: with change approval, have a Global Administrator toggle elevate access on and off in a test tenant or agreed window, and confirm both the Entra audit rule and the root-scope activity log rule fire.

When a real alert fires, triage in this order: is the caller expected (pipeline, named admin)? Is there a change record? What scope and role? Has the new principal done anything since (search AzureActivity by the principal as caller)? If the grant is unexplained, remove it, then follow the Azure Subscription Compromise Playbook.

Rollback and common errors

These detections change no access, so rollback means disabling or tuning a rule, never removing logging. Keep diagnostic settings in place even while a rule is paused.

  • No events in the workspace: the diagnostic setting is missing on that subscription, or the Administrative category is not selected, or a legacy log profile is still configured (Microsoft says to disable it).
  • Management group grants never alert: only subscription settings exist. Add the management group setting.
  • Rule matches nothing after a schema change: legacy and current AzureActivity columns differ; rebuild against a fresh test event.
  • Alert floods from the pipeline: suppress by the pipeline identity plus change reference, not by role or scope.
  • Caller shows a GUID: expected for service principals and managed identities; add a lookup, do not filter it out.

Hardening afterwards

  • Make privileged roles eligible, not active: move human Owner and User Access Administrator access into PIM with approval, so any active permanent grant is an anomaly. See the Privileged Identity Management (PIM) Guide.
  • Constrain delegation: prefer Role Based Access Control Administrator with a condition that limits which roles can be assigned over unconditioned User Access Administrator.
  • Remove role-granting rights from workload identities: few pipelines genuinely need to create role assignments; scope those that do to a resource group. See the Azure Managed Identities Security Guide.
  • Keep elevate access off: set the toggle back to No after every use; Microsoft notes that deactivating a PIM role does not reset it.
  • Retain logs beyond 90 days: Microsoft states there is no ingestion charge for activity logs and retention can be extended up to 12 years, so keep at least the period your investigations need.

Metrics

  • Coverage: percentage of subscriptions and management groups with an Administrative-category diagnostic setting (target 100%).
  • Unapproved privileged grants: alerts per month with no matching change record, trended.
  • Grants outside PIM: count of "Add member to role outside of PIM (permanent)" events for privileged roles (target zero).
  • Time to triage: median time from alert to a closed decision for high-severity grants.
  • Elevation duration: median time between elevate access on and removal.
  • Test pass rate: quarterly synthetic grants (step "Verify it worked") detected end to end.

Framework mapping

FrameworkReferenceHow this guide supports it
MITRE ATT&CK v20T1098.003 Additional Cloud Roles; T1078.004 Cloud AccountsDetects role grants used for persistence and escalation from a compromised cloud account
NIST SP 800-53 Rev 5AC-2(4) Automated Audit Actions; AC-2(7) Privileged User Accounts; AC-6(9) Log Use of Privileged Functions; AU-6 Audit Record Review, Analysis, and Reporting; AU-12 Audit Record GenerationLogging and automated review of privileged account changes
NIST CSF 2.0DE.CM-03; DE.AE-02; PR.AA-05Monitoring personnel and technology activity, analysing adverse events, enforcing least privilege
CIS Controls v8.1Control 8 Audit Log Management; Control 6 Access Control ManagementCollecting and reviewing audit logs; managing privileged access changes

Common failure patterns

  • Watching names, not IDs: a custom role called "Owner (break glass)" or a renamed role slips past string matching; match GUIDs and role assignment actions.
  • Only subscription-level logging: the most powerful grants happen at management group and root scope, which subscription settings alone can miss.
  • Ignoring group grants: assigning Owner to a group and then adding members through Entra moves the change out of the activity log; pair this guide with Entra group membership monitoring.
  • Trusting PIM to catch everything: Microsoft notes that role assignments authorised through an Azure Lighthouse service provider do not appear in PIM, and direct ARM assignments still happen. Watch the activity log as well. See the Azure Lighthouse Security Guide.
  • Blanket pipeline suppression: excluding the deployment identity entirely turns its compromise into a blind spot.

Practitioner checklist

  • Diagnostic settings export the Administrative category from every subscription and from the top management group.
  • Entra audit logs are exported to the same workspace.
  • A log search alert matches roleAssignments/write for Owner, User Access Administrator, Role Based Access Control Administrator and custom role-granting roles by GUID.
  • Severity is graded by scope and principal type.
  • PIM rules alert on grants outside PIM and permanent active assignments.
  • Elevate access is detected in the Entra audit log and by root-scope assignments in the activity log.
  • Pipeline grants are suppressed only with a change reference and reported weekly.
  • Synthetic grants are tested end to end each quarter.

Standards and references

Related NHI Mgmt Group resources: How to Audit Azure Owner and User Access Administrator Assignments · Elevate Access in Azure · Privileged Identity Management (PIM) Guide · Entra ID Audit Log Detection Guide · Azure Subscription Compromise Playbook

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.