Control: 5.2.2.6 Enable Azure AD Identity Protection user risk policies
Description
Azure Active Directory Identity Protection user risk policies detect the probability that a user account has been compromised.
Note: While Identity Protection also provides two risk policies with limited conditions, Microsoft highly recommends setting up risk-based policies in Conditional Access as opposed to the "legacy method" for the following benefits:
- Enhanced diagnostic data
- Report-only mode integration
- Graph API support
- Use more Conditional Access attributes like sign-in frequency in the policy
With the user risk policy turned on, Azure AD detects the probability that a user account has been compromised. Administrators can configure a user risk conditional access policy to automatically respond to a specific user risk level.
Remediation
To configure a User risk policy, use the following steps:
- Navigate to the
Microsoft Entra admin center
https://entra.microsoft.com. - Click expand
Protection
>Conditional Access
selectPolicies.
- Create a new policy by selecting
New policy.
- Set the following conditions within the policy:
- Under
Users or workload identities
chooseAll users.
- Under
Cloud apps or actions
chooseAll cloud apps.
- Under
Conditions
chooseUser risk
thenYes
and select the user risk levelHigh
. - Under
Access Controls
selectGrant
then in the right pane clickGrant access
then selectRequire multifactor authentication
andRequire password change.
- Under
Session
ensureSign-in frequency
is set toEvery time.
- Under
- Click
Select.
- You may opt to begin in a state of
Report Only
as you step through implementation however, the policy will need to be set toOn
to be in effect. - Click
Create.
Note: for more information regarding risk levels refer to Microsoft's Identity Protection & Risk Doc
Usage
Run the control in your terminal:
powerpipe control run microsoft365_compliance.control.cis_v300_5_2_2_6
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run microsoft365_compliance.control.cis_v300_5_2_2_6 --share
SQL
This control uses a named query:
with block_legacy_authentication as ( select tenant_id, count(*) from azuread_conditional_access_policy where users->'includeUsers' ?& array['All'] and jsonb_array_length(users -> 'excludeUsers') = 0 and jsonb_array_length(user_risk_levels) != 0 and applications->'includeApplications' ?& array['All'] and jsonb_array_length(applications -> 'excludeApplications') = 0 and built_in_controls ?& array['passwordChange'] group by tenant_id),tenant_list as ( select distinct on (tenant_id) tenant_id, _ctx from azuread_user)select t.tenant_id as resource, case when (select count from block_legacy_authentication where tenant_id = t.tenant_id) > 0 then 'ok' else 'alarm' end as status, case when (select count from block_legacy_authentication where tenant_id = t.tenant_id) > 0 then t.tenant_id || ' has user risk policies enabled.' else t.tenant_id || ' has user risk policies disabled.' end as reason , t.tenant_id as tenant_idfrom tenant_list as t;