7.8 Device Compliance and Conditional Access
Device Compliance and Conditional Access Integration
By the end of this subsection, you will understand how Defender for Endpoint feeds device risk into Intune compliance, and how the "require compliant device" conditional access policy blocks AiTM token replay.
This is where Modules 1, 4, 5, and 7 converge. The conditional access gap that allowed the AiTM attack in Module 13 is closed here.
The integration chain
Step 1: Defender for Endpoint assesses device risk (low, medium, high) based on active threats and vulnerabilities.
Step 2: Intune compliance policy includes “Require device threat level: clear or low.” A device with medium or high risk becomes non-compliant.
Step 3: Entra ID conditional access policy requires a compliant device for Exchange Online and SharePoint.
Step 4: Non-compliant device (or unenrolled device) is blocked from accessing M365.
Why this blocks AiTM token replay
In the Module 13 scenario, the attacker replayed a stolen token from an unmanaged device. The token contained a valid MFA claim — conditional access requiring MFA was satisfied. But the attacker’s device was not enrolled in Intune. With a “require compliant device” policy:
- The attacker presents the stolen token to Exchange Online
- Conditional access evaluates: is the device compliant?
- The device is not enrolled in Intune — automatic non-compliance — blocked
- The MFA claim in the token is irrelevant — device compliance is the enforcement point
Phishing-resistant MFA (FIDO2) prevents AiTM by design but requires hardware procurement and user training. Device compliance is a configuration change deployable immediately. It blocks token replay from any device not in your Intune inventory. Deploy this first, then plan FIDO2 for defense in depth.
Intune compliance policy configuration
- Navigate to Intune admin center -> Devices -> Compliance policies -> Create policy
- Platform: Windows 10 and later
- Compliance settings:
- Device Health: Require device threat level = “Clear” or “Low”
- System Security: Require BitLocker encryption = Yes
- System Security: Require firewall = Yes
- System Security: Require antivirus = Yes
- System Security: Require antispyware = Yes
- Actions for noncompliance: Mark noncompliant immediately (or 1-day grace period for rollout)
- Assign to All Users or a pilot group
Conditional access policy configuration
- Navigate to Entra ID -> Conditional Access -> Create new policy
- Name: “Require compliant device for M365 apps”
- Users: All users (exclude emergency access accounts)
- Cloud apps: Exchange Online, SharePoint Online, Microsoft Teams
- Conditions: All device platforms
- Grant: Require device to be marked as compliant
- Session: Sign-in frequency = 12 hours (forces periodic re-evaluation)
- Enable policy (start with Report-only for 1 week, then enforce)
When this policy goes live, every user on a personal phone or unenrolled laptop is blocked from email. Communicate the change 2 weeks before enforcement. Provide Intune enrollment instructions. Consider a phased rollout: pilot group first, then department by department. The 1-week report-only period shows you exactly who would be blocked.
Verification query
| |
| TimeGenerated (day) | BlockedCount |
|---|---|
| 2026-03-15 | 34 |
| 2026-03-16 | 28 |
| 2026-03-17 | 41 |
Try it yourself
| |
Users blocked from known countries on iOS/Android are likely employees on personal phones needing enrollment. Users blocked from unexpected countries on unknown platforms are investigation targets.
Check your understanding
1. An attacker replays a stolen token. The token has a valid MFA claim. "Require compliant device" is active. Result?
2. After enabling the policy, 50 users on personal phones are blocked. Is this a misconfiguration?