← Back to All Articles
Microsoft Azure

Stop Token Replay Attacks with Entra ID Token Protection and CAE Strict Mode

Cryptographically binding Primary Refresh Tokens to endpoint TPM hardware via Conditional Access Token Protection alongside near-instant Continuous Access Evaluation (CAE) Strict Location enforcement.

·10 min read·
#Token Protection#Token Binding#CAE Strict Mode#Conditional Access#Entra ID#M365 E5
Stop Token Replay Attacks with Entra ID Token Protection and CAE Strict Mode

Executive Summary and Authentication Threat Context

Even when organizations enforce Phishing-Resistant Authentication Strengths, infostealer malware or local token-dumping tools can harvest live cookies or Refresh Tokens and replay them on attacker infrastructure. Entra ID Token Protection (cryptographic proof-of-possession bound to TPM) paired with Continuous Access Evaluation (CAE) Strict Mode renders stolen Microsoft 365 tokens useless outside the trusted device and network boundary.

From an architectural evolution standpoint, this foundational design connects directly to modern platform controls. Closing post-authentication token-theft blind spots in 2024, Conditional Access Token Protection and Strict Location CAE pair seamlessly with Entra Global Secure Access Compliant Network Checks and Entra ID Hard-Delete XDR Response.

Trust Boundaries, Policy Evaluation, and Design Principles

  • Token Protection binds issued refresh tokens cryptographically to a secret key anchored inside the endpoint TPM 2.0 chip, rejecting replayed tokens extracted onto rogue machines.
  • CAE Strict Location Enforcement collapses standard 60-minute OAuth access token lifetimes down to seconds whenever a user’s IP moves outside verified Named Locations.
  • Pairs immediately with Identity Protection Risk Policies so real-time user risk elevations sever active Exchange and SharePoint sessions instantly.
  • Every Conditional Access and authentication-strength policy must stage in Report-Only mode while excluding two dedicated cloud-only Break-Glass accounts to prevent tenant-wide administrative lockouts.

Prerequisites, Licensing Scope, and RBAC Separation

  • Licensing: Microsoft Entra ID P2 (included in M365 E5 / EMS E5) for Conditional Access Token Protection; standard CAE is available at P1.
  • OS & Client Requirements: Windows 10/11 Entra Joined or Hybrid Entra Joined endpoints equipped with TPM 2.0 and modern M365 Apps/Edge WebView2 clients.
  • Network Hygiene: Strict Location CAE requires complete, accurate Named Locations covering every legitimate corporate NAT/VPN or Global Secure Access egress IP.

Technical Verification, Session Controls, and Enforcement

PowerShell Policy Audit and Report-Only Validation

Inspecting Conditional Access policies with Token Protection/CAE controls and verifying local Windows PRT state:

  • Execution Environment and Prerequisites: Requires Microsoft.Graph.
  • Least Privilege and Operation Separation: Run with scoped Least-privilege Graph `.Read.All` scopes (delegated admin role only for writes) privileges. All statements above are **read-only (Get-*/Test-*/Search-*)** verification checks making no direct configuration edits; still validate module/network prerequisites in a test cohort first.
  • Security Control Mapped and Boundary Note: Verifies active policy state and guards against silent drift or mis-scoped rollouts without blind production changes.
powershell
# 1. Query Conditional Access policies configured with Token Protection or Strict CAE
Connect-MgGraph -Scopes "Policy.Read.All"
Get-MgIdentityConditionalAccessPolicy |
  Where-Object { $_.SessionControls.SecureSignInSession.IsEnabled -or $_.SessionControls.ContinuousAccessEvaluation.Mode } |
  Select-Object DisplayName, State, @{N="TokenProtection";E={$_.SessionControls.SecureSignInSession.IsEnabled}}, @{N="CAE";E={$_.SessionControls.ContinuousAccessEvaluation.Mode}}

# 2. Verify Windows Primary Refresh Token (PRT) and TPM binding on endpoint
dsregcmd /status | Select-String -Pattern "AzureAdJoined|AzureAdPrt|TpmProtected"

Sign-In Telemetry and KQL Verification Query

KQL query inspecting Token Protection evaluation details inside Entra SigninLogs:

kql
// Execution Scope: Read-only hunting/audit query (Log Analytics Reader / Security Reader)
// Data Source: Microsoft Entra ID Diagnostic Settings -> Log Analytics / Microsoft Sentinel (SigninLogs / AuditLogs)
SigninLogs
| where TimeGenerated > ago(14d)
| extend TokenProtection = tostring(TokenProtectionStatusDetails.signInSessionStatus)
| where isnotempty(TokenProtection) or ConditionalAccessPolicies has "TokenProtection" or IsThroughGlobalSecureAccess == true
| summarize Events = count() by TokenProtection, AppDisplayName, ClientAppUsed
| order by Events desc

Critical Architectural Assessment, Lockout Risks, and Rollback Strategy

  • Targeting All Device Platforms Without Filtering Windows Only: Assigning Require token protection to macOS/Linux/iOS or arbitrary browsers creates immediate false-positive blocks.
  • Enforcing Strict Location CAE on Roaming Home Users Without SSE: Dynamic ISP IP fluctuations trigger constant session drops unless routed through trusted corporate SSE/VPN gateways.
  • Risks Mitigated vs. Residual Limitations: Conditional Access baselines, Authentication Strengths, CAE, and token protection substantially curtail password spray, MFA fatigue, and stolen-cookie replay; however, they do not stop shadow SaaS apps lacking Entra SSO, legacy clients lacking token-binding support, or post-authentication data abuse inside legitimately accessed applications.
  • New Dependencies and Production Failure Modes: Enforcement relies on Entra ID P1/P2 licensing accuracy, compliant-device telemetry latency, and low-latency external REST availability when invoking Custom Authentication Extensions. Deploying strict grant controls without exclusions locks out emergency IT operations across the entire tenant.
  • Rollback and Pilot Validation Procedure: Stage every new Conditional Access control in Report-Only (enabledForReportingButNotEnforced) mode while excluding two cloud-only Break-Glass accounts; recover from unintended blocks by signing in with a Break-Glass account and switching the offending policy back to Report-Only.

Verified Primary Sources & Open-Source Repositories

This architectural guide was cross-corroborated against the official advisories, Microsoft Learn docs, and open-source PowerShell / KQL repositories below.

Multi-Channel Distribution Summary (X & LinkedIn Draft)

Toggle X (Twitter) & LinkedIn sharing drafts
X (Twitter) Draft

Stopping infostealer token theft with Entra ID Token Protection (TPM Binding) and Strict Location CAE. #EntraID #TokenProtection #ZeroTrust

LinkedIn Draft

Hardware-Bound Sessions: Configuring Conditional Access Token Protection and Continuous Access Evaluation Strict Mode cleanly without breaking mobile users.