azureblog.co.uk
← cd ~/posts

Lock down app consent without blocking your users

Illicit consent grants are a favourite way to steal mailbox data. Restricting user consent and turning on the admin consent workflow closes the door without making life miserable.

2 min read✓ checked 23 Sept 2026Entra ID · Security · Governance
On this page
  1. 1. Restrict user consent
  2. 2. Turn on the admin consent workflow
  3. 3. Review what's already granted
  4. What reviewers should check
  5. If you find a malicious grant

When a user signs in to a third-party app for the first time, the app can ask for permissions to their data, such as reading their mail or files. If users can grant any permission, an attacker only needs a convincing app and a phishing email. The resulting access survives password resets, because it isn't based on the password.

AttackerUserEntra IDPhishing email: 'Open shareddocument'1Signs in to attacker's app2Consent prompt: read yourmail3Accepts4Uses the token to read mail, even after a password reset5
How an illicit consent grant works, and why restricting consent stops it.
  1. 01User signs in to new app
  2. 02App asks for risky permission
  3. 03User submits a request
  4. 04Reviewer approves or denies

In the Entra admin center, go to Enterprise applications → Consent and permissions → User consent settings. Choose:

  • Allow user consent for apps from verified publishers, for selected permissions, and
  • under Permission classifications, mark only low-risk permissions (such as User.Read, openid, profile, email and offline_access) as low impact.

Users can still sign in to well-known apps that only need basic profile access. Anything riskier needs an admin.

Under Enterprise applications → Admin consent settings, enable Users can request admin consent to apps they are unable to consent to, and choose reviewers. Instead of a dead end, users see a request form, and reviewers get an email with the app and the permissions requested.

UserEntra IDReviewerTries a new app that needsMail.Read1Approval required: requestit?2Submits a justification3Email with the app andpermissions4Approves or denies5Notified of the outcome6
With the workflow on, users ask instead of being blocked.

3. Review what's already granted

Existing consents aren't affected by the new settings. Review the apps with risky delegated permissions such as Mail.Read, Files.ReadWrite.All or anything granted to all users:

powershell
Connect-MgGraph -Scopes "Directory.Read.All"

Get-MgOauth2PermissionGrant -All |
  Where-Object { $_.Scope -match "Mail\.|Files\.|Sites\.|Directory\." } |
  ForEach-Object {
    [pscustomobject]@{
      App         = (Get-MgServicePrincipal -ServicePrincipalId $_.ClientId).DisplayName
      ConsentType = $_.ConsentType
      Scope       = $_.Scope
    }
  } | Sort-Object App | Format-Table -AutoSize

Revoke anything you don't recognise, and investigate how it got there.

Reviewer tip: before approving, check the publisher is verified, the permissions match what the app actually does, and someone in the business owns the request.

What reviewers should check

  • Is the publisher verified, and is it the company you expect?
  • Do the requested permissions match what the app does?
  • Is this a delegated or application permission?
  • Who in the business owns the request, and is there a contract?
  • Is there a narrower permission available?

The Graph permission explainer shows what each permission allows and suggests narrower alternatives.

If you find a malicious grant

  1. Remove the app's permissions and disable sign-in for the Enterprise App.
  2. Revoke the affected users' sessions.
  3. Check the audit log for when consent was granted and by whom.
  4. Check what the app accessed, using the mailbox and SharePoint audit logs.
Next in Locking down admin access · part 5 of 6Key Vault: move from access policies to Azure RBAC →