A Microsoft Graph application permission such as Mail.Read, once consented in Microsoft Entra ID, applies to every mailbox in the tenant unless something else narrows it. Most integrations need a handful of mailboxes or one SharePoint site, yet they are routinely granted tenant-wide access because that is the default shape of an app role. Exchange Online offers two scoping mechanisms, the older Application Access Policies and the newer RBAC for Applications, and SharePoint offers the Sites.Selected family of permissions. This guide explains how each works, how they interact with Entra consent, how to migrate between them and how to prove the scoping is effective. It is for Microsoft 365 administrators, identity engineers and anyone reviewing app registrations that touch mail, calendars or documents.
Key takeaways
- Grants are additive. Microsoft documents a union model: an unscoped Mail.Read in Entra plus a scoped Mail.Read in Exchange RBAC gives unscoped access, so the Entra grant must be removed.
- RBAC for Applications replaces Application Access Policies. The cmdlet reference says not to create new policies, because they will eventually need migrating.
- Scoping is set in Exchange, not Entra. Management scopes and administrative units define which mailboxes an app reaches; Test-ServicePrincipalAuthorization proves it.
- Sites.Selected starts with no access. The app gets nothing until a site, list or file permission is explicitly granted through Graph.
- Logs show whether scoping holds. Microsoft Graph activity logs record the AppId, roles and request URI for every call, which is how you catch an app reaching outside its intended scope.
How identity and access work in Microsoft 365 application permissions
An application in Microsoft 365 is represented by an app registration (the definition) and a service principal (its instance in your tenant). It can call Microsoft Graph in two modes. In delegated mode it acts for a signed-in user and can never exceed that user's rights. In application-only mode there is no user, and the app's effective access is whatever app roles have been consented. Microsoft's own Selected-permissions documentation calls application-only mode higher risk and prefers delegated mode where possible.
Three places can now grant or constrain application-only access to mailbox and site data:
| Mechanism | Where it is configured | What it does | Status |
|---|---|---|---|
| Entra ID app role consent (for example Mail.Read) | Entra admin centre, API permissions and admin consent | Grants the permission across the whole tenant | Current; the default |
| Application Access Policies | Exchange Online PowerShell, New-ApplicationAccessPolicy | Constrains Entra-consented Exchange permissions to, or away from, members of a mail-enabled security group | Being replaced; do not create new ones |
| RBAC for Applications | Exchange Online PowerShell, New-ManagementRoleAssignment -App | Grants an Exchange application role to a service principal over a resource scope | Current replacement for policies |
| Sites.Selected and *.SelectedOperations.Selected | Entra consent plus Graph /permissions calls | Grants access to specific sites, lists, items or files only | Current |
The critical rule is how Exchange combines them. Microsoft states that RBAC grants and Entra consent are a union, each authority acting independently. Application Access Policies can only constrain Entra-assigned permissions, not RBAC assignments. Microsoft's own edge case: an app with Entra Mail.Read restricted by a policy to Group 1, plus an RBAC Mail.Read over a scope that excludes mailbox A, can reach every mailbox, because the two grants together cover "A or not A". Microsoft recommends keeping organisation-wide permissions in Entra and resource-scoped permissions in RBAC for Applications, and not mixing policies with RBAC. For the Entra side of consent and app registration, see the Entra ID Applications and Consent Guide.
RBAC for Applications in practice
- Create the service principal pointer. Exchange cannot create service principals; it points to the Entra one:
New-ServicePrincipal -AppId <AppId> -ObjectId <ObjectId> -DisplayName <name>. Take both IDs from Enterprise applications, not App registrations, which show different values. - Define the resource scope. Either a management scope with a recipient filter, for example
New-ManagementScope -Name "Canadian users" -RecipientRestrictionFilter "CustomAttribute1 -eq '012332'", or an Entra administrative unit passed directly with-RecipientAdministrativeUnitScope, which Microsoft recommends over embedding an AU in a management scope. - Assign the role.
New-ManagementRoleAssignment -App <ObjectId> -Role "Application Mail.Read" -CustomResourceScope "Canadian users". - Remove the unscoped Entra grant for the same permission, or the scope has no effect.
- Test.
Test-ServicePrincipalAuthorization -Identity <app> -Resource <mailbox>returnsInScopeTrue or False per permission. It excludes Entra grants and bypasses the permission cache, so it can report the intended state before production calls reflect it.
Changes are cached for 30 minutes to two hours depending on how active the app is. Plan cut-overs and rollback windows around that range.
Exchange application roles available
| Application role | Underlying permission | Notes |
|---|---|---|
| Application Mail.Read / Mail.ReadBasic | Mail.Read / Mail.ReadBasic | Read mail; ReadBasic excludes body and attachments |
| Application Mail.ReadWrite / Mail.Send | Mail.ReadWrite / Mail.Send | Send as any in-scope mailbox: high impact |
| Application Calendars.Read / ReadWrite | Calendars.Read / ReadWrite | Room booking and scheduling tools |
| Application Contacts.Read / ReadWrite | Contacts.Read / ReadWrite | CRM and contact sync |
| Application MailboxSettings.Read / ReadWrite | MailboxSettings.Read / ReadWrite | Auto-replies, time zones |
| Application MailboxItem.Export / ImportExport | MailboxItem.Export.All / ImportExport.All | Backup and migration |
| Application Mail Full Access | Mail.ReadWrite, Mail.Send | Bundle; prefer the individual roles |
| Application Exchange Full Access | Mail, MailboxSettings, Calendars, Contacts read-write plus Mail.Send | Broadest Graph bundle |
| Application EWS.AccessAsApp | EWS.AccessAsApp | The only EWS role; full access to in-scope mailboxes |
| Application SMTP.SendAsApp | SMTP.SendAsApp | SMTP client submission for apps |
The full list also includes MailboxFolder, MailboxItem.Read and ReadWrite, MailboxConfigItem, MailTips.ReadBasic.All and Mail-Advanced.ReadWrite.All roles. Run Get-ManagementRole to see the current set in your tenant.
SharePoint and OneDrive: Selected permissions
For document access the equivalent pattern is the Selected scope family: Sites.Selected (site collection), Lists.SelectedOperations.Selected, ListItems.SelectedOperations.Selected and Files.SelectedOperations.Selected. Microsoft documents three required steps: consent to the Selected scope, grant a role (read, write, owner or fullcontrol) on the resource with POST /sites/{siteId}/permissions or the list, item or drive item equivalent, then obtain a token containing the scope. Skip any step and the app has no access. Granting at site level requires Sites.FullControl.All, so the granting tool is itself highly privileged and should not be the app being scoped. Grants on lists, items or files break permission inheritance, which counts against SharePoint's unique security scope limits. See the SharePoint and OneDrive Security Guide for the wider site controls.
Admin roles and privileged access
- Exchange side: managing RBAC for Applications requires the Organization Management role group in Exchange (or a delegated Exchange RBAC assignment) and the Exchange Administrator role in Entra. Anyone with these can widen an app's scope or assign Application Exchange Full Access, so treat the assignments as privileged.
- Entra side: Microsoft's admin consent documentation states that only the Privileged Role Administrator (or a custom role with the right permission) can grant tenant-wide consent for Microsoft Graph application permissions. Cloud Application Administrator, Application Administrator and AI Administrator can consent to other APIs and to delegated Graph permissions.
- App owners: owners of an app registration can add credentials to it. An owner who adds a secret to an app holding Mail.Read gains tenant-wide mail access. Restrict ownership and monitor credential changes.
- SharePoint granting tool: whatever identity calls
/sites/{id}/permissionsneedsSites.FullControl.All. Run it as a separate, tightly owned admin app, ideally invoked only during change windows.
For broader tenant role design, see the Entra ID Security Guide.
Integrations, API tokens and service accounts
Different integration types map to different scoping strategies. Choose the one that matches who must be reachable.
| Integration | Typical request | Recommended scoping |
|---|---|---|
| Shared mailbox processor (invoices, support) | Mail.ReadWrite tenant-wide | RBAC Application Mail.ReadWrite over a management scope containing only the shared mailboxes |
| Notification sender | Mail.Send tenant-wide | RBAC Application Mail.Send scoped to one sending mailbox |
| Room and resource booking | Calendars.ReadWrite | RBAC scoped by an administrative unit containing room mailboxes |
| Regional or departmental tool | Mail.Read | Management scope on a directory attribute, or an AU per region |
| Backup or e-discovery | Mail and Files full access | Organisation-wide is often genuine; keep in Entra, compensate with monitoring and credential controls |
| Document workflow on one site | Sites.ReadWrite.All | Sites.Selected with a write role on that site |
| Legacy EWS integration | full_access_as_app | Application EWS.AccessAsApp over a scope; plan migration to Graph |
Scoping limits what a stolen credential can reach, but the credential still matters. Prefer certificate credentials or workload identity federation over client secrets, store any secret in a vault, and expire it. The Microsoft Midnight Blizzard breach is the reference case: Microsoft reported that the actor used a legacy test OAuth app to grant itself the Exchange Online full_access_as_app role and read senior leadership mailboxes without needing any user's password or MFA. A scoped role assignment and an alert on the grant would have narrowed and exposed that path. See the Consent Phishing and Illicit OAuth Grants Guide for the user-consent variant.
Logging and detection
| Source | Event or field | Use |
|---|---|---|
| Entra audit log (ApplicationManagement) | Add app role assignment to service principal; Consent to application | Alert on new Graph application permissions, especially Mail.*, Files.*, Sites.* |
| Entra audit log | Add service principal credentials; Update application - Certificates and secrets management | Alert on credential additions to any app holding mail or file permissions |
| Purview unified audit log (Exchange admin) | New-ManagementRoleAssignment, Set-ManagementRoleAssignment, New-ServicePrincipal, New-ApplicationAccessPolicy | Track scope changes; any change outside a ticket is suspect |
Microsoft Graph activity logs (MicrosoftGraphActivityLogs) | AppId, ServicePrincipalId, RequestUri, Roles, ResponseStatusCode | See which mailboxes and sites an app actually touched; 403 bursts show scoping blocking calls |
| Purview audit, MailItemsAccessed | Bind and Sync records | Message-level evidence of mailbox reads during an investigation |
Graph activity logs need an Entra ID P1 or P2 licence and a diagnostic setting to Log Analytics, storage or Event Hubs; Microsoft says events usually arrive within 30 minutes and occasionally up to two hours. A useful detection is to join Graph activity for each scoped app with the set of mailbox identifiers in its management scope and alert on any successful request outside it, which should be impossible if the Entra grant was removed. MailItemsAccessed is part of Audit (Standard) and on by default for E3 and E5 users.
Relevant MITRE ATT&CK techniques are T1098.003 Additional Cloud Roles and T1098.001 Additional Cloud Credentials for grant and credential changes, and T1114.002 Remote Email Collection for the mailbox access itself. See the Microsoft Sentinel Guide for analytics rule patterns.
Metrics:
- Unscoped mail permissions: number of service principals holding Mail.*, Calendars.* or EWS.AccessAsApp as Entra app roles without a documented organisation-wide justification.
- Migration progress: remaining Application Access Policies (target zero).
- Selected adoption: share of SharePoint integrations using Sites.Selected rather than Sites.*.All.
- Out-of-scope success: successful Graph requests by scoped apps to resources outside their scope (target zero).
- Credential hygiene: apps with mail or file permissions that use client secrets rather than certificates or federation.
Hardening baseline
- Inventory. List every service principal with Graph application permissions for mail, calendars, contacts, files and sites, plus every Application Access Policy (
Get-ApplicationAccessPolicy) and RBAC assignment. - Classify. Mark each as genuinely organisation-wide or resource-scoped. Organisation-wide stays in Entra with compensating controls; everything else moves to RBAC or Selected.
- Pilot one app. Pick a low-impact app, create the pointer, scope and assignment, run
Test-ServicePrincipalAuthorizationagainst an in-scope and an out-of-scope mailbox, then remove the Entra grant. - Migrate policies. For each Application Access Policy follow Microsoft's sequence: management scope using
MemberOfGroupwith the group's distinguished name, service principal pointer, scoped assignment, remove the Entra consent, then remove the policy. Nested group members are out of scope in RBAC, unlike policies, so flatten groups first. - Move SharePoint integrations to Selected. Grant only the role needed (
readbeforewrite) on the specific site or list. - Harden credentials. Certificates or federation, short expiry, ownership restricted to a named team.
- Turn on detection for grants, credential changes and out-of-scope access, and verify with a deliberate test grant.
Rollback: if an app breaks after the Entra grant is removed, re-add the Entra consent for that single permission (restoring the old behaviour), then fix the scope and retry. Allow for the two-hour cache before deciding a change has failed.
Small versus large tenants: a small tenant can usually manage with a handful of management scopes built on mail-enabled groups. A large or multi-region tenant benefits from administrative units, because the same AUs can also scope human admin roles, keeping one model for people and apps. Note that RBAC for Applications supports up to 10,000 applications per organisation.
Framework mapping
| Framework | Reference | Application to app scoping |
|---|---|---|
| NIST SP 800-53 Rev. 5 | AC-6 Least Privilege, AC-3 Access Enforcement | Resource-scoped roles instead of tenant-wide app roles |
| NIST SP 800-53 Rev. 5 | AC-2 Account Management, IA-5 Authenticator Management | Inventory of service principals; certificate and secret lifecycle |
| NIST SP 800-53 Rev. 5 | AU-12 Audit Record Generation, AU-6 Audit Record Review | Graph activity logs, audit of role assignments |
| NIST CSF 2.0 | PR.AA-05 | Permissions defined, enforced and reviewed with least privilege |
| CIS Controls v8.1 | Control 6 Access Control Management, Control 8 Audit Log Management | Least privilege for service accounts; centralised logs |
| ISO/IEC 27001:2022 Annex A | 5.15 Access control, 5.18 Access rights, 8.3 Information access restriction | Restricting application access to the information it needs |
| MITRE ATT&CK | T1098.003, T1098.001, T1114.002 | Role grants, credential additions, mailbox collection |
Common misconfigurations
- Scoping in RBAC but leaving the Entra grant: the union model means the app keeps tenant-wide access. This is the most common and least visible failure.
- Mixing policies and RBAC: the "A or not A" case Microsoft documents turns two partial restrictions into full access.
- Relying on exclusive management scopes: Microsoft states that exclusive scopes do not restrict app access, so they cannot be used to protect VIP mailboxes from apps.
- Wrong object IDs: using App registration IDs instead of Enterprise application IDs when creating the service principal pointer, producing an assignment that never matches.
- Nested groups after migration: a policy that covered nested members silently loses them when converted to a
MemberOfGroupscope. - Sites.Selected granted from the app itself: giving the scoped app
Sites.FullControl.Allso it can grant itself permissions defeats the purpose.
Practitioner checklist
- Export all Graph application permissions for mail, calendar, contacts, files and sites, with owner and justification.
- Stop creating Application Access Policies; record a migration date for each existing one.
- Build management scopes or administrative units for each resource-scoped app and assign Exchange application roles.
- Remove the matching unscoped Entra grant and confirm with Test-ServicePrincipalAuthorization.
- Move SharePoint integrations to Sites.Selected or the finer Selected scopes, granted by a separate admin tool.
- Restrict Privileged Role Administrator and Exchange Organization Management membership and use just-in-time activation.
- Replace client secrets with certificates or federation on apps holding mail or file permissions.
- Stream Graph activity logs to your SIEM and alert on out-of-scope success, new app role assignments and new credentials.
Standards and references
- Microsoft Learn: Role Based Access Control for Applications in Exchange Online
- Microsoft Learn: New-ApplicationAccessPolicy
- Microsoft Learn: Overview of Selected permissions in OneDrive and SharePoint
- Microsoft Learn: Grant tenant-wide admin consent to an application
- Microsoft Learn: Microsoft Graph activity logs
- Microsoft Learn: Use MailItemsAccessed to investigate compromised accounts
- NIST: SP 800-53 Rev. 5
- MITRE ATT&CK: Additional Cloud Roles
Related NHI Mgmt Group resources: Entra ID Applications and Consent Guide · Exchange Online Security Guide · Microsoft 365 Security Guide · Microsoft Midnight Blizzard Breach