← Back to articles Security

Defending Microsoft Teams: Stop Impersonation Attacks at the New Front Door

Defending Microsoft Teams: Stop Impersonation Attacks at the New Front Door
🎬

Video Brief & Interactive Architecture Deck

Watch the walkthrough, explore the 16:9 interactive slide deck, or download PDF notes

▶️ Fullscreen Video ▶️ Watch on YouTube 🔔 Subscribe to MSEndpoint TV

⚡ 60s Highlight Shorts from this Episode

All Shorts on YouTube →

The Scenario

We were managing a 4,200-seat Microsoft 365 E5 tenant for a financial services firm — roughly 3,800 active Teams users, a hybrid workforce that had been fully remote since 2020, and a security posture that had been laser-focused on email for years. Exchange Online Protection was tight. Defender for Office 365 Plan 2 was fully configured. Safe Attachments, Safe Links, impersonation policies — the email stack was solid.

Then in Q4 of last year, the SOC started triaging an uptick in reports that felt different. Three separate users in the finance department received Teams messages from what appeared to be an external Microsoft support contact, asking them to approve an "urgent conditional access change" by clicking a link. The link itself was a credential harvesting page dressed up to look like an Azure AD sign-in portal. None of the three users recognized it as malicious. Two of them clicked. One entered credentials.

This wasn't email phishing. It wasn't a BEC scenario landing in an inbox. It was a direct Teams message from an external federated tenant — a throwaway Microsoft 365 tenant spun up specifically to send these messages. The display name was "Microsoft Support — Identity Team". The profile photo was the Microsoft logo. It looked completely legitimate in the Teams client.

When we pulled the logs, we realized the gap: our Defender for Office 365 policies had been configured with email as the assumed attack surface. Teams as a delivery vector had been treated as a secondary concern — a checkbox rather than a full threat surface. That assumption cost us a credential reset, an MFA re-enrollment, and three weeks of incident review work.

Why This Matters

The threat model for Microsoft 365 tenants has fundamentally shifted. According to Microsoft's own telemetry shared in the Defender for Office blog, attackers are deliberately moving to Teams because the trust model is different — users are conditioned to treat Teams messages as internal, verified communications. The cognitive barrier that makes someone pause before clicking a link in email simply doesn't exist at the same level in Teams.

What the official docs don't tell you clearly enough is this: external access in Teams is enabled by default for all new tenants, and the controls to restrict it are spread across three different admin portals. Teams Admin Center controls who can communicate externally. Defender for Office 365 controls URL scanning in Teams messages. Entra ID conditional access controls what happens after a credential is entered. If you haven't explicitly audited and locked each of those layers, you have gaps — regardless of how well-configured your email security is.

The compliance implications are real too. In regulated industries, demonstrating that you have visibility into and control over all communication channels — not just email — is increasingly required. FINRA, HIPAA, and ISO 27001 auditors are starting to ask specifically about Teams security controls. "We have Defender for Office" is no longer a sufficient answer when the audit question is about collaboration platform security.

User productivity is also at stake, but in a counterintuitive way. Locking Teams down too aggressively — blocking all external communication — breaks legitimate vendor and partner workflows that people now depend on. The goal is surgical hardening, not a sledgehammer approach.

Root Cause Analysis

Let's break down how this attack class actually works, because understanding the mechanism is what drives the right fix.

The External Access Trust Gap

Teams external access (formerly called federation) allows users in one Microsoft 365 tenant to send direct messages to users in another tenant. When this is enabled openly, any Microsoft 365 tenant — including one created five minutes ago with a free trial — can initiate contact with your users. The receiving user sees the message in their Teams client with a banner indicating the sender is external, but that banner is easy to overlook, especially in a busy chat thread.

The impersonation vector works because Teams doesn't validate display names against known Microsoft entities. An attacker can create a tenant, set their display name to "Microsoft Support" or "IT Helpdesk — [Your Company Name]", upload a convincing logo, and send messages that visually impersonate legitimate contacts. Unlike email, there's no equivalent of DMARC/DKIM for Teams identity — the display name is entirely attacker-controlled.

What Defender for Office 365 Can and Cannot See

Safe Links in Defender for Office 365 does extend to Teams — URLs in Teams messages are scanned, and if you have the right policy configured, malicious links are rewritten and blocked. But this only works if your Safe Links policy explicitly includes Teams as a target. The default policy behavior and the "built-in protection" preset cover Teams, but any custom Safe Links policies you've created that don't explicitly enable Teams coverage create a gap.

You can verify your current Safe Links coverage for Teams with the following PowerShell:

Connect-ExchangeOnline

# Check all Safe Links policies for Teams coverage
Get-SafeLinksPolicy | Select-Object Name, EnableForInternalSenders, EnableSafeLinksForTeams, TrackClicks, AllowClickThrough | Format-Table -AutoSize

Pay close attention to EnableSafeLinksForTeams. If any policy scoped to users has this set to False, those users' Teams messages are not being URL-scanned. In our case, we had a legacy custom policy from a 2021 migration that predated the Teams Safe Links feature — it was scoped to an executive group and had Teams scanning disabled simply because the option didn't exist when the policy was created.

Investigating the Attack Chain in Logs

When the incident happened, we pulled the unified audit log to reconstruct what occurred. The relevant log entries for Teams external message delivery live under the MicrosoftTeams workload. Here's the query we ran:

Connect-ExchangeOnline

Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) `
  -RecordType MicrosoftTeams `
  -Operations "MessageSent","MessageCreatedHasLink" `
  -ResultSize 1000 | 
  Where-Object { $_.AuditData -like "*external*" } |
  Select-Object CreationDate, UserIds, Operations, AuditData |
  Export-Csv -Path "C:\Temp\TeamsExternalMessages.csv" -NoTypeInformation

This gave us a timeline of all external-originated messages containing links. We could see the throwaway tenant domain in the sender metadata, cross-reference it against the Defender portal's threat intelligence, and confirm it was a newly registered tenant with no legitimate history.

We also used the Graph API to pull Teams communication metadata for the affected users:

# Requires Reports.Read.All permission
$userId = "affected.user@contoso.com"
$headers = @{ Authorization = "Bearer $accessToken" }

# Get chat messages for investigation
$uri = "https://graph.microsoft.com/v1.0/users/$userId/chats?$expand=members"
$chats = Invoke-RestMethod -Uri $uri -Headers $headers -Method Get

# Filter for external participant chats
$externalChats = $chats.value | Where-Object {
  $_.members.value | Where-Object { $_.tenantId -ne "YOUR-TENANT-ID" }
}
$externalChats | ConvertTo-Json -Depth 5 | Out-File "C:\Temp\ExternalChats.json"

The Solution

The fix isn't a single toggle. It's a layered hardening across three control planes: Teams Admin Center, Defender for Office 365, and Entra ID. Here's the full implementation we deployed.

Layer 1 — Restrict External Access to Known Domains Only

In the Teams Admin Center, we moved from open federation to an explicit allowlist. This is the single highest-impact change you can make. Navigate to Teams Admin Center → Users → External Access and switch from "Allow all external domains" to "Allow only specific external domains." Then add your known partner and vendor domains explicitly.

You can also manage this via PowerShell for automation and auditing purposes:

Connect-MicrosoftTeams

# Check current external access configuration
Get-CsTenantFederationConfiguration | Select-Object AllowFederatedUsers, AllowedDomains, BlockedDomains

# Set to allowlist mode with specific trusted domains
Set-CsTenantFederationConfiguration -AllowFederatedUsers $true

# Add trusted domains
New-CsEdgeAllowSpecificDomain -Domain "trustedpartner.com"
New-CsEdgeAllowSpecificDomain -Domain "vendordomain.com"

# Explicitly block newly registered/throwaway domains isn't scalable,
# so allowlist mode is the correct approach for high-security tenants

Layer 2 — Enforce Safe Links for Teams Across All Policies

Every Safe Links policy in your tenant needs Teams coverage enabled. The Strict and Standard presets handle this automatically, but custom policies don't inherit preset changes retroactively. Here's how to audit and remediate at scale:

Connect-ExchangeOnline

# Get all policies where Teams scanning is disabled
$policies = Get-SafeLinksPolicy | Where-Object { $_.EnableSafeLinksForTeams -eq $false }

foreach ($policy in $policies) {
  Write-Host "Remediating policy: $($policy.Name)"
  Set-SafeLinksPolicy -Identity $policy.Identity `
    -EnableSafeLinksForTeams $true `
    -TrackClicks $true `
    -AllowClickThrough $false
  Write-Host "Done: $($policy.Name)" -ForegroundColor Green
}

# Verify remediation
Get-SafeLinksPolicy | Select-Object Name, EnableSafeLinksForTeams, AllowClickThrough | Format-Table

The AllowClickThrough $false is critical. Without it, users can bypass the Safe Links block warning by clicking through. In a social engineering scenario, a motivated user under perceived urgency will click through. Don't give them the option.

Layer 3 — Configure Anti-Phishing Impersonation Detection for Teams Contexts

Anti-phishing policies in Defender for Office 365 include impersonation protection, and while this is primarily an email feature, the intelligence it builds feeds into the broader Defender signal for your tenant. Make sure you have impersonation protection configured for your key executives and domains — this helps Defender correlate when the same impersonation target seen in email starts appearing in Teams-originated threats.

Connect-ExchangeOnline

# Check current impersonation protection configuration
Get-AntiPhishPolicy | Select-Object Name, EnableTargetedUserProtection, TargetedUsersToProtect, EnableTargetedDomainsProtection | Format-List

# Add specific user impersonation targets if not already configured
$policy = Get-AntiPhishPolicy -Identity "Office365 AntiPhish Default"

Set-AntiPhishPolicy -Identity $policy.Identity `
  -EnableTargetedUserProtection $true `
  -TargetedUsersToProtect @(
    "CEO Display Name;user@contoso.com",
    "CFO Display Name;user@contoso.com",
    "IT Director;itdirector@contoso.com"
  ) `
  -TargetedUserProtectionAction Quarantine `
  -EnableTargetedDomainsProtection $true `
  -TargetedDomainsToProtect @("yourdomain.com","yoursubsidiary.com") `
  -TargetedDomainProtectionAction Quarantine

Layer 4 — Enable User Reporting in Teams

One of the features highlighted in Microsoft's recent Defender for Office blog update is transparent reporting — giving users the ability to report suspicious Teams messages directly from the Teams client, and having those reports feed into the Defender portal for analyst review. This is now available and should be enabled for every tenant.

In the Microsoft 365 Defender portal, navigate to Settings → Email & Collaboration → User Reported Settings. Ensure that Teams message reporting is enabled, and configure reports to flow to your security mailbox or directly to Microsoft for analysis. This creates a human-sensor layer on top of your automated controls — the users who hesitate and report are your early warning system for campaigns that the automated controls haven't caught yet.

See the official Microsoft documentation on Teams message submissions for the full configuration walkthrough.

Layer 5 — Conditional Access as the Last Line

Even if a credential is successfully phished through a Teams-delivered link, Conditional Access can prevent it from being used. Ensure you have policies enforcing MFA for all cloud app access, and consider adding a Defender for Cloud Apps session policy that triggers additional verification when sign-in risk is elevated. The sign-in risk signal from Entra ID Protection will fire on credential use from unfamiliar locations or devices — which is exactly what happens when a phished credential is used by an attacker.

Reference: Conditional Access: Require MFA for all users

Scaling Considerations

In a 4,200-seat tenant, the external access allowlist approach surfaced an immediate problem: no one had a complete inventory of which external domains users were legitimately communicating with via Teams. We discovered this the hard way when business partners started calling to ask why they couldn't reach their contacts anymore.

Before flipping external access to allowlist mode in a large environment, run a 30-day audit of external communication patterns first. The unified audit log query above will give you the data. Export it, extract the unique sender domains, send that list to department heads for verification, and then build your allowlist. This process took us two weeks and was absolutely worth doing before the cutover.

At 10,000+ seats, the PowerShell-based Safe Links remediation script works fine but you should wrap it in proper error handling and run it during off-hours. Safe Links policy updates propagate across the service within minutes, but in very large tenants with many custom policies, you want to validate each update rather than fire-and-forget the loop.

For tenants using Teams Rooms devices or Surface Hub, external access restrictions apply differently — those device accounts may need specific exceptions in your federation configuration. Test in a pilot group that includes shared device accounts before broad deployment.

Also worth noting: if your organization uses Teams Connect (shared channels), the external access model is different. Shared channels use B2B direct connect, not federation, and are controlled separately under the External Access settings. Don't assume that restricting federation covers shared channel access — it doesn't. See Microsoft's Teams external access management documentation for the full picture on both models.

User reporting volume can spike significantly after you enable it and communicate it to users. Make sure your security operations team is prepared to triage the increased submission queue. In our environment, enabling Teams message reporting increased total user submissions by about 40% in the first month — mostly false positives as users got comfortable with the feature, but that volume needs analyst capacity to process.

Lessons Learned

  • Your email security posture and your Teams security posture are not the same thing. Defender for Office 365 covers both surfaces, but they require explicit, separate configuration. Treating Teams as an automatic extension of your email hardening is how gaps form. Audit them independently on a quarterly basis.
  • Default-open external access is a deliberate Microsoft product decision, not a security recommendation. It exists to reduce friction for new customers. In a production enterprise environment with any kind of compliance or security requirement, it should be scoped to known domains within the first 90 days of deployment. This is rarely done in practice.
  • The display name impersonation risk in Teams is significantly higher than in email. Email has DMARC, DKIM, and decades of user training to identify spoofed senders. Teams has none of that. Users are more susceptible because the mental model for Teams messages is "colleague" not "stranger." Your user awareness training needs to explicitly cover Teams as an attack surface — not just email.
  • User reporting in Teams is a force multiplier, but only if the SOC is staffed to act on it. Enabling it without a triage process creates alert fatigue and erodes user confidence in the security team when reports go unacknowledged. Build the workflow before you enable the feature.
  • The throwaway tenant problem has no perfect technical solution yet. Any attacker can spin up a Microsoft 365 trial tenant in minutes and use it to send Teams messages before it gets flagged. Allowlisting known domains is the most effective mitigation available today, but it's an architectural control, not a detection control. Pair it with user awareness and quick-action reporting to close the remaining gap.

Was this article helpful?

🎯
MSEndpoint Academy · MD-102

Assess Your Microsoft 365 & Intune Skills (MD-102)

100% Free • 10 Real Questions

Applying this guide in production? Test your technical readiness against real exam scenarios from Microsoft 365 Certified: Endpoint Administrator (MD-102).

💡 MD-102 Express Knowledge Check · Official Question

You want an Intune compliance policy assigned to All Devices to apply ONLY to corporate Windows 11 laptops without waiting for dynamic group re-evaluation. Which Intune capability handles this instantaneously at check-in?

MSEndpoint Academy Realistic Simulator Tour
▶
🎬 2-MIN SIMULATOR TOUR
⚡ Stop Failing on Pearson VUE Case Studies
See Real Split-Screen Case Studies, Mistake Drills & 1:1 Live Coaching in Action
  • 3-Question Linked Case Studies + Interactive Hotspots
  • Retry Failed Questions with verified Microsoft Learn deep links
  • 1-on-1 Certified Architect Coaching & Enterprise Team Passes
🔒 100% Free • 📊 Instant Explanations • 🖥️ Pearson VUE Mode
Take Free 10-Question MD-102 Diagnostic → MD-102 2026 Exam Guide & Sample Q&A Launch Pearson VUE Simulator
🎁 Free Community Automation Hub

Functional Automation & Blueprints

Production-ready scripts, GitHub repositories, and architectural blueprints created for this technical guide.

PowerShell, Exchange Online Management Module, Defender for Office 365
AUTOMATION TOOLKIT

Microsoft Teams Safe Links Coverage Auditor

Audits all Defender for Office 365 Safe Links policies to identify gaps in Teams URL scanning coverage, highlighting any policies where Teams protection is disabled.

Star on GitHub Download .ps1
💡 Enterprise Blueprint
HIGH IMPACT

TeamsGuard Pro

Automated Microsoft Teams external access auditor and impersonation risk scorer for security-conscious IT admins.

🤝 Custom Build

🎓 Ready to go deeper on MD-102?

Practice real MD-102 exam questions, study verified Microsoft Learn explanations, and test yourself in Pearson VUE simulator mode.

Free 10Q MD-102 Exam → Launch Simulator 📚 Study Guides (20 Domains) ⚖️ vs MeasureUp
📡

Don't miss the Friday Microsoft Endpoint & Security TV Digest

One email a week: the Intune, Entra & Windows changes that actually matter, the Alex & Sarah TV episode, and new production-ready PowerShell scripts. No spam, unsubscribe in one click.

Browse past TV episodes & issues →
Souhaiel Morhag
Souhaiel Morhag
Microsoft Endpoint & Modern Workplace Engineer

Souhaiel Morhag is a Microsoft Intune and endpoint management specialist with hands-on experience deploying and securing enterprise environments across Microsoft 365. He founded MSEndpoint.com to share practical, real-world guides for IT admins navigating Microsoft technologies — and built the MSEndpoint Academy at app.msendpoint.com/academy, a dedicated learning platform for professionals preparing for the MD-102 (Microsoft 365 Endpoint Administrator) certification. Through in-depth articles and AI-powered practice exams, Souhaiel helps IT teams move faster and certify with confidence.

Related Articles

Popular on MSEndpoint