Skip to content
3.0 preview2.3.0 stable

These docs describe the preview. Pick the version you run and every page marks what it doesn't have yet. Get the preview →
Maester 2.x docs (archived) →

Sponsor

Exchange application access policies must be configured

MT.1058MediumEntra IDApp consent and permissions

Part of Maester · Entra ID · App consent and permissions · All checks

Run this check
Invoke-Maester -TestId MT.1058

Application access policies in Exchange Online help you control which applications can access which mailboxes.

Without these policies, applications with Exchange permissions can access all mailboxes in your organization.

Microsoft Exchange related permissions that should be secured by application access policies include:

  • Mail.Read
  • Mail.ReadBasic
  • Mail.ReadBasic.All
  • Mail.ReadWrite
  • Mail.Send
  • MailboxSettings.Read
  • MailboxSettings.ReadWrite
  • Calendars.Read
  • Calendars.ReadWrite
  • Contacts.Read
  • Contacts.ReadWrite

Exchange application access policies should be configured for all applications with Exchange permissions.

Follow the steps below to create an application access policy in Exchange Online that restricts the application’s access to mailboxes in a specific distribution group.

Connect-ExchangeOnline
# Get these values from your Application Registration
$AppID = "<your-app-id>" # e.g. "0a3ad682-b031-416d-86c2-bf263f8b46a3"
$GroupName = "AAP_$AppID" # example naming convention for clarity
$Description = "Restrict this app to members of distribution group"

Create a mail-enabled security group for policy scope

Section titled “Create a mail-enabled security group for policy scope”
# Create group and hide from address list
$DGroup = New-DistributionGroup -Name $GroupName -Type Security
Start-Sleep -Seconds 5 # Wait for group creation to propagate
Set-DistributionGroup -Identity $DGroup.WindowsEmailAddress -HiddenFromAddressListsEnabled $true
New-ApplicationAccessPolicy -AppId $AppID `
-PolicyScopeGroupId $DGroup.WindowsEmailAddress `
-AccessRight RestrictAccess `
-Description $Description
Add-DistributionGroupMember -Identity $GroupName -Member [email protected]
# List all policies
Get-ApplicationAccessPolicy
# Test for specific user
Test-ApplicationAccessPolicy -Identity [email protected] -AppId $AppID
Every attribute of this check
FieldValue
Test IDMT.1058
SeverityMedium
SuiteMaester
ProductEntra ID
Related productsExchange Online
FeatureApp consent and permissions
AreaApplications and workload identities
Resource typeServicePrincipal
User impactLow
Implementation costMedium
MITRE ATT&CKT1114.002 Remote Email Collection
Supports controlsnist-800-53-r5:AC-6, nist-800-53-r5:AC-3
PowerShell testTest-MtSpExchangeAppAccessPolicy
ServicesGraph, ExchangeOnline
Long runningYes