Skip to main content
Version: 3.0.0-preview

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​

  1. Sign in to the Microsoft Entra admin center.
  2. Go to Entra ID > Conditional Access > Policies and select New policy.
  3. Under Users, include All users. Exclude your emergency access accounts.
  4. Under Target resources, select All resources (formerly All cloud apps).
  5. Under Conditions > Authentication flows, set Configure to Yes and select Device code flow.
  6. Under Grant, select Block access.
  7. Set Enable policy to On (use Report-only first to measure the impact) and select Create.

Test Metadata​

FieldValue
Test IDCIS.M365.5.2.2.12
SeverityHigh
SuiteCIS
ProductEntra ID
FeatureConditional Access
AreaAuthentication
Resource typeTenant
User impactLow
Implementation costMedium
MITRE ATT&CKT1078.004 Cloud Accounts, T1528 Steal Application Access Token, T1566 Phishing
Supports benchmarkCIS Microsoft 365 Foundations Benchmark (version 7.0.0), requirement 5.2.2.12
Benchmark levelL1
Benchmark profilesE3 Level 1
Supports controlscis-m365:5.2.2.12, nist-800-53-r5:CM-7
PowerShell testTest-MtCisBlockDeviceCodeFlow
ServicesGraph
Compatible licensesAAD_PREMIUM

Source​