CIS.M365.5.2.2.12 - (L1) Ensure the device code sign-in flow is blocked
Overviewβ
An enabled Conditional Access policy blocks the device code authentication flow for all users and all cloud apps.
In device code phishing, an attacker starts a device code sign-in and tricks the victim into entering the code on the genuine Microsoft sign-in page. The victim completes MFA and the attacker receives valid tokens. The flow exists for devices without a keyboard, which most organisations do not use.
Blocking the flow removes the technique. A device filter or an excluded role other than the two directory synchronization roles is reported by this check. User and group exclusions are not evaluated, and application exclusions are not evaluated when the policy targets all apps; document and review such exclusions separately.
Remediation actionβ
- Sign in to the Microsoft Entra admin center.
- Go to Entra ID > Conditional Access > Policies and select New policy.
- Under Users, include All users. Exclude your emergency access accounts.
- Under Target resources, select All resources (formerly All cloud apps).
- Under Conditions > Authentication flows, set Configure to Yes and select Device code flow.
- Under Grant, select Block access.
- Set Enable policy to On (use Report-only first to measure the impact) and select Create.
Related linksβ
- Microsoft Entra admin center - Conditional Access policies
- Block authentication flows with Conditional Access
- Conditional Access: authentication flows
- CIS Microsoft 365 Foundations Benchmark v7.0.0 - 5.2.2.12
Test Metadataβ
| Field | Value |
|---|---|
| Test ID | CIS.M365.5.2.2.12 |
| Severity | High |
| Suite | CIS |
| Product | Entra ID |
| Feature | Conditional Access |
| Area | Authentication |
| Resource type | Tenant |
| User impact | Low |
| Implementation cost | Medium |
| MITRE ATT&CK | T1078.004 Cloud Accounts, T1528 Steal Application Access Token, T1566 Phishing |
| Supports benchmark | CIS Microsoft 365 Foundations Benchmark (version 7.0.0), requirement 5.2.2.12 |
| Benchmark level | L1 |
| Benchmark profiles | E3 Level 1 |
| Supports controls | cis-m365:5.2.2.12, nist-800-53-r5:CM-7 |
| PowerShell test | Test-MtCisBlockDeviceCodeFlow |
| Services | Graph |
| Compatible licenses | AAD_PREMIUM |
Sourceβ
- Test:
tests/cis/Test.CIS.M365.5.2.2.12.ps1 - Documentation:
tests/cis/Test.CIS.M365.5.2.2.12.md
