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

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

The Microsoft identity platform supports the device authorization grant, which allows users to sign in to input-constrained devices such as a smart TV, IoT device, or a printer. To enable this flow, the device has the user visit a webpage in a browser on another device to sign in. Once the user signs in, the device is able to get access tokens and refresh tokens as needed.

The recommended state is to Block access for Device code flow in Conditional Access.

Since August 2024, Microsoft has observed threat actors, such as Storm-2372, employing "device code phishing" attacks. These attacks deceive users into logging into productivity applications, capturing authentication tokens to gain further access to compromised accounts.

To mitigate this specific attack, block authentication code flows and permit only those from devices within trusted environments, identified by specific IP addresses.

Solution

To remediate using the UI:

- Navigate to the Microsoft Entra admin center https://entra.microsoft.com.
- Click expand ID Protection > Risk-based Conditional Access.
- Create a new policy by selecting New policy.
- Under Users include All users.
- Under Target resources > Resources (formerly cloud apps) include All resources (formerly 'All cloud apps').
- Under Conditions > Authentication flows set Configure is set to Yes, select Device code flow and click Save.
- Under Grant select Block access and click Select.

- Under Enable policy set it to Report-only until the organization is ready to enable it.
- Click Create.

Note: Break-glass accounts should be excluded from all Conditional Access policies.

Impact:

Some administrative overhead will be required for stricter management of these devices. Since exclusions do not violate compliance, this feature can still be utilized effectively within a controlled environment.

See Also

https://workbench.cisecurity.org/benchmarks/22162