1. Resources
  2. Detection rules
  3. Illicit Consent Grant

Illicit Consent Grant detection rules

A user or admin is tricked into consenting to a malicious OAuth application, which then reads mail and files through Microsoft Graph without the user's password or MFA.

Platform
Microsoft Entra ID
Severity
High
Log source
Microsoft Entra ID audit logs
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
User consent to applications allowed in the tenant, or an administrator who can be convinced to grant admin consent to the attacker's application.
Impact
Persistent, MFA-independent access to mailboxes, OneDrive and SharePoint content and any other API the consent covers, which a password reset does not cut off.
Response
Disable sign-in for the service principal of the malicious application, then remove its delegated permission grants and app role assignments for every user.
Mitigation
Restrict user consent to verified publishers and low-risk permissions, and require the admin consent workflow for everything else.
Audit activities
Add app role assignment to service principalConsent to applicationAdd delegated permission grant

How the attack works

Microsoft Entra ID lets users and administrators grant third-party applications access to their data through OAuth consent. In a consent phishing attack, the victim follows a link to a legitimate Microsoft sign-in page and approves permissions such as Mail.Read, Files.Read.All or offline_access for an application the attacker controls.

The resulting tokens belong to the application, not to a password, so resetting the user's password does not cut off access. Admin consent to application permissions (app role assignments) is worse: it grants tenant-wide access with no user present at all. A delegated permission that an administrator grants on behalf of all users reaches every user who signs in to the application, and a rule on this page reads that grant for high-privilege scopes. Another rule reads the consent attempts that Microsoft Entra ID stopped as risky, which show a consent phishing attempt that did not succeed.

What an attacker needs

  • User consent to applications allowed in the tenant, or an administrator who can be convinced to grant admin consent.
  • A multi-tenant application registered by the attacker with a convincing name and logo.

Impact

Persistent, MFA-independent access to mailboxes, OneDrive and SharePoint content, and any other API the consent covers. Attackers use it for business email compromise, data theft and internal phishing from a trusted account.

Detection rules

Application Permission Granted to a Service Principal

Detects an application permission (app role assignment) granted to a service principal. Unlike delegated consent, application permissions such as Mail.Read or Files.Read.All give tenant-wide access with no signed-in user.

LevelHighStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: Application Permission Granted to a Service Principal
id: 8029bf50-78c6-4b3f-964e-66535417ef9c
status: experimental
description: >-
  Detects an application permission (app role assignment) granted to a service
  principal. Unlike delegated consent, application permissions such as
  Mail.Read or Files.Read.All give tenant-wide access with no signed-in user.
references:
  - https://attack.mitre.org/techniques/T1528/
author: Forestall
date: 2026-11-10
tags:
  - attack.persistence
  - attack.t1528
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    OperationName: Add app role assignment to service principal
    Result: success
  condition: selection
falsepositives:
  - Administrators onboarding approved integrations; confirm a change record exists for each grant.
level: high

False positives

  • Administrators onboarding approved integrations; confirm a change record exists for each grant.

Consent Granted to an Application in Entra ID

Detects a successful OAuth consent to an application, by a user or an administrator. Each event deserves a quick review of the application and the permissions it received; consent phishing relies on nobody looking.

LevelMediumStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: Consent Granted to an Application in Entra ID
id: 922fb1b9-4a81-4b85-a62f-b7ac65863bdb
status: experimental
description: >-
  Detects a successful OAuth consent to an application, by a user or an
  administrator. Each event deserves a quick review of the application and the
  permissions it received; consent phishing relies on nobody looking.
references:
  - https://attack.mitre.org/techniques/T1528/
author: Forestall
date: 2026-11-10
tags:
  - attack.credential-access
  - attack.t1528
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    OperationName: Consent to application
    Result: success
  condition: selection
falsepositives:
  - Users adopting approved SaaS applications; allow-list known application IDs after review.
level: medium

False positives

  • Users adopting approved SaaS applications; allow-list known application IDs after review.

High-Privilege Delegated Permission Granted for All Users

Detects a delegated permission grant made on behalf of all users of the tenant (consent type AllPrincipals) whose scope includes a high-privilege permission. With such a grant the application can act with the rights of every user who signs in to it, for the granted scopes, and no user is asked again. Microsoft's security operations guide for applications rates this event as high risk and names the fields: the activity "Add delegated permission grant", DelegatedPermissionGrant.ConsentType with the value AllPrincipals and DelegatedPermissionGrant.Scope. Microsoft does not list which scopes count as high privilege. The list in this rule holds delegated permissions that write to the directory, to role assignments, to applications and their grants, to users, groups, authentication methods and Conditional Access, and that read or send mail or reach all files. Each name is in the Microsoft Graph permissions reference. Extend the list with the permissions you treat as sensitive.

LevelHighStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: High-Privilege Delegated Permission Granted for All Users
id: b20f5f06-6557-44ac-9e44-9acafc19bdc2
status: experimental
description: >-
  Detects a delegated permission grant made on behalf of all users of the
  tenant (consent type AllPrincipals) whose scope includes a high-privilege
  permission. With such a grant the application can act with the rights of
  every user who signs in to it, for the granted scopes, and no user is asked
  again. Microsoft's security operations guide for applications rates this
  event as high risk and names the fields: the activity "Add delegated
  permission grant", DelegatedPermissionGrant.ConsentType with the value
  AllPrincipals and DelegatedPermissionGrant.Scope. Microsoft does not list
  which scopes count as high privilege. The list in this rule holds delegated
  permissions that write to the directory, to role assignments, to
  applications and their grants, to users, groups, authentication methods and
  Conditional Access, and that read or send mail or reach all files. Each name
  is in the Microsoft Graph permissions reference. Extend the list with the
  permissions you treat as sensitive.
references:
  - https://learn.microsoft.com/en-us/entra/architecture/security-operations-applications
  - https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
  - https://learn.microsoft.com/en-us/graph/permissions-reference
  - https://attack.mitre.org/techniques/T1528/
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1528
logsource:
  product: azure
  service: auditlogs
detection:
  selection_activity:
    OperationName: Add delegated permission grant
    TargetResources|contains: AllPrincipals
  selection_scope:
    TargetResources|contains:
      - Directory.ReadWrite.All
      - Directory.AccessAsUser.All
      - RoleManagement.ReadWrite.Directory
      - AppRoleAssignment.ReadWrite.All
      - Application.ReadWrite.All
      - DelegatedPermissionGrant.ReadWrite.All
      - User.ReadWrite.All
      - Group.ReadWrite.All
      - UserAuthenticationMethod.ReadWrite.All
      - Policy.ReadWrite.ConditionalAccess
      - Mail.Read
      - Mail.Send
      - Files.ReadWrite.All
      - Sites.FullControl.All
      - EWS.AccessAsUser.All
  filter_failed:
    Result: failure
  condition: all of selection_* and not filter_failed
falsepositives:
  - Administrators who grant tenant-wide admin consent to an approved application, such as a mail client, a backup product or an administration tool. Confirm a change record and the publisher of the application for each grant.
  - Mail.Read also matches Mail.ReadWrite and Mail.ReadBasic, which is intended.
level: high

False positives

  • Administrators who grant tenant-wide admin consent to an approved application, such as a mail client, a backup product or an administration tool. Confirm a change record and the publisher of the application for each grant.
  • Mail.Read also matches Mail.ReadWrite and Mail.ReadBasic, which is intended.

User Consent Stopped by Risk-Based Step-Up Consent

Detects a consent attempt that Microsoft Entra ID stopped because it judged the request risky. Microsoft gives the example of a newly registered multitenant application that is not publisher verified and asks for permissions that are not basic: the user cannot consent and the request needs an administrator. No grant was made, so nothing has to be removed. The event still matters, because it says that a user was led to a consent prompt for such an application, which is how consent phishing starts. The same application may have been offered to other users. Microsoft documents the event as the activity "Consent to application" with a status reason, but its two pages give the reason differently: the security operations guide for applications writes Microsoft.online.Security.userConsentBlockedForRiskyAppsExceptions, and the page on risk-based step-up consent writes "Risky application detected". The rule matches either text in the ResultReason field.

LevelMediumStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: User Consent Stopped by Risk-Based Step-Up Consent
id: 47351ab9-9b89-4c0c-9b96-1611754afa3d
status: experimental
description: >-
  Detects a consent attempt that Microsoft Entra ID stopped because it judged
  the request risky. Microsoft gives the example of a newly registered
  multitenant application that is not publisher verified and asks for
  permissions that are not basic: the user cannot consent and the request
  needs an administrator. No grant was made, so nothing has to be removed. The
  event still matters, because it says that a user was led to a consent prompt
  for such an application, which is how consent phishing starts. The same
  application may have been offered to other users. Microsoft documents the
  event as the activity "Consent to application" with a status reason, but its
  two pages give the reason differently: the security operations guide for
  applications writes
  Microsoft.online.Security.userConsentBlockedForRiskyAppsExceptions, and the
  page on risk-based step-up consent writes "Risky application detected". The
  rule matches either text in the ResultReason field.
references:
  - https://learn.microsoft.com/en-us/entra/architecture/security-operations-applications
  - https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/configure-risk-based-step-up-consent
  - https://attack.mitre.org/techniques/T1528/
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1528
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    OperationName: Consent to application
    ResultReason|contains:
      - userConsentBlockedForRiskyAppsExceptions
      - Risky application detected
  condition: selection
falsepositives:
  - A user who tries a new but legitimate application from a publisher that is not verified. Check the application and its publisher, and have an administrator review the request if the application is needed.
level: medium

False positives

  • A user who tries a new but legitimate application from a publisher that is not verified. Check the application and its publisher, and have an administrator review the request if the application is needed.

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.

Consent given by an account that was created shortly before

Detection hypothesisSequence of events

An attacker who can create users makes a fresh account and uses it to consent to an application they control, so that the grant does not sit on a known person. Consent by an account that is only hours or days old is rarely ordinary use when the permissions are broad.

  1. A user is created: audit activity Add user, with the new account in TargetResources.
  2. Within 7 days that account grants access: Consent to application, Add delegated permission grant or Add app role assignment to service principal with the account in InitiatedBy.
  3. Read the application and the permissions in TargetResources, and check whether the application was added to the tenant in the same period.

EventsAdd userConsent to applicationAdd delegated permission grantAdd app role assignment to service principal

LimitsNew employees consent to the applications they need in their first days, so the hypothesis is strongest for administrator consent and for high-privilege permissions. The 7 days are a starting point.

Consent blocked as risky, then granted for the same application

Detection hypothesisSequence of events

A consent that Microsoft Entra ID stopped as risky shows that an application is being pushed to users. If consent to the same application succeeds afterwards, through another user or through an administrator who approved the request, the campaign reached its goal.

  1. A consent is stopped: activity Consent to application with a failure and the status reason of the risky application block. Keep the application from TargetResources.
  2. Within 14 days: a successful Consent to application or Add delegated permission grant for the same application in TargetResources.
  3. Check who granted it. An administrator who approved the request after the block should be able to name the reason.

EventsConsent to applicationAdd delegated permission grant

LimitsAn administrator who reviews a blocked request and approves a legitimate application produces the same sequence, which is the intended process. The 14 days are a starting point.

Newly consented application reads mail or files through Microsoft Graph

Detection hypothesisSequence of eventsJoins two logsNeeds your own lists

A consent grant becomes a breach when the application uses it. In consent phishing the application starts to read the user's mail or files through Microsoft Graph soon after the consent, from the attacker's infrastructure. The Microsoft Graph activity log records each request with the application, the user and the address, which the audit log does not.

  1. Audit log: Consent to application with the user in InitiatedBy and the service principal in TargetResources. Look up the application (client) ID of that service principal.
  2. Microsoft Graph activity log, the following 7 days: requests whose AppId is that application and whose UserId is the consenting user.
  3. Keep the requests whose RequestUri reads mail or files (paths under messages, mailFolders or drive), and read IPAddress and RequestMethod.
  4. Alert when such requests come from an address outside your egress ranges, and raise the priority for an application that is new to the tenant.

EventsConsent to application

LimitsMany legitimate mail and file applications do exactly this from their vendor's cloud, so confirm the application first. The Microsoft Graph activity log has to be collected separately, and calls to Exchange or SharePoint APIs outside Microsoft Graph are not in it. The 7 days are a starting point.

Triage

  • Open the consented application (TargetResources) and check its publisher, reply URLs and requested permissions.
  • Identify who consented (InitiatedBy) and whether the sign-in that preceded it came from an expected location.
  • If malicious, revoke the grants, disable the service principal and review the audit log for data the application accessed.

Response

Once the attack is confirmed:

  1. Disable sign-in for the service principal of the malicious application, so that it cannot obtain new tokens while you work.
  2. Revoke what was granted. Remove the delegated permission grants and the app role assignments of the application, for every user who consented and not only the first one found.
  3. Search the audit log for other consents to the same application ID, because a consent phishing message usually reaches several people.
  4. Review what the application accessed with the permissions it had, such as mail and files, and inform the people whose data was read.
  5. Confirm that no grant for the application remains and that its service principal stays disabled.

Mitigation

  • Restrict user consent to verified publishers and low-risk permissions, and require the admin consent workflow for everything else.
  • Review existing OAuth grants and app role assignments regularly; remove unused or unverified applications.
  • Alert on admin consent and on application permissions that grant tenant-wide data access.

Frequently asked questions

Does resetting the user's password remove the application's access?

No. The tokens belong to the application and do not depend on the password, so a reset changes nothing. The access also does not depend on MFA. It ends when the consent grants are revoked and the service principal is disabled.

Why are there separate rules for consent and for application permissions?

One rule matches `Consent to application`, the consent a user or an administrator gives. Another matches `Add app role assignment to service principal`, an application permission. Application permissions such as Mail.Read or Files.Read.All give tenant-wide access with no signed-in user, which is why that rule is rated higher.

Is every consent event an attack?

No. Users adopt approved SaaS applications all the time. Check the publisher, the reply URLs and the requested permissions of the application, and add known application IDs to an allow list after review. Consent phishing relies on nobody looking at these events.

Does an account of ours have to be compromised first?

No. In an illicit consent grant the victim is tricked into approving an application the attacker registered, on a legitimate Microsoft sign-in page. No password is stolen. What decides whether the attack works is the user consent setting of the tenant, or an administrator who can be convinced to grant admin consent.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.