You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Microsoft 365 provider scans your M365 tenant for security compliance, covering identity protection, conditional access, devices, applications, and security configuration.
Overview
Use the Microsoft 365 provider to validate:
Identity protection (MFA, sign-in risk, user risk)
Supported account types: Accounts in this organizational directory only
Redirect URI: Leave blank
Click Register
Note Application Details
After registration, note down:
Application (client) ID: Found on the Overview page
Directory (tenant) ID: Found on the Overview page
Create Client Secret
Go to Certificates & secrets
Click New client secret
Add a description and select expiration period
Click Add
Important: Copy the secret value immediately (shown only once)
Configure API Permissions
Go to API permissions > Add a permission > Microsoft Graph > Application permissions
Required Permissions:
Permission
Description
Organization.Read.All
Read organization information
User.Read.All
Read all users' full profiles
Group.Read.All
Read all groups
Application.Read.All
Read all applications
Directory.Read.All
Read directory data
Policy.Read.All
Read all policies
SecurityEvents.Read.All
Read security events
IdentityRiskEvent.Read.All
Read identity risk events
Domain.Read.All
Read domain data
Optional Permissions:
Permission
Description
Team.ReadBasic.All
Read Teams info
TeamSettings.Read.All
Read Teams settings
DeviceManagementConfiguration.Read.All
Read Intune configs
DeviceManagementManagedDevices.Read.All
Read managed devices
RoleManagement.Read.Directory
Read directory role info
Grant Admin Consent
Click Grant admin consent for [Your Organization]
Confirm by clicking Yes
Verify all permissions show "Granted"
Resources
The MS365 provider discovers the following resources:
Identity
Resource
Description
ms365_tenant
Tenant/organization information
ms365_user
User accounts and settings
ms365_group
Microsoft 365 groups
ms365_directory_role
Directory roles and members
ms365_risky_user
Users flagged as risky
Applications
Resource
Description
ms365_application
Registered applications
ms365_service_principal
Service principals
Devices
Resource
Description
ms365_device
Azure AD devices
ms365_managed_device
Intune managed devices
ms365_device_configuration
Intune device configurations
ms365_device_compliance_policy
Device compliance policies
Policies
Resource
Description
ms365_conditional_access_policy
Conditional Access policies
ms365_authorization_policy
Authorization policies
ms365_authentication_method_policy
Authentication method policies
ms365_security_defaults_policy
Security defaults policy
ms365_named_location
Named locations for CA
Security
Resource
Description
ms365_secure_score
Secure Score with control scores
Collaboration
Resource
Description
ms365_team
Microsoft Teams
ms365_domain
Verified domains
ms365_directory_setting
Directory settings
Resource Fields
ms365_user
Field
Type
Description
id
string
User ID
displayName
string
Display name
userPrincipalName
string
User principal name (email)
mail
string
Email address
accountEnabled
bool
Account is enabled
userType
string
User type (Member, Guest)
passwordPolicies
string
Password policies
onPremisesSyncEnabled
bool
Synced from on-premises
assignedLicenses
[]object
Assigned license SKUs
authenticationMethods
[]object
Authentication methods
mfaEnabled
bool
MFA is enabled (computed)
ms365_secure_score
Field
Type
Description
id
string
Secure Score ID
currentScore
double
Current security score
maxScore
double
Maximum possible score
controlScores
[]object
Individual control scores
Control Score Fields:
Field
Type
Description
controlName
string
Control identifier
score
double
Current score for control
description
string
Control description
ms365_conditional_access_policy
Field
Type
Description
id
string
Policy ID
displayName
string
Policy name
state
string
State (enabled, disabled, enabledForReportingButNotEnforced)
conditions
object
Policy conditions
grantControls
object
Grant controls (MFA, etc.)
sessionControls
object
Session controls
ms365_authorization_policy
Field
Type
Description
id
string
Policy ID
displayName
string
Policy name
guestUserRoleId
string
Guest user role GUID
allowInvitesFrom
string
Who can invite guests
blockMsolPowerShell
bool
Block legacy PowerShell
defaultUserRolePermissions
object
Default user permissions
defaultUserRolePermissions Fields:
Field
Type
Description
allowedToCreateApps
bool
Users can register apps
allowedToCreateSecurityGroups
bool
Users can create security groups
allowedToCreateTenants
bool
Users can create tenants
allowedToReadOtherUsers
bool
Users can read other users
ms365_security_defaults_policy
Field
Type
Description
id
string
Policy ID
displayName
string
Policy name
isEnabled
bool
Security defaults enabled
ms365_directory_role
Field
Type
Description
id
string
Role ID
displayName
string
Role name
description
string
Role description
memberCount
int
Number of members
ms365_domain
Field
Type
Description
id
string
Domain name
isDefault
bool
Is default domain
isInitial
bool
Is initial domain
isVerified
bool
Domain is verified
passwordValidityPeriodInDays
int
Password validity period
serviceConfigurationRecords
[]object
Required DNS records
ms365_device_configuration
Field
Type
Description
id
string
Configuration ID
displayName
string
Configuration name
configurationType
string
Configuration OData type
storageRequireDeviceEncryption
bool
Require device encryption
passwordMinimumLength
int
Minimum password length
passcodeMinimumLength
int
Minimum passcode length (iOS)
ms365_team
Field
Type
Description
id
string
Team ID
displayName
string
Team name
guestSettings
object
Guest permissions
guestSettings Fields:
Field
Type
Description
allowCreateUpdateChannels
bool
Guests can create/update channels
allowDeleteChannels
bool
Guests can delete channels
ms365_risky_user
Field
Type
Description
id
string
User ID
userDisplayName
string
Display name
userPrincipalName
string
UPN
riskLevel
string
Risk level (none, low, medium, high)
riskState
string
Risk state (atRisk, remediated, dismissed)
riskLastUpdatedDateTime
timestamp
Last update time
Example Policies
Identity Protection
queries:
- uid: sign-in-risk-policytitle: Sign-in risk policies are configuredresource: ms365_secure_scoreseverity: highquery: | resource.controlScores.exists(c, c.controlName == "SigninRiskPolicy" && c.score >= 7.0 )docs: | Sign-in risk policies detect suspicious sign-in attempts.remediation: | Configure a sign-in risk policy in Conditional Access.
- uid: user-risk-policytitle: User risk policies are configuredresource: ms365_secure_scoreseverity: criticalquery: | resource.controlScores.exists(c, c.controlName == "UserRiskPolicy" && c.score >= 7.0 )docs: | User risk policies detect compromised accounts.remediation: | Configure a user risk policy in Conditional Access.
- uid: admin-mfa-enabledtitle: MFA enabled for administratorsresource: ms365_secure_scoreseverity: criticalquery: | resource.controlScores.exists(c, c.controlName == "AdminMFAV2" && c.score >= 10.0 )docs: | All administrative accounts should have MFA enabled.remediation: | Create a Conditional Access policy requiring MFA for admin roles.
Conditional Access
queries:
- uid: conditional-access-enabledtitle: Conditional Access policies are activeresource: ms365_conditional_access_policyseverity: highquery: resource.state == "enabled"docs: | Conditional Access policies should be enabled, not in report-only mode.remediation: | Set policy state to "On" instead of "Report-only".
- uid: legacy-auth-blockedtitle: Legacy authentication is blockedresource: ms365_secure_scoreseverity: highquery: | resource.controlScores.exists(c, c.controlName == "BlockLegacyAuthentication" && c.score >= 8.0 )docs: | Legacy protocols don't support MFA and are security risks.remediation: | Create a CA policy blocking Exchange ActiveSync and other clients.
Security Defaults
queries:
- uid: security-defaults-disabledtitle: Security defaults disabled for custom CAresource: ms365_security_defaults_policyseverity: mediumquery: resource.isEnabled == falsedocs: | Disable security defaults when using custom Conditional Access.remediation: | Disable security defaults before enabling custom CA policies.
Directory Roles
queries:
- uid: global-admin-counttitle: Global admins between 2 and 4resource: ms365_directory_roleseverity: highquery: | resource.displayName != "Global Administrator" || (resource.memberCount >= 2 && resource.memberCount <= 4)docs: | Too few admins risks lockout; too many increases attack surface.remediation: | Ensure 2-4 Global Administrators are assigned.
Guest Access
queries:
- uid: guest-access-restrictedtitle: Guest users have restricted accessresource: ms365_authorization_policyseverity: mediumquery: | resource.guestUserRoleId == "2af84b1e-32c8-42b7-82bc-daa82404023b" || resource.guestUserRoleId == "10dae51f-b6af-4016-8d66-8c2a99b929b3"docs: | Guests should have limited directory access. - Restricted Guest: 2af84b1e-32c8-42b7-82bc-daa82404023b - Guest User: 10dae51f-b6af-4016-8d66-8c2a99b929b3remediation: | Set guest user role to "Restricted Guest User" in External Identities.
Device Configuration
queries:
- uid: android-encryptiontitle: Android devices require encryptionresource: ms365_device_configurationseverity: highquery: | resource.configurationType != "#microsoft.graph.androidGeneralDeviceConfiguration" || resource.storageRequireDeviceEncryption == truedocs: | Android devices should require storage encryption.remediation: | Enable encryption requirement in Intune device configuration.
- uid: minimum-password-lengthtitle: Minimum password length enforcedresource: ms365_device_configurationseverity: highquery: | !has(resource.passwordMinimumLength) || resource.passwordMinimumLength >= 8docs: | Passwords should be at least 8 characters (NIST SP 800-63).remediation: | Set minimum password length to 8+ in device configuration.