M365 Service Principle

Permissions for the M365 service principle

This document specifies the exact permissions required for the Microsoft 365 / Graph service principal PAA uses. Granting more than the listed permissions is unnecessary. Granting less will cause partial or complete scan failures.


Microsoft 365 / Graph Service Principal

Purpose

Used by Zero Trust Assessment, M365 Security scanning (CIS, CISA SCuBA, EIDSCA, Maester), and Identity Security scanning (service principal risks, managed identities, guest users, application registrations).

Where to Configure

Settings > Microsoft 365


Credential model — certificate, not a standing secret

PAA authenticates to Microsoft Graph with a certificate, not a long-lived client secret.

  • During onboarding you provide a temporary client secret. PAA uses it once to provision a certificate, then discards it.
  • The certificate’s private key is generated inside, and never leaves, PAA’s Key Vault. Only the public key is written to your app registration.
  • PAA rotates the certificate automatically on a rolling schedule — there is no standing credential to expire, leak, or rotate by hand.
  • You can revoke PAA’s access at any time by removing the certificate from the app registration or deleting the app registration entirely.

The single write permission this requires (Application.ReadWrite.OwnedBy) is scoped to the app registration PAA owns — its own, and only its own. It cannot read or modify any other application in your tenant. See the permission table below.


Required Microsoft Graph application permissions

All permissions below are application permissions (not delegated) and require admin consent. Every one is read-only except Application.ReadWrite.OwnedBy, which is self-scoped (it manages only PAA’s own certificate credential).

PermissionAccessUsed For
Directory.Read.AllReadEntra ID directory roles, users, groups, service principals, application registrations, managed identities, organization & domains
Policy.Read.AllReadConditional Access policies, authentication-method / authorization / cross-tenant-access / app-management policies
RoleManagement.Read.DirectoryReadPrivileged Identity Management (PIM) role eligibility & assignment schedules, role-management policies
AccessReview.Read.AllReadAccess review definitions and instances (requires Entra ID P2)
DelegatedAdminRelationship.Read.AllReadGDAP partner (delegated admin) relationships
DelegatedPermissionGrant.Read.AllReadOAuth2 delegated permission grants (consent-grant risk analysis)
IdentityRiskyUser.Read.AllReadIdentity Protection risky users (requires Entra ID P2)
AuditLog.Read.AllReadGuest user last sign-in activity (stale external user detection)
DeviceManagementManagedDevices.Read.AllReadIntune managed device enrollment and compliance status
DeviceManagementConfiguration.Read.AllReadIntune device compliance policies, configuration profiles
DeviceManagementApps.Read.AllReadIntune app protection policies, managed applications
SecurityEvents.Read.AllReadMicrosoft Defender security alerts and Secure Score
SecurityIncident.Read.AllReadMicrosoft Defender XDR security incidents
SharePointTenantSettings.Read.AllReadSharePoint / OneDrive sharing and external-sharing settings
Application.ReadWrite.OwnedByWrite — self-scopedLets PAA manage only its own certificate credential (provision + auto-rotate). Cannot touch any other app registration.

Missing a read permission does not fail the whole scan: PAA logs which data area was affected and continues with the data it could collect. Some checks gated on a missing permission report Skipped or Manual review rather than a result.


Additional grants for deep configuration collection

The onboarding script also provisions the following so that PAA’s deeper Exchange Online / Security & Compliance configuration collection works without a second admin-consent prompt later. They are read-oriented and bounded:

GrantTypeUsed For
Exchange.ManageAsAppOffice 365 Exchange Online app roleApp-only access to Exchange Online / Security & Compliance configuration (transport rules, anti-phishing/spam, DLP) via Microsoft’s management endpoints
Global ReaderEntra ID directory roleRead-only directory role — the clean, enumerable lever for the configuration surfaces above

Exchange.ManageAsApp grants management-endpoint access, not mailbox access — PAA reads configuration only and never reads message content. Global Reader is Microsoft’s built-in read-only administrative role.


PAA ships an onboarding script (Setup-PaaOnboarding.ps1) that performs every step below idempotently — create the app registration, request admin consent for the permissions above, set the service principal as owner of its own app registration (required for self-scoped certificate management), and generate a short-lived bootstrap secret.

  1. Run the onboarding script as a Global Administrator and follow the prompts. It outputs the Application (client) ID, the temporary client secret, and your Directory (tenant) ID.
  2. In PAA Settings > Microsoft 365, enter the M365 Tenant ID, Client ID, and the temporary secret, then click Validate & Test Connection.
  3. PAA provisions a certificate in its Key Vault, registers the public key on the app, verifies certificate authentication, and discards the bootstrap secret. From this point all collection uses the certificate.

Test Connection verifies the credentials and reports which required permissions have been granted before you run a scan.

Manual alternative

If you prefer to register the app by hand: create the App Registration, add each Microsoft Graph application permission in the table above plus Application.ReadWrite.OwnedBy, add Office 365 Exchange Online > Exchange.ManageAsApp, Grant Admin Consent, assign the Global Reader directory role to the service principal, set the service principal as an owner of its own app registration, then create a temporary client secret and complete steps 2–3 above. PAA replaces that secret with a managed certificate on first connect.


What PAA does with this service principal

FeatureData CollectedPermissions Used
Zero Trust — Identity pillarConditional Access policies, named locations, authentication methods, directory role memberships, PIM configuration, risky usersPolicy.Read.All, Directory.Read.All, RoleManagement.Read.Directory, IdentityRiskyUser.Read.All
Zero Trust — Devices pillarDevice compliance policies, app protection policies, EDR / compliance statusDeviceManagementConfiguration.Read.All, DeviceManagementApps.Read.All, DeviceManagementManagedDevices.Read.All
Zero Trust — Data pillarSharePoint / OneDrive sharing settings, Teams governance, sensitivity & DLP policiesSharePointTenantSettings.Read.All, Policy.Read.All
Zero Trust — Security Operations pillarUnified audit log status, Secure Score, Defender alerts and incidentsSecurityEvents.Read.All, SecurityIncident.Read.All
M365 Security — CIS BenchmarkIdentity controls, Intune policies, Exchange config, SharePoint, Power BI governanceMost permissions
M365 Security — CISA SCuBAEntra ID, Defender, Teams, Exchange hardeningDirectory.Read.All, Policy.Read.All, SecurityEvents.Read.All
M365 Security — EIDSCAEntra ID authorization, authentication, conditional access configurationPolicy.Read.All, Directory.Read.All
Identity Security — Service Principals & App RegistrationsCredential expiry, app role assignments, federated identity credentials, external ownersDirectory.Read.All
Identity Security — Managed IdentitiesApp role assignments held by managed identities, RBAC rolesDirectory.Read.All
Identity Security — Consent grantsOAuth2 delegated permission grants and over-consent riskDelegatedPermissionGrant.Read.All
Identity Security — Guest UsersPrivileged guests, stale external users, last sign-inDirectory.Read.All, AuditLog.Read.All
Identity Security — Directory Roles & Access ReviewsService principals holding privileged Entra ID roles, access review coverageDirectory.Read.All, AccessReview.Read.All
Tenant Trust — Delegated Admin (GDAP)Partner delegated-admin relationships into your tenantDelegatedAdminRelationship.Read.All

Notes

  • Every permission is read-only except Application.ReadWrite.OwnedBy, which is provably self-scoped — it can manage only the credential of the app PAA owns, and cannot read or modify any other application in your tenant. PAA does not modify any other M365 tenant configuration.
  • The durable credential is a certificate that PAA generates in its Key Vault and rotates automatically; the bootstrap secret you supply is discarded after first connect. There is no standing secret in steady state.
  • Admin consent must be granted by a Global Administrator or Privileged Role Administrator.
  • AccessReview.Read.All and IdentityRiskyUser.Read.All require Entra ID P2. Without P2 the related checks return Manual review rather than failing.
  • AuditLog.Read.All is specifically required for guest user last sign-in dates. Without it, stale guest detection still runs but cannot report sign-in recency.
  • The service principal must be registered in the same tenant you are assessing. Cross-tenant assessment requires a separate App Registration in the target tenant.

Platform Architecture Authority — Crimson Owl Technologies Last updated: June 2026