azureblog.co.uk
← cd ~/posts
Entra

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.

Entra2 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 Entra admin center: 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 Entra admin center: 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 such as Mail.Read, Files.ReadWrite.All or anything granted to all users:

powershell11 lineshover a line number for notes
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
What each line does
  1. Line 1: Signs in to Microsoft Graph with the permissions (scopes) listed.
  2. Line 3: Reads oauth2 permission grant details from Microsoft Graph.
  3. Line 4: Keeps only the items that match the condition.
  4. Line 5: Runs the block once for each item coming down the pipeline.
  5. Line 7: Reads service principal details from Microsoft Graph.
  6. Line 11: Sorts the results.

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 ?
  • 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 .
  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 →Next in Entra ID foundations for new admins · part 5 of 7Clean up guest accounts with access reviews →

More on Entra ID →

Spotted something out of date or wrong? Tell us and we'll fix it.