Tutorials
Conditional Access policies every Microsoft 365 tenant should have
A starter set of Conditional Access policies for Microsoft Entra ID, the order to roll them out safely, and the KQL to check their impact before you enforce.
Published 5 min readReviewed by The Ledger EditorIntermediate
Most of the account compromises in our other tutorials would have been stopped, or at least slowed down, by a handful of Conditional Access policies. Conditional Access is the policy engine of Microsoft Entra ID: each policy says if this user signs in to this resource under these conditions, then require this control, such as MFA, a compliant device, or a block.
This tutorial gives you a starter set of policies, based on Microsoft's own templates, and the order to deploy them without locking anyone out, including yourself.
Before you start
- Licensing: Conditional Access requires Microsoft Entra ID P1, included in plans such as Microsoft 365 Business Premium, E3 and E5. The risk-based policies near the end need Entra ID P2. Without these licenses, turn on security defaults, which enforce a basic version of several of these protections. Security defaults and Conditional Access can't be used at the same time.
- Role: at least Conditional Access Administrator in the Microsoft Entra admin center, under Entra ID → Conditional Access.
- Templates: most of the policies below exist as templates under Create new policy from templates. Microsoft documents them in Conditional Access templates.
Step zero: emergency access accounts
A Conditional Access mistake can block every administrator at once. Before you create any policy, set up at least two emergency access accounts, following Microsoft's guidance:
- Cloud-only accounts on the
onmicrosoft.comdomain, not synchronized from Active Directory, with the Global Administrator role permanently active. - Protected by a passkey (FIDO2 security key) or certificate, different from the methods your normal admins use.
- Placed in a dedicated group, such as EmergencyAccess, that you exclude from every policy that blocks or restricts sign-in.
- Monitored: every sign-in by these accounts should raise an alert, and Microsoft recommends testing them at least every 90 days.
The starter set
Block legacy authentication
Legacy authentication means older protocols, such as POP, IMAP and basic-auth SMTP, that cannot perform MFA. Microsoft reports that more than 99 percent of password spray attacks use them, so this policy removes a whole class of attacks.
Target All users and All resources, set the Client apps condition to Exchange ActiveSync clients and Other clients, and grant Block access. Old printers and scripts that send mail with basic authentication are the usual casualties, so check who still uses these protocols first (see the queries below).
Require MFA for all users
Target All users and All resources, excluding the emergency access group, and require multifactor authentication. If you can, use an authentication strength instead of the plain MFA control: it lets you decide which methods count, and you can tighten it later. Include guests too, or use the separate Require multifactor authentication for guest access template.
Require phishing-resistant MFA for admins
Administrators are the accounts attackers want most, and ordinary MFA codes and push approvals can be phished by adversary-in-the-middle kits. The Require phishing-resistant multifactor authentication for administrators template targets the privileged directory roles and requires the Phishing-resistant MFA authentication strength: passkeys, Windows Hello for Business or certificate-based authentication. Make sure every admin has registered one of these methods before you turn it on. See phishing-resistant MFA.
Protect security info registration
If an attacker with a stolen password can register their own phone as an MFA method, MFA protects nobody. The Securing security info registration template controls when and where users can register methods, for example only from trusted locations or after completing MFA. New employees can use a Temporary Access Pass for their first registration.
Block device code flow
Device code flow lets a user sign in on a device without a keyboard, such as a meeting room screen, by entering a code on another device. Attackers abuse it in phishing campaigns that ask the victim to "enter this code" on a genuine Microsoft page. Microsoft notes that the flow is rarely used legitimately. Block it with the Authentication flows condition, or turn on the Microsoft-managed policy, and exclude only the devices that really need it, such as Teams Rooms.
Add risk-based policies (Entra ID P2)
With Entra ID P2, Microsoft Entra ID Protection scores each sign-in and each user for risk. Two templates use those scores: Require multifactor authentication for risky sign-ins, which challenges sign-ins that look like password spray or token replay, and Require password change for high-risk users, for accounts whose credentials appear to be compromised. These policies react to attacks the static rules cannot predict.
When you are ready for more, the next policies to look at are device-based: requiring a compliant or hybrid-joined device for administrators, and blocking unknown or unsupported device platforms. They need Microsoft Intune or Entra hybrid join, so plan them as a separate project.
Roll out in report-only mode
Every template creates its policy in report-only mode. The policy is evaluated on every sign-in and the result is logged, but nothing is enforced. Leave each policy in report-only mode for at least a week and check its impact: the Policy impact tab on the policy shows a summary, and the What If tool tests a single user.
If Entra ID sign-in logs reach Microsoft Sentinel or a Log Analytics workspace, this KQL query lists the sign-ins that each report-only policy would have blocked or interrupted:
SigninLogs
| where TimeGenerated > ago(7d)
| mv-expand Policy = ConditionalAccessPolicies
| where tostring(Policy.result) in ("reportOnlyFailure", "reportOnlyInterrupted")
| summarize SignIns = count(), Users = dcount(UserPrincipalName),
Apps = make_set(AppDisplayName, 10) by PolicyName = tostring(Policy.displayName)
| order by SignIns descAnd this one finds who still uses legacy authentication, so you can fix or exclude them before step 1 is enforced:
union SigninLogs, AADNonInteractiveUserSignInLogs
| where TimeGenerated > ago(30d)
| where ClientAppUsed !in ("Browser", "Mobile Apps and Desktop clients")
| summarize SignIns = count(), LastSeen = max(TimeGenerated)
by UserPrincipalName, ClientAppUsed
| order by SignIns descWhen the results contain only what you expect, switch the policy to On, one policy at a time.
Watch the policies themselves
An attacker with admin access may weaken or delete Conditional Access policies to keep their access. Every change is written to the Entra audit log, which makes it easy to monitor:
AuditLogs
| where TimeGenerated > ago(30d)
| where OperationName in ("Add conditional access policy", "Update conditional access policy",
"Delete conditional access policy")
| project TimeGenerated, OperationName,
Actor = coalesce(tostring(InitiatedBy.user.userPrincipalName), tostring(InitiatedBy.app.displayName)),
Policy = tostring(TargetResources[0].displayName)
| order by TimeGenerated descChanges you did not plan, or made outside a change window, deserve an alert. So does any sign-in by the emergency access accounts.
Why it matters for a SOC analyst
When you investigate an Entra ID sign-in, the Conditional Access tab shows which policies applied and what they did. Knowing what a good baseline looks like helps you spot the gaps attackers use: an excluded group that grew to half the company, a legacy protocol still allowed for one mailbox, an admin without phishing-resistant MFA. Conditional Access is where Zero Trust stops being a slogan and becomes a set of rules you can read, test and monitor.
Terms in this article
- Conditional Access
- Microsoft Entra ID's policy engine that decides, at each sign-in, whether to allow access, require MFA or another control, or block.
- Emergency access account
- A highly privileged account kept aside for emergencies, such as a misconfigured access policy or an MFA outage, so administrators can never be fully locked out.
- Legacy authentication
- Older sign-in protocols, such as POP, IMAP and basic-auth SMTP, that send a username and password and cannot perform multifactor authentication.
- Multi-factor authentication
- Signing in with two or more different kinds of proof, such as a password plus a phone or security key, so a stolen password alone is not enough.
- Phishing-resistant MFA
- Authentication methods, such as passkeys, FIDO2 keys and Windows Hello for Business, that cannot be relayed or approved by a phished user.
- Password spray
- An attack that tries a few common passwords against many accounts, staying under lockout limits that per-account guessing would trigger.
- Zero trust
- A security model that grants no implicit trust based on network location: every access request is verified, limited and continuously evaluated.
- KQL
- The read-only query language used by Microsoft Sentinel, Defender XDR advanced hunting, Azure Monitor and Azure Data Explorer.
Last reviewed on by The Ledger Editor, Security Engineer
Keep reading
Threat Analysis
Device code phishing: how it works and how to detect it