Microsoft 365 Authentication¶
DRACO authenticates to Microsoft 365 with an application registration (app-only authentication).
Common Setup¶
Authentication Methods Overview¶
Required Permissions¶
To run the full DRACO provider, including PowerShell checks, two types of permission scopes must be set in Microsoft Entra ID.
Application Permissions for App-Only Authentication¶
When using service principal authentication, add these Application Permissions:
Microsoft Graph API Permissions:
AccessReview.Read.All: Required forentra_access_review_guest_users_configuredandentra_access_review_privileged_roles_configuredchecks. A Microsoft Entra ID P2 or Microsoft Entra ID Governance license is also required.AuditLog.Read.All: Required for Entra service.Directory.Read.All: Required for all services.OnPremDirectorySynchronization.Read.All: Required forentra_seamless_sso_disabledcheck (hybrid deployments).Policy.Read.All: Required for all services.RoleManagementPolicy.Read.Directory: Required forentra_pim_global_administrator_approval_requiredandentra_pim_privileged_role_administrator_approval_requiredchecks. A Microsoft Entra ID P2 or Microsoft Entra ID Governance license is also required.SecurityIdentitiesHealth.Read.All: Required fordefenderidentity_health_issues_no_opencheck.SecurityIdentitiesSensors.Read.All: Required fordefenderidentity_health_issues_no_opencheck.SharePointTenantSettings.Read.All: Required for SharePoint service.ThreatHunting.Read.All: Required for Defender XDR checks (defenderxdr_endpoint_privileged_user_exposed_credentials,defenderxdr_critical_asset_management_pending_approvals).DeviceManagementServiceConfig.Read.All: Required for Intune device management settings used byentra_conditional_access_policy_mdm_compliant_device_requiredcheck.DeviceManagementConfiguration.Read.All: Required for Intune device compliance policies used byentra_conditional_access_policy_mdm_compliant_device_requiredcheck.DeviceManagementManagedDevices.Read.All: Required for Intune managed devices used byentra_conditional_access_policy_mdm_compliant_device_requiredcheck.
External API Permissions:
Exchange.ManageAsAppfrom external APIOffice 365 Exchange Online: Required for Exchange PowerShell module app authentication. TheGlobal Readerrole must also be assigned to the app.application_accessfrom external APISkype and Teams Tenant Admin API: Required for Teams PowerShell module app authentication.
Note
Directory.Read.All can be replaced with Domain.Read.All for more restrictive permissions, but Entra checks related to DirectoryRoles and GetUsers will not run. If using this option, you must also add the Organization.Read.All permission to the application registration for authentication.
Note
These permissions enable application-based authentication methods (client secret and certificate). Using certificate-based authentication is the recommended way to run the full M365 provider, including PowerShell checks.
Step-by-Step Permission Assignment¶
Create Application Registration¶
- Access Microsoft Entra ID.

- Navigate to "Applications" > "App registrations".

- Click "+ New registration", complete the form, and click "Register".

- Go to "Certificates & secrets" > "Client secrets" > "+ New client secret".

- Fill in the required fields and click "Add", then copy the generated Value (shown once): it is the Client secret you enter in DRACO.

Grant Microsoft Graph API Permissions¶
- Open API permissions for the DRACO application registration.

- Click "+ Add a permission" > "Microsoft Graph" > "Application permissions".

-
Search and select the required permissions:
-
AccessReview.Read.All: Required forentra_access_review_guest_users_configuredandentra_access_review_privileged_roles_configuredchecks. A Microsoft Entra ID P2 or Microsoft Entra ID Governance license is also required AuditLog.Read.All: Required for Entra serviceDirectory.Read.All: Required for all servicesOnPremDirectorySynchronization.Read.All: Required forentra_seamless_sso_disabledcheck (hybrid deployments)Policy.Read.All: Required for all servicesRoleManagementPolicy.Read.Directory: Required forentra_pim_global_administrator_approval_requiredandentra_pim_privileged_role_administrator_approval_requiredchecks. A Microsoft Entra ID P2 or Microsoft Entra ID Governance license is also requiredSecurityIdentitiesHealth.Read.All: Required fordefenderidentity_health_issues_no_opencheckSecurityIdentitiesSensors.Read.All: Required fordefenderidentity_health_issues_no_opencheckSharePointTenantSettings.Read.All: Required for SharePoint service


- Click "Add permissions", then click "Grant admin consent for
<your-tenant-name>".
Grant PowerShell Module Permissions¶
-
Add Exchange API:
-
Search and select "Office 365 Exchange Online" API in APIs my organization uses.

- Select "Exchange.ManageAsApp" permission and click "Add permissions".

- Assign
Global Readerrole to the app: Go toRoles and administrators> clickherefor directory level assignment.

- Search for
Global Readerand assign it to the application.

-
Add Teams API:
-
Search and select "Skype and Teams Tenant Admin API" in APIs my organization uses.

- Select "application_access" permission and click "Add permissions".

- Click "Grant admin consent for
<your-tenant-name>" to grant admin consent.

Final permissions should look like this:

Application Certificate Authentication (Recommended)¶
Certificate-based authentication replaces the client secret with an X.509 certificate that signs Microsoft Entra ID tokens for the DRACO application registration.
This is the recommended approach for production environments because it avoids long-lived secrets, supports the full provider (including PowerShell checks), and simplifies unattended automation. Microsoft also recommends certificate credentials for app-only access, see Manage certificates for applications.
Generate the Certificate¶
The service principal needs a certificate that contains the private key locally (for DRACO) and the public key uploaded to Microsoft Entra ID. The following commands show a secure baseline workflow on macOS or Linux using OpenSSL:
# 1. Create a private key (keep this file private; do not upload it to the portal)
openssl genrsa -out dracom365.key 2048
# 2. Create a self-signed certificate valid for two years
openssl req -x509 -new -nodes -key dracom365.key -sha256 -days 730 -out dracom365.cer -subj "/CN=DracoM365Cert"
# 3. Package the key and certificate into a passwordless PFX bundle for DRACO
openssl pkcs12 -export \
-out dracom365.pfx \
-inkey dracom365.key \
-in dracom365.cer \
-passout pass:
Warning
Guard dracom365.key and dracom365.pfx. Only upload the .cer file to the Entra ID portal. Rotate or revoke the certificate before it expires or if there is any suspicion of exposure.
If an internal certificate authority is preferred, replace step 2 with a CSR workflow and import the signed certificate instead.
Upload the Certificate to Microsoft Entra ID¶
- Open Microsoft Entra ID > App registrations > the DRACO application.
- Go to Certificates & secrets > Certificates.
- Select Upload certificate and choose
dracom365.cer. - Confirm the certificate appears with the expected expiration date.
After the certificate is in place, encode the PFX file as Base64 (macOS/Linux example):
base64 -i dracom365.pfx -o dracom365.pfx.b64
cat dracom365.pfx.b64 | tr -d '\n'
Copy the resulting single-line Base64 string (or the contents of dracom365.pfx.b64) for the next step.
Provide the Certificate to DRACO¶
Paste the Base64-encoded PFX in the Certificate Content field when configuring the Microsoft 365 provider in DRACO.
Store the PFX file itself securely (or delete it): DRACO keeps the content encrypted.
Note
Do not mix certificate authentication with a client secret. Provide either a certificate or a secret to the application registration and DRACO configuration.
Application Client Secret Authentication¶
Authenticate using a Microsoft Entra application registration with a client secret (tenant ID, client ID and client secret). This is helpful for initial validation or temporary access. Plan to transition to certificate-based authentication to remove long-lived secrets and keep full provider coverage in unattended environments.
Note
To scan every M365 check, ensure the required permissions are added to the application registration. Refer to the PowerShell Module Permissions section for more information.
If the external API permissions described above are not added, only checks that work through Microsoft Graph will be executed. This means that the full provider will not be executed.
Enter the Credentials in DRACO¶
Use the shared permissions and credentials above, then complete the Microsoft 365 provider form in DRACO. The platform persists the encrypted credentials and supplies them during scans.
Application Certificate Authentication (Recommended)¶
- Select App Certificate Credentials.
- Enter the tenant ID and application (client) ID.
- Paste the Base64-encoded certificate in Certificate Content.
This method keeps all Microsoft 365 checks available, including PowerShell-based checks.
Application Client Secret Authentication¶
- Select App Client Secret Credentials.
- Enter the tenant ID and application (client) ID.
- Enter the client secret.