M365 Admin Handbook — Chapter 6: Email Security Mastery (SPF, DKIM, DMARC, ARC, Inbound DANE & Defender for O365)

📚 Mastering Microsoft 365 & Endpoint Administration Chapter 6 of 14
View Full Book TOC →
📘 Chapter 6 Executive Brief — Email Security Mastery
  • Zero-Spoof Baseline: Every custom M365 domain must publish a clean SPF record (<10 DNS lookups), enable 2048-bit DKIM signing in Exchange Online, and progress DMARC from p=none → p=quarantine → p=reject.
  • Forwarding & Transport Hardening: Configure Trusted ARC Sealers (Set-ArcConfig) for third-party gateways and enable Inbound SMTP DANE + DNSSEC to defeat downgrade/MITM attacks.
  • Defender Preset Policies: Replace ad-hoc anti-phishing rules with Microsoft's Standard / Strict Preset Security Policies + Safe Links + Safe Attachments + Zero-Hour Auto Purge (ZAP).

In Chapter 5, we mastered Exchange Online connectors, transport rules, and Get-MessageTraceV2. In Chapter 6, we lock down the #1 enterprise attack vector—email—by layering cryptographic authentication (SPF, DKIM, DMARC, ARC, DANE) with Microsoft Defender for Office 365.


1. The 5-Layer Email Authentication & Protection Stack

Defense-in-Depth Email Security Stack in Exchange Online 1. TRANSPORT (DNSSEC) • Inbound SMTP DANE • MTA-STS + TLS-RPT • Mandatory TLS 1.2/1.3 Stops MITM & Downgrade 2. AUTHENTICATION • SPF (<10 DNS Lookups) • 2048-bit DKIM Rotation • DMARC p=reject Stops Domain Spoofing 3. FORWARDING • Trusted ARC Sealers • Set-ArcConfig • Preserves Auth Chain Prevents False Rejects 4. DEFENDER O365 • Strict Preset Policies • Safe Links / Attach • ZAP Post-Delivery Blocks BEC & Phishing Apply Strict Preset Security Policies to VIPs & IT Admins (who face 5x higher spear-phishing targeting) and Standard Preset to all users.

2. Auditing SPF, DKIM & DMARC Across Every Accepted Domain

Don't check domains one by one in DNS tools. Run a single PowerShell audit across every accepted domain in your tenant (see our full SPF/DKIM/DMARC All-Domains PowerShell Audit):

POWERSHELL
Connect-ExchangeOnline -ShowBanner:$false

$domains = Get-AcceptedDomain | Where-Object { $_.DomainName -notlike '*.onmicrosoft.com' }

$report = foreach ($d in $domains) {
    $name  = $d.DomainName
    $dkim  = Get-DkimSigningConfig -Identity $name -ErrorAction SilentlyContinue
    $spf   = (Resolve-DnsName -Name $name -Type TXT -ErrorAction SilentlyContinue).Strings | Where-Object { $_ -like 'v=spf1*' } | Select-Object -First 1
    $dmarc = (Resolve-DnsName -Name "_dmarc.$name" -Type TXT -ErrorAction SilentlyContinue).Strings | Where-Object { $_ -like 'v=DMARC1*' } | Select-Object -First 1

    [PSCustomObject]@{
        Domain      = $name
        SPF         = if ($spf) { $spf } else { "MISSING" }
        DKIMEnabled = if ($dkim) { $dkim.Enabled } else { $false }
        DKIMKeySize = if ($dkim) { $dkim.Selector1KeySize } else { "N/A" }
        DMARC       = if ($dmarc) { $dmarc } else { "MISSING" }
    }
}

$report | Format-Table -AutoSize

3. Enabling 2048-Bit DKIM, Trusted ARC Sealers & Inbound DANE

POWERSHELL
# 1. Enable 2048-bit DKIM signing on a custom domain (after publishing selector1 & selector2 CNAMEs)
New-DkimSigningConfig -DomainName "lab365.in" -KeySize 2048 -Enabled $true

# 2. Configure Trusted ARC Sealers if mail flows through an external gateway/forwarder
Set-ArcConfig -Identity Default -ArcTrustedSealers "gateway.partner.com"

# 3. Enable Inbound SMTP DANE with DNSSEC on Exchange Online
Enable-DnssecForVerifiedDomain -DomainName "lab365.in"
Enable-SmtpDaneInbound -DomainName "lab365.in"

For full step-by-step DNS cutover details, see our companion runbooks on Configuring Trusted ARC Sealers (Set-ArcConfig) and Enabling Inbound SMTP DANE + DNSSEC in Exchange Online.


4. Auditing Microsoft Defender for Office 365 Protection Posture

Verify that Zero-Hour Auto Purge (ZAP), Anti-Phishing Impersonation Protection, and Safe Links / Safe Attachments are active:

POWERSHELL
# Verify Anti-Phish policies & Mailbox Intelligence
Get-AntiPhishPolicy |
    Select-Object Name, Enabled, EnableMailboxIntelligence, EnableMailboxIntelligenceProtection, EnableSpoofIntelligence, PhishThresholdLevel |
    Format-Table -AutoSize

# Verify Preset Security Policy rules (Standard & Strict)
Get-EOPProtectionPolicyRule | Select-Object Name, State, Priority, SentToMemberOf | Format-Table -AutoSize
Get-ATPProtectionPolicyRule | Select-Object Name, State, Priority, SentToMemberOf | Format-Table -AutoSize

Chapter 6 Verification Checklist

  • [ ] Every custom domain has SPF (~all or -all, under 10 DNS lookups), 2048-bit DKIM enabled, and DMARC at p=quarantine or p=reject.
  • [ ] Parked/non-sending domains publish v=spf1 -all and v=DMARC1; p=reject;.
  • [ ] Standard Preset Security Policy covers all users, and Strict Preset Security Policy protects executives and IT admins.
  • [ ] Inbound SMTP DANE + DNSSEC is enabled on primary receiving domains.

💬 Reader Comments & Feedback

Did this runbook help, or did Microsoft change a cmdlet or UI menu? Share your feedback below.