Skip to Content
IntegrationsSaaSMicrosoft 365

Manually Set Up Microsoft 365 Continuous Scanning

Manually register the Azure app and configure the Mondoo Microsoft 365 integration.

Choose the manual setup when you need full control over the app registration or your environment requires it. Most users should use the automated setup instead.

Before you begin

  • Editor or Owner access to the Mondoo space, or another role with permission to add integrations. To see every role, read Roles and permissions.

  • A Microsoft Entra role that can grant admin consent and assign the Global Reader role:

    An Application Administrator or Cloud Application Administrator can register the app, but can't grant admin consent for Microsoft Graph application permissions or assign Global Reader. Ask a Global Administrator or Privileged Role Administrator to complete those steps.

  • Access to the Azure CLI (the Azure Cloud Shell already includes it)

If you don't have the Azure CLI yet
  1. Install the Azure CLI.
  2. Log in from PowerShell or a Linux/macOS shell:
    az login --allow-no-subscriptions
    Azure opens your browser for sign-in.

Register an Azure app for Mondoo

Continuous M365 scanning requires a Microsoft Entra ID app registration. The registration creates a service principal that represents Mondoo in your tenant.

The setup is four steps: register the app, grant Microsoft Graph permissions, assign the Global Reader role, and create a certificate or client secret for Mondoo to authenticate with.

Step A: Register the app

  1. Log into the Azure portal with one of the required roles above.

  2. Open Microsoft Entra ID > App registrations.

    Azure app registrations

  3. Select + New registration.

    create a new app registration in Azure

  4. Name the app mondoo-m365, select Accounts in this organizational directory only, and select Register. No redirect URI is needed.

Azure creates the application ID and shows it on the overview page. Keep this page open for the next steps.

new app registration in Azure

Step B: Grant Microsoft Graph API permissions

  1. In the navigation sidebar, select API permissions.

API permissions

By default, Microsoft grants your new application User.Read permission for Microsoft Graph. It's not required for Mondoo, so you can remove it.

  1. Select + Add a permission.

Add permission in Azure

  1. From the list of Commonly used Microsoft APIs, select Microsoft Graph.

API permissions

  1. Because Mondoo acts as a service, select Application permissions.

  2. Select expand all to see all permissions. Then select the required API permissions:

Microsoft GraphTypeDescription
Policy.Read.AllApplicationRead your organization's policies
Policy.Read.PermissionGrantApplicationRead consent and permission grant policies
SecurityEvents.Read.AllApplicationRead your organization's security events
DeviceManagementConfiguration.Read.AllApplicationRead Microsoft Intune device configuration and policies
AuditLog.Read.AllApplicationRead all audit log data
Directory.Read.AllApplicationRead directory data
AccessReview.Read.AllApplicationRead all access reviews
DeviceManagementServiceConfig.Read.AllApplicationRead Microsoft Intune configuration
Domain.Read.AllApplicationRead domains
Organization.Read.AllApplicationRead organization information
OrgSettings-AppsAndServices.Read.AllApplicationRead organization-wide apps and services settings
OrgSettings-Forms.Read.AllApplicationRead organization-wide Microsoft Forms settings
UserAuthenticationMethod.Read.AllApplicationRead all users' authentication methods
DeviceManagementApps.Read.AllApplicationRead Microsoft Intune apps
DeviceManagementManagedDevices.Read.AllApplicationRead Microsoft Intune devices
DeviceManagementRBAC.Read.AllApplicationRead Microsoft Intune RBAC settings
IdentityRiskEvent.Read.AllApplicationRead all identity risk event information
IdentityRiskyUser.Read.AllApplicationRead all identity risky user information
InformationProtectionPolicy.Read.AllApplicationRead all published labels and label policies for an organization
RoleManagement.Read.AllApplicationRead role management data for all RBAC providers
SecurityAlert.Read.AllApplicationRead all security alerts
SecurityIncident.Read.AllApplicationRead all security incidents
EntitlementManagement.Read.AllApplicationRead all entitlement management resources
Policy.Read.DeviceConfigurationApplicationRead your organization's device configuration policies
Domain-InternalFederation.Read.AllApplicationRead internal federation configuration for a domain
TeamSettings.Read.AllApplicationRead all teams' settings
ChannelSettings.Read.AllApplicationRead the names, descriptions, and settings of all channels
  1. Select the Add permissions button.

  2. Grant Mondoo read permissions for SharePoint. Select + Add a permission, select SharePoint from the list of Commonly used Microsoft APIs, and then select Application permissions. Microsoft Graph has a permission with the same name, but it doesn't give Mondoo access to SharePoint settings. Make sure you add the one from the SharePoint API.

    SharePoint APIsTypeDescription
    Sites.FullControl.AllApplicationHave full control of all site collections
  3. Select the Add permissions button.

  4. Grant Mondoo read permissions for Office 365 Exchange Online. You need to search in APIs my organization uses.

    Office 365 Exchange OnlineTypeDescription
    Exchange.ManageAsAppApplicationRun Exchange Online commands as if Mondoo was an administrator account
  5. Select the Add permissions button.

  6. Grant Mondoo read permissions for Microsoft Exchange Online Protection. You need to search in APIs my organization uses. This API is separate from Office 365 Exchange Online, and Mondoo needs both.

    Microsoft Exchange Online ProtectionTypeDescription
    Exchange.ManageAsAppApplicationRun Security & Compliance PowerShell cmdlets, such as reading DLP policies
  7. Select the Add permissions button.

  8. To complete the process, select Grant admin consent for (your tenant name) and select the Yes button to confirm.

Step C: Assign the Global Reader role

  1. In the Entra ID portal, go to Identity (Roles & admins).

  2. Search for Global Reader and select the role name (not the checkbox). The Assignments page opens.

  3. Select + Add assignments, find the mondoo-m365 app, and assign it the Global Reader role.

  4. Return to the Assignments page, select Refresh, and confirm the role is assigned.

Step D: Create and upload the authentication certificate

Mondoo authenticates with a certificate or a client secret. A certificate is recommended: SharePoint Online refuses a token issued from a client secret, so with a client secret the SharePoint Online check reports an error while Exchange Online, Teams, and the rest of the tenant scan normally. To use a client secret instead, skip to Create a client secret.

Create a certificate

Mondoo authenticates with a PEM certificate. You upload the certificate only to Azure, and the certificate plus private key to Mondoo. The PEM file you upload to Mondoo must use this format and order, with no password protection:

-----BEGIN PRIVATE KEY-----
key goes here
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
certificate goes here
-----END CERTIFICATE-----
Generate a self-signed certificate for testing

For testing only, generate a certificate with OpenSSL. Run in a Linux shell, macOS shell, or Azure Cloud Shell:

openssl req -newkey rsa:4096 -x509 -sha512 -days 365 -nodes -out certificate.pem -keyout privatekey.key

Combine the key and certificate:

cat privatekey.key certificate.pem > certificate.combo.pem

For Windows, see this simple OpenSSL installer.

Upload the certificate (only) to Azure:

  1. From the Azure portal home, go to Microsoft Entra ID > App registrations > your app.

  2. In the sidebar, select Certificates & secrets.

  3. Select Certificates > Upload certificate.

  4. Select the PEM file containing only the certificate (not the private key), enter a description such as Mondoo certificate, and select Add.

    Be sure to upload the file with only the certificate. The combined key-and-certificate file is for Mondoo, not Azure.

Create a client secret

  1. From the Azure portal home, go to Microsoft Entra ID > App registrations > your app.

  2. In the sidebar, select Certificates & secrets.

  3. Select Client secrets > New client secret, enter a description, choose when the secret expires, and select Add.

  4. Copy the secret's Value right away. Azure shows it only once.

Add the Microsoft 365 integration in Mondoo

You need these values from the Azure app registration you created:

  • Application (client) ID
  • Directory (tenant) ID
  • The combined PEM file (private key + certificate), or the client secret

In the Mondoo App, navigate to the space where you want to add the integration. In the side navigation bar, select Integrations. In the top right, select INSTALL. On the Install Integration page, find the integration you want by browsing a category or searching by name:

  1. Under SaaS Security, select Microsoft 365, then select the Manual Setup tab.

    The Manual Setup tab of the Microsoft 365 integration form in the Mondoo App

  2. In Choose an integration name, enter a name that identifies the tenant.

  3. Under Provide the app registration's credentials, choose where the credential comes from:

    • Enter a certificate or client secret: Select the Credential type, Certificate (PEM) or Client secret. Paste the Directory (tenant) ID in the Tenant ID box and the Application (client) ID in the Client ID (Application ID) box. For a certificate, select UPLOAD PEM FILE and choose the combined PEM file (private key plus certificate). For a client secret, enter it in the Client secret box. Mondoo stores what you enter as a credential in the space.
    • Use an existing credential: If the space already holds a credential for this app registration, select it instead. The tenant and client IDs come from the credential.

    To learn more, read Manage Integration Credentials. If you can't create credentials in the space, the form doesn't offer these choices. It accepts a certificate only.

  4. (Optional) Under Enable security policies (optional), enable the policies you want Mondoo to score your Microsoft 365 tenant against.

  5. (Optional) Under Set Annotations (optional), select + ADD ANNOTATION to add key-value pairs that Mondoo applies to every asset this integration discovers. To learn more, read Annotate assets.

  6. Select START SCANNING.

Verify the integration

  1. In the Mondoo App, select Integrations in the side navigation bar, then select Microsoft 365 and open your integration. Its status is Active when Mondoo can scan the tenant. Error means the last scan failed; check the integration page for the message.

    The Integration Details section of an integration page, with the status Active and a SHOW ASSETS button

  2. When the first scan completes, your Microsoft 365 tenant appears on the INVENTORY page with its check results.

  3. If the integration uses a client secret, the SharePoint Online check reports an error. That's expected; the rest of the tenant scans normally.

If the integration page shows Scans are paused, or checks report access errors, read Test and Troubleshoot a Microsoft 365 Integration. To learn what each status means, read Integration status and troubleshooting.

Renew the certificate or client secret

A certificate or client secret you create with the Azure CLI or in the Azure portal expires, by default after one year. When it expires, the integration stops scanning:

  • If a credential in the space manages the integration, Mondoo marks the credential Expired and shows a Scans are paused alert on the integration page: Credential "<name>" has expired. Rotate it to resume scanning. If Mondoo can't read the expiration date, it reports the credential as rejected instead: Credential "<name>" was rejected by the provider. Update it to resume scanning.
  • If the integration holds its certificate directly, its scans fail and its status changes to Error.

Renew the certificate or client secret before it expires:

  1. Create a new certificate or client secret for the app registration. For example, to create a certificate in Azure Cloud Shell (substituting your application ID), run:

    az ad app credential reset --id XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX --create-cert --years 1

    The command prints the path of a PEM file that contains the private key and certificate. Download it with Cloud Shell's Manage files > Download. To create a client secret instead, omit --create-cert, and the command prints the new secret as password.

  2. In the Mondoo App, navigate to Integrations > Microsoft 365 > your M365 integration and select the edit (pencil) icon.

  3. Update the integration:

    • If the Authentication step says Managed by a credential, select the credential it links to, or open it in the space's Settings > Credentials. Select Rotate and enter the new certificate or client secret. Every integration that uses the credential switches to it. To learn more, read Manage Integration Credentials.

    • Otherwise, the integration holds its certificate directly. Under Certificate (optional update), select UPLOAD NEW CERTIFICATE FILE and choose the new PEM file, or paste the certificate PEM into the box. Then select SAVE CHANGES.

      The Certificate (optional update) step of the Microsoft 365 integration edit form in the Mondoo App

Next steps

Last updated on

On this page