| name | cis-azure-foundations-5.2.3 |
| description | Ensure an exclusionary device code flow policy is considered |
| category | cis-azure-foundations |
| version | 5.0.0 |
| author | cyberstrike-official |
| tags | ["cis","azure","identity","conditional-access"] |
| cis_id | 5.2.3 |
| cis_benchmark | CIS Microsoft Azure Foundations Benchmark v5.0.0 |
| tech_stack | ["azure"] |
| cwe_ids | [] |
| chains_with | ["cis-azure-foundations-5.2.2","cis-azure-foundations-5.2.4"] |
| prerequisites | [] |
| severity_boost | {} |
Ensure an exclusionary device code flow policy is considered
Description
Conditional Access Policies can be used to prevent the Device code authentication flow. Device code flow should be permitted only for users that regularly perform duties that explicitly require the use of Device Code to authenticate, such as utilizing Azure with PowerShell.
Rationale
Attackers use Device code flow in phishing attacks and, if successful, results in the attacker gaining access tokens and refresh tokens which are scoped to "user_impersonation", which can perform any action the user has permission to perform.
Impact
Microsoft Entra ID P1 or P2 is required.
This policy should be tested using the Report-only mode before implementation. Without a full and careful understanding of the accounts and personnel who require Device code authentication flow, implementing this policy can block authentication for users and devices who rely on Device code flow. For users and devices that rely on device code flow authentication, more secure alternatives should be implemented wherever possible.
Audit Procedure
Using Azure Portal
- From Azure Home open the Portal menu in the top left and select
Microsoft Entra ID.
- Scroll down in the menu on the left and select
Security.
- Select on the left side
Conditional Access.
- Select
Policies.
- Select the policy you wish to audit, then:
- Under
Assignments > Users, review the users and groups for the personnel the policy will apply to.
- Under
Assignments > Target resources, review the cloud apps or actions for the systems the policy will apply to.
- Under
Conditions > Authentication Flows, review the configuration to ensure Device code flow is selected.
- Under
Access Controls > Grant - Confirm that Block access is selected.
Expected Result
At least one Conditional Access policy should exist that blocks the Device code authentication flow, targeting all users with appropriate exclusions for emergency access accounts.
Remediation
Remediate from Azure Portal
Part 1 of 2 - Create the policy and enable it in Report-only mode.
- From Azure Home open the portal menu in the top left and select .