Entra Conditional Access and MFA gap review
Brief
Conditional Access gaps are rarely a missing policy: they are a policy left in report-only, an exclusion group that grew, a protocol that cannot answer MFA, or an app no policy names. The policies say where the gaps could be, and the sign-in logs say which ones people actually walk through.
On this page
- Situation
- A read-only review identity the client grants for the test, with Global Reader or Security Reader so it can read the policies and the sign-in logs, plus query access to the Log Analytics workspace the sign-in logs go to. Everything here reads: no policy is created, changed or switched on, and we work only in the tenant the scope letter names. When the starting point is one ordinary user who cannot read policies, the Entra ID first hour covers what sign-in prompts reveal instead.
- Goal
- A gap list for the tenant: each place a password alone still signs in, the policy or exclusion that allows it, and the sign-in count from the last 30 days that shows it is used.
- Outputs
- Representative examples on placeholder hosts, trimmed to the lines that matter. Not captured from a public fixture yet.
Check first
- Which accounts are the emergency access accounts, so their exclusions are expected rather than reported.
- Whether security defaults are on; a tenant with Conditional Access policies has them off.
- Where the sign-in logs go and for how long, since every count below depends on them.
- Which licence the tenant holds; Conditional Access needs Entra ID P1, and risk-based conditions need P2.
- Which apps the client calls critical, so a gap on one of them is reported first.
Steps
Azure
Which policies are on, report-only or off, and who do they exclude?
Connect-MgGraph -Scopes 'Policy.Read.All','GroupMember.Read.All' -NoWelcome
Get-MgIdentityConditionalAccessPolicy -All |
Select-Object DisplayName, State,
@{n='ExclUsers';e={$_.Conditions.Users.ExcludeUsers.Count}},
@{n='ExclGroups';e={$_.Conditions.Users.ExcludeGroups.Count}},
@{n='Grant';e={$_.GrantControls.BuiltInControls -join ','}} | Format-Table -AutoSize
(Get-MgGroupMember -GroupId <excluded-group-id> -All | Measure-Object).Count
Expected output
DisplayName State ExclUsers ExclGroups Grant
----------- ----- --------- ---------- -----
Require MFA for all users enabled 2 1 mfa
Block legacy authentication enabledForReportingButNotEnforced 0 0 block # <- report-only: logs what it would block, blocks nothing
Require MFA for guests disabled 0 0 mfa
47 # <- the excluded group holds 47 accounts, not two break-glass accounts
State has three values: enabled, disabled and enabledForReportingButNotEnforced, which is report-only. A report-only policy is a draft, and the tenant behaves as if it did not exist. Two excluded users matching the emergency accounts are expected; an excluded group is where the drift lives, because anyone added to it for a migration or a printer stays there. We count members and never list them in the report.
Negative result. Every policy that grants or blocks is enabled, exclusions are the named emergency accounts only, and any excluded group has an owner and a review date.
Fix. Move report-only policies to on once their sign-in results show no surprise. Replace broad exclusion groups with the emergency accounts, give any remaining group an access review, and monitor every sign-in by an excluded account.
Is legacy authentication still signing people in?
SigninLogs
| where TimeGenerated > ago(30d) and ResultType == "0"
| where ClientAppUsed in ("Exchange ActiveSync", "IMAP4", "POP3", "Authenticated SMTP", "Other clients")
| summarize SignIns = count(), Users = dcount(UserPrincipalName) by ClientAppUsed, AppDisplayName
Expected output
ClientAppUsed AppDisplayName SignIns Users
------------------ --------------------------- ------- -----
Authenticated SMTP Office 365 Exchange Online 412 3 # <- three mailboxes sign in with a password and nothing else
Other clients Office 365 Exchange Online 19 1
These clients cannot answer an MFA prompt, so a successful sign-in from one of them is a password alone, whatever the MFA policy says. We count users and leave the names for the client to pull, since they will need them to fix it.
Negative result. No successful rows in 30 days, and an enabled policy that blocks the Exchange ActiveSync and Other clients conditions for all users.
Fix. Switch the legacy authentication block on for everyone. Move the remaining mailboxes, usually printers, scanners and line of business senders, to OAuth or to a relay that does not need a user password.
Which apps let a password alone sign in with no policy applied?
SigninLogs
| where TimeGenerated > ago(30d) and ResultType == "0"
| where AuthenticationRequirement == "singleFactorAuthentication" and ConditionalAccessStatus == "notApplied"
| summarize SignIns = count(), Users = dcount(UserPrincipalName) by AppDisplayName, UserType
| order by SignIns desc
Expected output
AppDisplayName UserType SignIns Users
----------------------- -------- ------- -----
Partner Portal Member 1880 214 # <- an app no policy names: password only
Expense Reports Guest 311 37
notApplied means no enabled policy matched that sign-in, so it is a direct reading of the gap rather than a guess from the policy text. Each row names an app the policies leave out or a user type they never target, and guests are the usual case. This table holds interactive sign-ins only; the same query on AADNonInteractiveUserSignInLogs shows background token use.
Negative result. No rows, or only rows the client can explain, such as the emergency accounts on a monitored test.
Fix. Target all cloud apps and all users, including guests, in the baseline MFA policy, and exclude by exception rather than include by list. Re-run the query a week later to confirm the rows are gone.
Do admins and the management apps need phishing-resistant MFA?
Get-MgIdentityConditionalAccessPolicy -All | Where-Object State -eq 'enabled' |
Select-Object DisplayName,
@{n='Roles';e={$_.Conditions.Users.IncludeRoles.Count}},
@{n='Apps';e={$_.Conditions.Applications.IncludeApplications -join ','}},
@{n='Strength';e={$_.GrantControls.AuthenticationStrength.DisplayName}} | Format-Table -AutoSize
Expected output
DisplayName Roles Apps Strength
----------- ----- ---- --------
Require MFA for all users 0 All
Admins require MFA 14 All Multifactor authentication # <- admins can still approve a push or type a code
Any MFA can be relayed or approved by mistake; phishing-resistant MFA, passkeys or certificates, cannot be replayed by a proxy that sits between the admin and the sign-in page. We check that the privileged roles are included by role and not by a hand-kept group, and that a policy covers the Azure management and admin portal apps for everyone who can reach them.
Negative result. An enabled policy for the privileged roles with the Phishing-resistant MFA strength, and the management apps covered.
Fix. Require the built-in Phishing-resistant MFA strength for privileged roles, roll out passkeys to admins first, and add the Microsoft Admin Portals and Azure management targets to a policy that applies to all users.
The defender sees
The policy reads are Graph GET requests from the review identity; they appear only in the Microsoft Graph activity logs, which need a diagnostic setting and a P1 or P2 licence, and not in the Entra audit log, which records changes. The review identity's own sign-in is in SigninLogs, with the policies that applied to it. The Kusto queries appear in LAQueryLogs where query auditing is on for the workspace. Report-only policies leave their verdict on every sign-in as reportOnlyFailure or reportOnlySuccess, so the client already holds a record of what each would have blocked. If no one reviews those results, the gap between drafted and enforced policy is a finding of its own.
Done when
Every policy is recorded with its state, exclusions and grant, legacy and single factor sign-ins are counted by app and client, and the admin roles and management apps are each matched to the policy that protects them or marked as unprotected.
Not covered
Testing the gaps with real passwords (see password spraying and MFA fatigue), token theft and device compliance internals; the outputs shown are representative examples on a placeholder tenant, not captured runs.