Remediation
From Azure Portal
Part 1 of 2 - Create the policy and enable it in Report-only mode
- In the Azure portal, open the portal menu in the upper left and select
Microsoft Entra ID. - Scroll down in the menu on the left and select
Security. - On the left, select
Conditional Access. - Select
Policies. - Click the
+ New policybutton, then: - Provide a name for the policy.
- Under
Assignments, selectUsers, then:- Under
Include, selectAll users. - Under
Exclude, check Users and groups and only select emergency access accounts.
- Under
- Under
Assignments, selectTarget resources, then:- Under
Include, selectAll cloud apps. - Leave
Excludeblank unless you have a well-defined exception.
- Under
- Under
Conditions>Authentication Flows, setConfiguretoYes, then:- Select
Device code flow. - Select
Done.
- Select
- Under
Access Controls>Grant, selectBlock Access. - Set
Enable policytoReport-only. - Click
Create.
Allow some time to pass to ensure the sign-in logs capture relevant conditional access events. These events will need to be reviewed to determine if additional considerations are necessary for your organization (e.g. many legitimate use cases of device code authentication are observed).
Note: The policy is not yet live, since Report-only is being used to audit the effect of the policy.
Part 2 of 2 - Confirm that the policy is not blocking access that should be granted, then toggle to On
- With your policy now in report-only mode, return to the Microsoft Entra blade and click on
Sign-in logs. - Review the recent sign-in events. Select an event, then review the event details (specifically the
Report-onlytab) to ensure:- The sign-in event you're reviewing occurred after turning on the policy in report-only mode.
- The policy name from step 6 above is listed in the
Policy Namecolumn. - The
Resultcolumn for the new policy shows that the policy wasNot applied(indicating the device code authentication flow was not blocked).
- If the above conditions are present, navigate back to the policy name in Conditional Access and open it.
- Toggle the policy from
Report-onlytoOn. - Click
Save.