Microsoft Teams Protection and Automated Investigation (AIR) in Defender for Office 365
Extending email security into Microsoft Teams via real-time Safe Links, SharePoint/Teams Safe Attachments, Teams ZAP quarantine, and Defender for Office 365 Plan 2 AIR playbooks.
Executive Summary and Collaboration Threat Context
As enterprise email gateways hardened, adversaries pivoted directly to external Teams chats to drop phishing URLs and weaponized payloads without hitting SMTP relays. Defender for Office 365 closed this gap by delivering API-driven Safe Links verification inside Teams, file detonation across SharePoint/OneDrive/Teams, Zero-Hour Auto Purge (ZAP) for Teams messages, and Automated Investigation and Response (AIR) containment.
From an architectural evolution standpoint, this foundational design connects directly to modern platform controls. Expanding Defender for Office 365 across Microsoft Teams and automated AIR response in 2022 directly underpins today’s Defender XDR Automatic Attack Disruption and Zero-Day Collaboration Response.
Mail/Message Inspection Boundaries and Design Principles
Zero-Hour Auto Purge (ZAP) for Teamscontinuously retroactively removes newly classified phishing messages and malware drops from both 1:1 chats and Teams channels.Safe Links for Microsoft Teamschecks clicked hyperlinks at time-of-click across desktop, web, and mobile clients via API inspection without breaking URL appearance.Automated Investigation and Response (AIR)automatically hunts malicious clickers, correlated suspicious inbox rules, and lateral messages, accelerating SOC remediation.Safe Links,Safe Attachments(Dynamic Delivery), anti-impersonation rules, and post-deliveryZAPmust operate cleanly without globalSCL = -1transport bypasses that nullify inspection.
Prerequisites, Policy Precedence, and RBAC Requirements
- Licensing: Safe Links and ZAP for Teams require Defender for Office 365 Plan 1 (M365 E3 add-on); Automated Investigation & Response (AIR) requires Plan 2 (Microsoft 365 E5).
- RBAC Permissions: Security Administrator plus Microsoft Defender XDR
Search and Purgepermissions for full AIR execution. - Scope Clarification: Internal collaboration files uploaded inside your SharePoint/OneDrive locations are detonated under your tenant Safe Attachments policy regardless of guest sender licenses.
Technical Verification, Phishing/Teams Protection Controls
PowerShell Policy Inspection and Pilot Validation
Validating SharePoint/Teams Safe Attachments, Teams Safe Links, and Teams ZAP policy state in PowerShell:
- Execution Environment and Prerequisites: Requires ExchangeOnlineManagement.
- Least Privilege and Operation Separation: Run with scoped Exchange / Compliance / SharePoint Administrator (or View-Only / Security Reader for audit commands) 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.
# 1. Connect to Exchange Online PowerShell for Defender policy inspection
Connect-ExchangeOnline -UserPrincipalName "[email protected]"
# 2. Verify Safe Attachments integration across SharePoint, OneDrive, and Teams
Get-AtpPolicyForO365 | Format-List EnableATPForSPOTeamsODB, EnableSafeDocs, AllowSafeDocsOpen
# 3. Check all Safe Links policies to confirm Teams scanning is active
Get-SafeLinksPolicy | Select-Object Name, EnableSafeLinksForEmail, EnableSafeLinksForTeams, EnableSafeLinksForOffice, TrackClicks
# 4. Inspect Teams ZAP configuration
Get-TeamsProtectionPolicy | Format-List Name, ZapEnabled, IsDefaultThreat Detection Telemetry and KQL Verification Query
KQL query in Microsoft Defender XDR tracking Teams URL click blocks and Defender for Office 365 alerts:
// Execution Scope: Read-only hunting/audit query (Log Analytics Reader / Security Reader)
// Data Source: Microsoft Defender XDR Advanced Hunting / Defender for Office 365 Safe Links (UrlClickEvents)
UrlClickEvents
| where Timestamp > ago(14d)
| where Workload == "Teams" or ActionType has "Teams"
| project Timestamp, AccountUpn, Url, ThreatTypes, ActionType, Workload
| union (
AlertInfo
| where Timestamp > ago(14d)
| where ServiceSource == "Microsoft Defender for Office 365"
| project Timestamp, Title, Severity, DetectionSource, AttackTechniques
)
| summarize EventCount = count() by Workload, ActionType, TitleCritical Architectural Assessment, False-Positive Risks, and Rollback Strategy
- Leaving Safe Links Enabled Only for Email: Many admins enable email URL scanning while leaving
EnableSafeLinksForTeamsdisabled inside existing Safe Links policies. - Allowing Open Teams External Federation Globally: Leaving Teams External Access open to all unmanaged domains fuels direct social engineering and vishing lures.
- Risks Mitigated vs. Residual Limitations:
Safe Links,Safe Attachments, anti-impersonation rules, andZAPsubstantially reduce phishing URL clicks, malicious attachments, andQuishingredirections; yet they do not protect off-platform messaging channels (WhatsApp/SMS), payloadless social-engineeringBECfraud, or unrewritten URLs manually typed onto unmanaged personal phones. - New Dependencies and Production Failure Modes: Protection relies on leaving
ZAPactive, eliminating broadSCL = -1transport bypass rules, and maintaining properDynamic Deliveryattachment rules so critical finance/legal mail flow never stalls awaiting sandbox detonation. - Rollback and Pilot Validation Procedure: Pilot strict
Safe Links/Safe Attachmentsprofiles on targeted security groups before broad assignment; release legitimate false positives throughDefender Portal -> Quarantinerather than turningZAPor inspection off tenant-wide.
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
Multi-Channel Distribution Summary (X & LinkedIn Draft)
Toggle X (Twitter) & LinkedIn sharing draftsSecuring Microsoft Teams chats with ZAP, Safe Links, and Defender for Office 365 AIR playbooks. #DefenderForOffice365 #MicrosoftTeams #SecOps
Closing the Collaboration Gap: Activating Safe Attachments across SharePoint/Teams, enabling Teams ZAP, and scaling SOC triage with AIR automation.