M365Con 2027 – free online conference · 11–22 Jan 2027 · 120 sessions→ m365con.net

Blog · Mirko Peters

From Gatekeeper to Watcher: Bridging Pre-Auth and Post-Auth Security

By ·

Welcome back to the podcast and our accompanying technical deep dive! If you have ever felt like your identity security strategy has a blind spot right after a user…

▶ BLOGFrom Gatekeeper toWatcher: Bridging…M365.FM
Titelbild: From Gatekeeper to Watcher: Bridging Pre-Auth and Post-Auth Security

Welcome back to the podcast and our accompanying technical deep dive! If you have ever felt like your identity security strategy has a blind spot right after a user successfully logs in, you are definitely not alone. For years, organizations have heavily relied on pre-authentication controls to keep the bad guys out, treating the front door like the final frontier of security. But what happens once an adversary slips past that door with a valid token or a stolen set of credentials? That exact dilemma was the centerpiece of our recent episode, Conditional Access with Defender for Identity Signals. In this post, we are going to expand on those concepts and break down how you can fuse your pre-auth gatekeeper with your post-auth watcher to build truly resilient identity architecture.

The Core Idea (TL;DR)

To truly understand modern identity protection, you need to look at your tools as specialized roles working together in real-time:

Mental Model

Let's refine the mental model of how these components interact within your ecosystem:

Integration Blueprint (what to enable, in order)

Getting these systems to talk to each other requires a structured rollout. Here is the blueprint you should follow:

  1. Risk-aware CA (baseline)
    • Entra ID Protection: turn on User risk and Sign-in risk evaluation.
    • Create CA policies:
      • Block when User risk = High (or require a password change if your helpdesk workflows support it).
      • Require MFA when Sign-in risk ≥ Medium.
      • Require compliant device for medium-to-high sensitivity apps; use device filters for unmanaged endpoints to route them straight into restricted session controls.
  2. Let the watcher talk to the gatekeeper
    • Ensure DfI is actively streaming alerts into Microsoft 365 Defender and Sentinel (if you use it for SIEM/SOAR).
    • Automate "Confirm compromised" actions on users for high-severity DfI alerts. This sets User risk = High in Entra ID Protection, causing your CA policies to react instantly.
    • Automation path: M365 Defender Incident → Logic App or Power Automate → Graph Security/Identity Protection API (/riskDetections, /riskyUsers:confirmCompromised) → optional Force sign-out.
    • Turn on Continuous Access Evaluation (CAE) on all supported apps (Exchange, SharePoint, Graph) so policy changes actually terminate live tokens.
  3. Session control for containment
    • For unmanaged or risky sessions, deploy Defender for Cloud Apps (session proxy) directly from CA:
      • CA → Use Conditional Access App Control (monitor first, then block data exfiltration like downloads, copy/paste, printing, and syncing).
    • Pair this with MDE device risk → Intune compliance → CA "Require compliant device" for all sensitive applications.
  4. Privileged identity guardrails
    • PIM must enforce Just-in-Time access; require MFA + compliant device + no risky user state before elevation is permitted.
    • Implement a CA policy to Block privileged roles if user risk ≥ Low (yes, even Low risk) to force immediate triage before an administrative role can be assumed.

“If This, Then That”: Map DfI Signals to CA Actions

Mapping specific detection signals from Defender for Identity to automated Conditional Access and response actions bridges the gap between passive observation and active defense:

DfI / M365 Defender signal Example detection Automated response
Suspected lateral movement (SMB/NTLM anomalies, unusual Kerberos TGS spray) Multiple service tickets requested by a non-admin account out of normal pattern Confirm user compromised → CA blocks access (User risk = High) → Invalidate refresh tokens
Unusual resource access (sudden SharePoint site crawl, bulk file access) Spike in unique sites visited and file downloads compared to user baseline CA step-up MFA + route to App Control (no download/print allowed) for 24–72 hours
Credential theft techniques (Pass-the-Hash or Pass-the-Ticket) DfI security identity alert triggered on endpoint activity Block access + require password reset; isolate device via MDE; disable legacy authentication protocols
Privileged role misuse New administrative portal access occurring during unusual after-hours windows Auto-expire PIM assignment; CA blocks re-login until a full security investigation is complete
Start by running these in audit/monitor mode for 1 to 2 weeks, then flip responses to enforce mode per alert class as your confidence grows.

Sample Policies (practical, minimal)

To put these strategies into production, here are four foundational policies you should configure:

  1. Block when user risk = High
    • Assign: All users (exclude break-glass accounts), All cloud apps
    • Conditions: User risk = High
    • Grant: Block access
  2. Step-up on sign-in risk
    • Assign: All users, High-value apps (Admin portals, Exchange, SharePoint, Entra admin center)
    • Conditions: Sign-in risk ≥ Medium
    • Grant: Require MFA + Require compliant device (or managed device)
  3. Session contain unmanaged
    • Assign: All users, SharePoint/OneDrive/Teams
    • Device state: Hybrid/Compliant = bypass; Unmanaged = enforce
    • Session: Use Conditional Access App Control (Block downloads)
  4. Privileged elevation guard
    • Assign: Directory roles = Privileged administrative roles
    • Conditions: User risk ≥ Low OR Sign-in risk ≥ Medium
    • Grant: Require MFA + Require compliant device; Block if risk ≥ High

Automation Playbooks (ready-to-wire)

Automation is the secret sauce that reduces your Mean Time to Contain (MTTC). Here are two playbooks you can build today:

Playbook A: DfI high-severity alert → Contain identity

Playbook B: Anomalous SharePoint access burst

Hunting & Useful Queries

Proactive hunting helps you catch gaps before attackers exploit them. Use these queries in M365 Defender Advanced Hunting:

Spike in SharePoint site access by a user compared to their 30-day baseline:


let lookback=30d;
let recent=1h;
let baseline = CloudAppEvents
    | where Timestamp between (ago(lookback) .. ago(recent))
    | where Application == "SharePoint" and ActionType == "FileAccessed"
    | summarize uniqSites=dcount(SiteUrl) by AccountUpn;
CloudAppEvents
| where Timestamp >= ago(recent)
| where Application == "SharePoint" and ActionType in ("FileDownloaded","FileAccessed")
| summarize curSites=dcount(SiteUrl), dls=sumif(1, ActionType=="FileDownloaded") by AccountUpn
| join kind=leftouter baseline on AccountUpn
| where curSites > 3 * coalesce(uniqSites,1) or dls > 500

Sign-in risk spikes tied closely to later DfI alerts:


let riskySignIns = IdentityLogonEvents
| where RiskLevelDuringSignIn in ("medium","high")
| project AccountUpn, Timestamp, RiskLevelDuringSignIn;
let dfiAlerts = IdentityDirectoryEvents
| where EventType startswith "DefenderForIdentity"
| project AccountUpn, DfiTime=Timestamp, AlertType=EventType;
riskySignIns
| join kind=inner dfiAlerts on AccountUpn
| where DfiTime between (Timestamp .. Timestamp + 4h)

Metrics That Prove It Works

When reporting back to leadership, you need metrics that show tangible risk reduction. Track these key performance indicators:

30/60/90 Rollout Strategy

Avoid trying to change everything overnight. Use this phased timeline:

Days 0–30 (Foundations)

Days 31–60 (Feedback & Containment)

Days 61–90 (Enforce & Measure)

Common Pitfalls (and Safer Defaults)

Watch out for these common missteps during your implementation:

Copy/Paste Artifacts

To help you communicate these changes across your organization, use these ready-made snippets:

CAB one-liner for executives:

We’ve successfully connected post-login user behavior to our access control decisions. If an account starts acting unusually, we add security friction or block access in-session. That drastically shrinks attacker dwell time without slowing down normal day-to-day work.

Change note for administrators:

Owner-friendly Teams notification card (automated):

Microsoft Defender for Identity Microsoft Defender Microsoft Entra ID Conditional Access Microsoft 365 Automation

RSS