Saltar al contenido
Skillpedia
Seguridad35 mil · #8031

implementing-dmarc-dkim-spf-email-security

Qué hace

Esta herramienta ayuda a proteger el dominio de tu correo electrónico configurando tres sistemas de seguridad: SPF, DKIM y DMARC. Así se evita que otros envíen correos falsos usando tu nombre y se asegura de que tus correos lleguen a sus destinatarios.

Cuándo usarla

  • ✓Cuando configuras por primera vez la seguridad del correo de tu dominio.
  • ✓Para defenderte de ataques de phishing y de suplantación de correo.
  • ✓Cuando compruebas si la configuración de seguridad del correo cumple las normas.

Link de la skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-dmarc-dkim-spf-email-security/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-dmarc-dkim-spf-email-security/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Configura la seguridad del correo electrónico de mi dominio.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Revisa tu configuración actual y después crea registros específicos en tu DNS (el sistema que gestiona los nombres de dominio de internet) para SPF, DKIM y DMARC. Estos registros indican a otros servidores de correo quién puede enviar correos en tu nombre y cómo comprobar si los correos son legítimos.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

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

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

Key Concepts

SPF (Sender Policy Framework)

Publishes a DNS TXT record listing authorized IP addresses and mail servers that can send email on behalf of your domain. Receiving servers check the envelope sender's IP against this list.

DKIM (DomainKeys Identified Mail)

Adds a cryptographic signature to outgoing emails using a private key. The corresponding public key is published in DNS. Receivers verify the signature to ensure the message was not altered in transit.

DMARC (Domain-based Message Authentication, Reporting and Conformance)

Builds on SPF and DKIM by specifying a policy (none/quarantine/reject) for messages that fail authentication, and provides a reporting mechanism to monitor spoofing attempts.

Workflow

Step 1: Audit Current State

# Check existing SPF record
dig TXT example.com | grep spf

# Check existing DKIM selector
dig TXT selector1._domainkey.example.com

# Check existing DMARC record
dig TXT _dmarc.example.com

Step 2: Implement SPF

# DNS TXT record for example.com
v=spf1 ip4:203.0.113.0/24 include:_spf.google.com include:spf.protection.outlook.com -all

Key SPF mechanisms:

  • ip4: / ip6: - Authorize specific IP ranges
  • include: - Include another domain's SPF record
  • a - Authorize domain's A record IPs
  • mx - Authorize domain's MX record IPs
  • -all - Hard fail all others (recommended)
  • ~all - Soft fail (monitoring phase)

Step 3: Implement DKIM

# Generate DKIM key pair (2048-bit RSA)
openssl genrsa -out dkim_private.pem 2048
openssl rsa -in dkim_private.pem -pubout -out dkim_public.pem

# Format public key for DNS (remove headers, join lines)
grep -v "PUBLIC KEY" dkim_public.pem | tr -d '\n'

DNS TXT record at selector1._domainkey.example.com:

v=DKIM1; k=rsa; p=MIIBIjANBgkqhki...

Step 4: Implement DMARC

# DNS TXT record at _dmarc.example.com
# Phase 1 (Monitor):
v=DMARC1; p=none; rua=mailto:dmarc-aggregate@example.com; ruf=mailto:dmarc-forensic@example.com; pct=100

# Phase 2 (Quarantine):
v=DMARC1; p=quarantine; rua=mailto:dmarc-aggregate@example.com; pct=25

# Phase 3 (Reject):
v=DMARC1; p=reject; rua=mailto:dmarc-aggregate@example.com; pct=100

Step 5: Monitor and Analyze DMARC Reports

Use the scripts/process.py to parse DMARC aggregate XML reports and identify authentication failures, unauthorized senders, and spoofing attempts.

Tools & Resources

Validation

  • SPF record passes validation at mxtoolbox.com
  • DKIM signature verified on test emails
  • DMARC record properly formatted and reporting enabled
  • Test emails pass all three checks in recipient's Authentication-Results header
Preguntas frecuentes

¿Qué son SPF, DKIM y DMARC?

Son métodos para demostrar que un correo procede realmente de quien dice ser. SPF comprueba el servidor que envía, DKIM añade una firma digital y DMARC indica qué hacer si algo no cuadra.

¿Necesito acceso a mi DNS?

Sí, necesitas permiso para añadir o modificar registros DNS de tu dominio para que esta herramienta funcione.

¿Esto detendrá todo el spam?

No directamente, pero dificulta mucho que los atacantes envíen correos falsos con tu dominio, algo muy habitual en el phishing y el spam.

Detalles

Descripción original del autor

Configures SPF, DKIM, and DMARC DNS TXT records to authenticate outbound email, prevent domain spoofing, and enforce a rejection/quarantine policy on unauthenticated mail, including auditing a domain's current DNS state. Use when hardening a domain's email security posture or defending against phishing and spoofing attacks.

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularidad

Estrellas en GitHub
35 mil
Posición en el ranking
#8031
Licencia
Apache-2.0
Actualizada
31/8/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas