turbot/steampipe-mod-microsoft365-compliance

Control: 1.1.14 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.

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:

  1. Navigate to Microsoft Entra admin center https://entra.microsoft.com/.
  2. Click to expand Azure Active Directory > Protect & secure select Conditional Access.
  3. On the Conditional Access page, create a new policy by selecting New policy.
  4. Set the following conditions within the policy:
  • Under Users or workload identities choose All users.
  • Under Cloud apps or actions choose All cloud apps.
  • Under Conditions choose User risk then Yes in the right pane followed by the appropriate level.
  • Under Access Controls select Grant then in the right pane click Grant access then select Require password change.
  1. Click Select.
  2. You may opt to begin in a state of Report Only as you step through implementation however, the policy will need to be set to On to be in effect.
  3. 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_v200_1_1_14

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run microsoft365_compliance.control.cis_v200_1_1_14 --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_id
from
tenant_list as t;

Tags