Unclassified Devices Slip Past Every Platform-Scoped Conditional Access Policy You Own

Policies scoped to Windows, iOS, or Android skip every device that reports a platform Entra doesn't recognize, and almost every tenant has this gap.

Here’s the version that wakes you at 2 a.m.: a sign-in shows up in the logs from an account you thought was fenced behind a compliant-device requirement. MFA satisfied? No. Compliant device? No. Policy applied? Also no, and that last “no” is the whole problem. The policy didn’t fail. It simply decided it had no opinion, because the device reported a platform it didn’t recognise, and your policy only had rules for the platforms it did.

Petri’s research puts a number on how common this is: almost every tenant they audit. That tracks. This isn’t a typo somebody made once. It’s the natural result of how the Conditional Access UI nudges you, you pick the platforms you care about, and the tooling never asks the obvious follow-up question about everything else.

Before the checklist, the one fact everything hinges on: Entra decides “device platform” from the user agent string. That’s it. Not a certificate, not a device object, not anything the endpoint has to prove. A string the client hands over, which a client controls, which a client can leave blank or garble. When it matches Windows/iOS/Android/macOS/Linux, you get a classified platform. When it doesn’t, spoofed, stripped, or just a stack Microsoft doesn’t map, the device is unclassified, and a policy that only includes named platforms treats “unclassified” as out of scope. Out of scope means the grant controls never fire. No block, no MFA, no compliance check. Straight through.

So, in the order you’d actually work it:

1. Accept that the platform condition is an advisory, not a wall

Treat the user agent as hostile input, because it is. Any control you hang off “Device platforms” is only as trustworthy as a header field. That doesn’t make the condition useless, it makes it a filter for the honest majority, which needs a backstop for the dishonest minority. If you internalise nothing else, internalise that the platform picker was never a security boundary on its own.

2. Pull every policy that scopes to specific platforms

You can’t reason about the gap until you know which policies have it. Run this. It’s read-only, Policy.Read.All, no writes, pages through everything with -All, and it flags any policy whose include list names specific platforms instead of “all.” Those are the ones that let unclassified devices slip through.

audit.ps1PowerShell
#requires -Modules Microsoft.Graph.Identity.SignIns
​
try {
    Connect-MgGraph -Scopes "Policy.Read.All" -NoWelcome -ErrorAction Stop
}
catch {
    Write-Error "Could not connect to Microsoft Graph: $($_.Exception.Message)"
    return
}
​
try {
    $policies = Get-MgIdentityConditionalAccessPolicy -All -ErrorAction Stop
}
catch {
    Write-Error "Failed to retrieve Conditional Access policies: $($_.Exception.Message)"
    return
}
​
$findings = foreach ($p in $policies) {
    $include = $p.Conditions.Platforms.IncludePlatforms
    $exclude = $p.Conditions.Platforms.ExcludePlatforms
​
    # No platform condition set = applies to any device already; not the gap we're hunting
    if (-not $include) { continue }
​
    # "all" = "Any device" in the portal, unclassified devices included. That's the safe setting.
    if ($include -contains 'all') { continue }
​
    # A named include list means unclassified devices fall out of scope entirely.
    [pscustomobject]@{
        PolicyName       = $p.DisplayName
        State            = $p.State
        IncludePlatforms = ($include -join ', ')
        ExcludePlatforms = ($exclude -join ', ')
        GrantControls    = ($p.GrantControls.BuiltInControls -join ', ')
    }
}
​
if ($findings) {
    Write-Warning "Platform-scoped policies, unclassified devices fall out of scope:"
    $findings | Sort-Object State | Format-Table -AutoSize
}
else {
    Write-Host "No platform-scoped policies with an open unclassified gap found." -ForegroundColor Green
}

Export it, read it, and don’t skim past policies in enabledForReportingButNotEnforced, a report-only policy with this gap will still mislead you into thinking a platform is covered when it isn’t.

3. Read the include list, not the intent

The trap is that these policies look correct. “Require compliant device, platforms: Windows, iOS, Android” reads like tight coverage. It isn’t. It’s tight coverage for three platforms and open house for the fourth, unnamed one. The include list is an allow-of-scope, not an allow-of-access, everything you didn’t list quietly walks around the policy rather than into a block. That gap is where the design flaw lives, and it’s why this shows up in nearly every tenant: the sensible-looking configuration is the vulnerable one.

4. Decide per policy: widen the net, or block the strays

Two clean fixes, and which you pick depends on the policy’s job.

  • Widen the net. Set Device platforms to Any device and use the Exclude list for the handful you genuinely need to leave alone. Now “unclassified” is in scope and your grant control, MFA, compliance, whatever, applies to it. This is the right move for most protection policies.
  • Block the strays. Build a separate catch-all: Device platforms = Any device, exclude your supported platforms, grant control = Block. Anything that isn’t a platform you support gets denied outright. This is the move for high-assurance apps where an unmanaged, unidentifiable client has no business connecting at all.

Don’t try to be clever and do both to the same app without thinking it through, you’ll spend an afternoon untangling which policy won.

5. Stage the block in report-only before you enforce it

New Block policies are how you take down your own CEO on a Monday. Create the catch-all in the Entra admin center with State set to Report-only, then live with it for a few days and read the workbook. I’m deliberately not handing you a New-MgIdentityConditionalAccessPolicy one-liner here, a block policy is exactly the kind of state change you build by hand, on reviewed scope, watching the impact, not by piping a script at a live tenant at speed. If you do automate it later, it goes in as report-only and it operates on input you’ve read line by line.

6. Verify it in the blade, not in your memory

In the Entra admin center: Protection → Conditional Access → Policies, open the policy, then Conditions → Device platforms. Confirm the toggle reads Any device (or that your block policy names the excluded supported platforms and nothing else). Then check the sign-in logs’ Conditional Access tab for a test sign-in and confirm your intended policy actually applied rather than showing “Not applied.” “Configured” and “applied” are different words for a reason.

7. Re-run the audit on a schedule

This regresses. Someone clones a working policy six months from now, tightens the platform list because it “looks safer,” and reopens the hole. Run the script from step 2 as a recurring check and diff the output. The flaw is a pattern, not an event, so your detection has to be recurring too.

If you only do one thing this week: run the audit, and for every policy it flags, ask whether that policy is supposed to be protecting the strays or ignoring them. Most of them are supposed to be protecting them, the config just never got the memo. An unclassified device isn’t an edge case. It’s the shape every attacker’s client will take the moment they realise your policies only have opinions about the platforms they were told to expect.