How the attack works
Application permissions (app roles) let a service principal call Microsoft Graph as itself, with no signed-in user, no MFA and no user Conditional Access. A handful of them carry the weight of a Tier 0 directory role. RoleManagement.ReadWrite.Directory manages directory role membership, so the application can make any principal a Global Administrator. AppRoleAssignment.ReadWrite.All manages grants of application permissions for any API, so the application can give itself any other permission; Microsoft warns that both let an application grant additional privileges to itself, other applications or any user. Application.ReadWrite.All can add credentials to every application, UserAuthenticationMethod.ReadWrite.All writes the authentication methods of all users, and Domain.ReadWrite.All can add, verify and change domains.
Granting one of these needs Privileged Role Administrator or Global Administrator, or an application that already holds AppRoleAssignment.ReadWrite.All. Attackers who reach that level grant the permission to a service principal they control, because the application keeps working after the administrator account they used is cleaned up. Core Directory logs each grant as Add app role assignment to service principal; the permission name is in TargetResources as the AppRole.Value modified property, which is what the rule matches.
What an attacker needs
- A compromised identity with Privileged Role Administrator or Global Administrator, or an application that holds
AppRoleAssignment.ReadWrite.All. - A service principal the attacker controls, or can add a credential to.
Impact
An application identity that can reach Global Administrator in one or two calls and that is not subject to user MFA: assigning roles, granting itself further permissions, adding credentials to other applications or changing the authentication methods of users. The grant survives password resets and removal of the account that made it.
Detection rules
Tier 0 Microsoft Graph Application Permission Granted to a Service Principal
Detects an app role assignment whose permission name (AppRole.Value in TargetResources) is one of the Microsoft Graph application permissions that can assign directory roles, grant permissions, manage application credentials, write user credentials or change domains and group membership. Any of them can lead to Global Administrator.
title: Tier 0 Microsoft Graph Application Permission Granted to a Service Principal
id: dde744d4-6d77-4e15-9005-7955d226b2e5
status: experimental
description: >-
Detects an app role assignment whose permission name (AppRole.Value in
TargetResources) is one of the Microsoft Graph application permissions that
can assign directory roles, grant permissions, manage application
credentials, write user credentials or change domains and group
membership. Any of them can lead to Global Administrator.
references:
- https://learn.microsoft.com/en-us/entra/architecture/security-operations-applications
- https://learn.microsoft.com/en-us/graph/permissions-reference
author: Forestall
date: 2026-11-11
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098.003
logsource:
product: azure
service: auditlogs
detection:
selection:
OperationName: Add app role assignment to service principal
TargetResources|contains:
- RoleManagement.ReadWrite.Directory
- AppRoleAssignment.ReadWrite.All
- Application.ReadWrite.All
- Directory.ReadWrite.All
- RoleAssignmentSchedule.ReadWrite.Directory
- RoleEligibilitySchedule.ReadWrite.Directory
- PrivilegedAccess.ReadWrite.AzureADGroup
- PrivilegedAssignmentSchedule.ReadWrite.AzureADGroup
- PrivilegedEligibilitySchedule.ReadWrite.AzureADGroup
- UserAuthenticationMethod.ReadWrite.All
- User-PasswordProfile.ReadWrite.All
- Domain.ReadWrite.All
- Domain-InternalFederation.ReadWrite.All
- Group.ReadWrite.All
- GroupMember.ReadWrite.All
filter_failed:
Result: failure
condition: selection and not filter_failed
falsepositives:
- Onboarding of identity governance, provisioning and security tools that need these permissions; confirm a change record and filter the approved service principals by object ID in TargetResources.
- The list is a starting point; align it with the permissions you treat as Tier 0.
level: high
False positives
- Onboarding of identity governance, provisioning and security tools that need these permissions; confirm a change record and filter the approved service principals by object ID in TargetResources.
- The list is a starting point; align it with the permissions you treat as Tier 0.
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.
Tier 0 permission granted, then used through Microsoft Graph with a client secret
The grant is one event, and many grants are planned work. What separates an attack is what follows: the application starts to call Microsoft Graph with the new permission, often with a client secret and from an address it never used. The Microsoft Graph activity log shows that use, which the audit log does not.
- Audit log: activity
Add app role assignment to service principalwith one of the permissions of the rule on this page inTargetResources. Take the service principal that received it. - Microsoft Graph activity log, for the following 7 days: requests whose
ServicePrincipalIdis that service principal and whoseRolescontain the permission. - Read
ClientAuthMethod(1 is client ID and client secret, 2 is a client certificate),IPAddress,RequestMethodandRequestUriof those requests. - Alert when the requests are made with a client secret from an address the application has not used before, and raise the priority for requests other than GET.
EventsAdd app role assignment to service principal
LimitsAn application that received the permission for a real integration starts to use it in the same way, so confirm the grant first. The Microsoft Graph activity log has to be collected separately and Microsoft states that events can take up to 2 hours to arrive. The 7 days are a starting point, and calls to APIs other than Microsoft Graph are not in this log.
Triage
- Read the permission (AppRole.Value) and the receiving service principal in TargetResources, and the actor in InitiatedBy; a grant made by an application rather than an administrator needs extra scrutiny.
- Check who owns the service principal and its application, and which credentials were added to it recently.
- Review the service principal's sign-ins and the audit log for role assignments, permission grants or credential additions it made after the grant.
- If unauthorized, remove the app role assignment, disable the service principal, remove unknown credentials and review every change it made.
Response
Once the attack is confirmed:
- Disable the service principal that received the permission, then remove the app role assignment.
- Remove the credentials on the service principal and its application that nobody can explain, and check their owners.
- Review what the service principal did after the grant (role assignments, further permission grants, credentials added to other applications, changes to authentication methods or domains) and undo each change.
- Treat every identity the service principal promoted or gave credentials to as part of the incident and handle it in the same way.
- Revoke the sessions and reset the credentials of the identity that made the grant. If an application made it, review who controls that application.
- Compare the holders of these permissions across the tenant with the applications you approved.
Mitigation
- Keep these permissions off service principals wherever a narrower permission works, and review the existing holders regularly.
- Limit Privileged Role Administrator and Global Administrator to a few PIM-managed accounts, and treat any application holding
AppRoleAssignment.ReadWrite.Allas Tier 0. - Restrict who can own or add credentials to the applications that must keep such a permission, and alert on credential and owner changes to them.
- Require a change record for every admin consent to an application permission.
Frequently asked questions
Why is an application permission harder to contain than an administrator account?
A service principal calls Microsoft Graph as itself, with no signed-in user, no MFA and no user Conditional Access. The grant survives password resets and the removal of the account that made it. It ends only when the app role assignment is removed or the service principal is disabled.
Can an application grant itself one of these permissions?
Yes, if it already holds `AppRoleAssignment.ReadWrite.All`. That permission manages grants of application permissions for any API, so the application can give itself any other one. A grant whose actor is an application and not an administrator needs extra scrutiny for that reason.
Does the rule see delegated permissions being granted?
No. It matches `Add app role assignment to service principal`, which is how an application permission is granted. A delegated permission is granted through consent and is logged as a different activity. The permission list in the rule is also a starting point, so align it with what you treat as Tier 0.
References
- MITRE ATT&CK T1098.003: Additional Cloud Roles
- Microsoft Entra security operations guide for applications (applications granted highly privileged permissions)
- Microsoft Graph permissions reference
- Microsoft Entra audit log activities (Core Directory)
- Microsoft Graph activity logs overview (columns Roles, ClientAuthMethod, ServicePrincipalId)