Skip to content
3.0 preview2.3.0 stable

These docs describe the preview. Pick the version you run and every page marks what it doesn't have yet. Get the preview →
Maester 2.x docs (archived) →

Sponsor

(L1) Ensure the device code sign-in flow is blocked

CIS.M365.5.2.2.12HighEntra IDConditional AccessPreview 3.0

Part of CIS · Entra ID · Conditional Access · All checks

Run this check
Invoke-Maester -TestId CIS.M365.5.2.2.12

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.

  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.
Every attribute of this check
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