| name | implementing-dmarc-dkim-spf-email-security |
| description | SPF, DKIM, and DMARC form the three pillars of email authentication. Together they prevent domain spoofing, validate message integrity, and define policies for handling unauthenticated mail. Proper im |
| domain | cybersecurity |
| subdomain | phishing-defense |
| tags | ["phishing","email-security","social-engineering","dmarc","awareness","dkim","spf","dns"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
| nist_csf | ["PR.AT-01","DE.CM-09","RS.CO-02","DE.AE-02"] |
Implementing DMARC, DKIM, and SPF Email Security
Overview
SPF, DKIM, and DMARC form the three pillars of email authentication. Together they prevent domain spoofing, validate message integrity, and define policies for handling unauthenticated mail. Proper implementation drastically reduces phishing attacks that impersonate your organization's domain.
When to Use
- When deploying or configuring implementing dmarc dkim spf email security capabilities in your environment
- When establishing security controls aligned to compliance requirements
- When building or improving security architecture for this domain
- When conducting security assessments that require this implementation
Common Misconfigurations & Verification
- DMARC stuck at p=none forever: monitoring without progressing to quarantine/reject yields reports but ZERO spoofing protection - set a timeline to advance once legitimate sources align.
- SPF too permissive or over-limit:
+all/?all authorize the world, and more than 10 DNS lookups causes permerror and silent SPF failure - flatten includes and end with -all (hard fail) once sources are inventoried.
- DKIM weak/short key: 1024-bit or shorter keys are deprecated - publish 2048-bit RSA, use a unique selector per sender, and rotate keys annually.
- Alignment overlooked: SPF/DKIM can "pass" yet fail DMARC because the authenticated domain doesn't align with the From header - verify
adkim/aspf alignment, not just pass/fail.
- No subdomain policy: omitting
sp= lets attackers spoof noreply.example.com even when the org domain is locked - set sp=reject.
- rua not monitored: publishing a
rua mailbox nobody reads means failures go unnoticed - feed aggregate XML into an analyzer.
- Verification: send a controlled spoof of your own domain from an unauthorized IP and confirm the receiver rejects/quarantines it; confirm legitimate mail shows
dmarc=pass with alignment in the Authentication-Results header and that DKIM verifies a 2048-bit signature.
Prerequisites
- DNS management access for your domain
- Access to email server/MTA configuration (Postfix, Exchange, Google Workspace, Microsoft 365)
- Basic understanding of DNS TXT records
- Python 3.8+ for validation scripts