Mailbox Access Identity Workflow
ION phishing analysis reads the body of reported or suspicious messages in
customer mailboxes. It uses the purpose-specific multi-tenant application
azsp-ontinue-ion-access-phishing-write-prd-01
(ADR-0010).
The Microsoft Graph Mail.Read application permission is tenant-wide when
granted in Entra. ION therefore requires the customer to constrain mailbox access
with Exchange Online RBAC for Applications, and ION does not process any
mailbox until the scope has been validated end to end.
Actors and identities
| Concern | Authoritative system | ION responsibility |
|---|---|---|
| Customer identity administrator | Customer home tenant | Grants admin consent and the Mail.Read application permission. |
| Customer Exchange administrator | Exchange Online in the customer tenant | Creates the Exchange service principal, management scope, and role assignment, and runs the authorization test. |
| Phishing application | azsp-ontinue-ion-access-phishing-write-prd-01, multi-tenant | Holds the phishing-analysis Graph permissions and trusts the calling workload's UAMI as a federated credential. |
| Phishing-analysis workload | ION microservice with its own UAMI | Exchanges its token for a customer-tenant Graph token and reads only in-scope messages. |
| Scoped mailboxes | Mailboxes matching the management scope | The only mailboxes whose content Exchange returns to the application. |
Application permissions
| Graph application permission | Use |
|---|---|
Mail.Read | Read message bodies in in-scope mailboxes |
Mail.ReadBasic.All | Read message metadata without body content |
SecurityAnalyzedMessage.Read.All | Read analyzed-message records |
SecurityAnalyzedMessage.ReadWrite.All | Act on analyzed messages |
ThreatSubmission.Read.All | Read threat submissions |
ThreatSubmission.ReadWrite.All | Create and update threat submissions |
The Exchange RBAC for Applications scope in this workflow constrains message
content access through the Application Mail.Read role.
Tenancy
| Element | Tenant |
|---|---|
| Phishing application registration and federated credentials | Ontinue platform directory |
| Calling workload UAMI | Ontinue platform directory |
Service principal, consent, and Mail.Read grant | Customer tenant Entra |
| Exchange service principal, management scope, and role assignment | Customer tenant Exchange Online |
| Graph access token | Issued by the customer tenant |
Onboarding
Consent and grant Mail.Read
Owner: Customer identity administrator
ION sends the admin consent URL for the phishing application:
https://login.microsoftonline.com/organizations/adminconsent?client_id={appClientId}&redirect_uri={registeredRedirect}&state={onboardingState}
The authority is always organizations; ION never uses common and never
pre-fills a tenant. ION verifies the returned tenant and state against the
onboarding record. Consent requires a Privileged Role Administrator or an
equivalent role able to grant application permissions. After consent, the
Mail.Read grant applies to every mailbox in the tenant, so ION does not process
mail yet.
Register the service principal in Exchange
Owner: Customer Exchange administrator
In Exchange Online PowerShell, as Organization Management or an Exchange Administrator:
New-ServicePrincipal -AppId <appClientId> -ObjectId <enterpriseAppObjectId> -DisplayName "ION Phishing Analysis"The IDs are the application client ID and the customer’s enterprise application object ID. These steps are PowerShell-only.
Create the management scope
Owner: Customer Exchange administrator
The default scope uses a mailbox custom attribute. Tag each in-scope mailbox and create the scope:
Set-Mailbox -Identity <mailbox> -CustomAttribute1 "MSSP-PhishingAnalysis"
New-ManagementScope -Name "ION-PhishingAnalysis" -RecipientRestrictionFilter "CustomAttribute1 -eq 'MSSP-PhishingAnalysis'"Where the customer already manages mailboxes through an Administrative Unit, the
assignment can instead use -RecipientAdministrativeUnitScope with that unit.
Assign Application Mail.Read to the scope
Owner: Customer Exchange administrator
New-ManagementRoleAssignment -App <appClientId> -Role "Application Mail.Read" -CustomResourceScope "ION-PhishingAnalysis"Assign only Application Mail.Read. No other Exchange application role is
assigned for this workflow.
Test the Exchange assignment
Owner: Customer Exchange administrator
Test-ServicePrincipalAuthorization -Identity <appClientId> -Resource <inScopeMailbox>
Test-ServicePrincipalAuthorization -Identity <appClientId> -Resource <outOfScopeMailbox>The in-scope mailbox must report InScope True for Application Mail.Read; the
out-of-scope mailbox must report False.
Validate end to end and activate
Owner: Ontinue engineering
Test-ServicePrincipalAuthorization evaluates the Exchange assignment. ION
confirms the effective result through Graph with the runtime identity: a message
body in an in-scope mailbox is readable, and a read in an out-of-scope mailbox
returns ErrorAccessDenied. Only after both results are recorded does ION
activate phishing processing for the tenant.
Detailed commands and evidence are in Mailbox-scoped access.
Runtime token flow
The calling workload’s UAMI is a federated identity credential on the phishing
application; every new Entra application starts with federated credentials only.
Where the phishing application still holds a Key Vault client secret, that secret
is transitional and SRE monitors its expiry until migration completes. The token
scope is https://graph.microsoft.com/.default. The customer tenant ID comes from
the verified onboarding record. See
Workload Identity Federation.
Validation and authorization
- Entra authorizes the application permissions granted at consent.
- Exchange RBAC for Applications restricts message content access to mailboxes in the management scope.
- ION requires a recorded end-to-end validation before processing, treats
ErrorAccessDeniedas an out-of-scope signal rather than a retryable error, and never attempts to read a mailbox through another application.
Responsibilities
| Activity | Customer identity admin | Customer Exchange admin | Customer security or risk | Ontinue engineering | Ontinue security lead |
|---|---|---|---|---|---|
| Approve mailbox scope and use | Consulted | Consulted | Accountable | Informed | Consulted |
Consent and Mail.Read grant | Responsible | Informed | Accountable | Informed | Informed |
| Exchange service principal, scope, and assignment | Informed | Responsible | Accountable | Consulted | Informed |
Test-ServicePrincipalAuthorization | Informed | Responsible | Accountable | Consulted | Informed |
| Phishing application and federated credential | Informed | Informed | Informed | Responsible | Consulted |
| End-to-end Graph validation | Informed | Consulted | Informed | Responsible | Consulted |
| Design and change review | Informed | Informed | Consulted | Responsible | Accountable |
| Offboarding | Responsible | Responsible | Accountable | Responsible | Informed |
Revocation and offboarding
- Remove one mailbox. Clear the custom attribute or remove it from the Administrative Unit. Exchange denies access on subsequent requests.
- Stop all mailbox access. Remove the management role assignment; then remove the scope and the Exchange service principal.
- Full offboarding. The customer identity administrator removes the consent or deletes the enterprise application after the Exchange objects are removed.
- Ontinue-side emergency. Remove the workload’s federated credential from the phishing application or disable the calling workload.
ION re-runs the end-to-end check when the customer reports scope changes and suspends processing for the tenant if an out-of-scope read ever succeeds.
Audit
The customer’s Entra audit log records consent and permission grants; the
Exchange admin audit log records New-ServicePrincipal, New-ManagementScope,
and New-ManagementRoleAssignment changes; the customer’s mailbox audit records
application access. ION records the onboarding record, validation evidence for the
in-scope and out-of-scope tests, token exchanges, and per-message access with
customer, mailbox, workload, and correlation ID. ION never logs tokens,
assertions, or message bodies in identity logs.