[ DKIM ]

Incident response for a compromised DKIM signing key

Contain exposed signing authority, replace affected keys and preserve an evidence-based incident timeline.

By the EmailAuth research team · 3 min read

[ Key points ]

  • Contain exposed signing authority, replace affected keys and preserve an evidence-based incident timeline.
  • A new key does not remove an attacker’s existing access.
On this page

A compromised DKIM private key can let an attacker create signatures that verify under the affected signing domain. Treat the event as a signing-authority incident. Replacing a DNS record is only one part of containment, and DKIM verification alone cannot distinguish an authorized signer from an attacker holding the same key.

Establish the affected authority

Identify the signing domain, selectors, key custodian and every service using the private key. Preserve relevant audit logs, configuration and representative suspicious messages without copying the secret into tickets or chat. Record discovery time, likely exposure window and what is known versus suspected.

Separate private-key theft from unauthorized access to a signing service. An attacker with account access may continue signing after a key rotation unless that access is contained. DNS administration compromise is another dependency requiring its own response. Coordinate these investigations under the incident owner.

Stop new misuse and revoke the old verification path

Suspend affected signing routes or credentials through the approved incident process. RFC 6376 permits revocation by publishing an empty p value. Removing the key also prevents successful retrieval once the absence is visible. Choose the response supported by the platform and verify the exact selector and domain before changing it.

Revocation is not instantaneous across every receiver. Cached DNS data and messages already evaluated create a time-dependent boundary. Do not promise that changing DNS retroactively invalidates signatures in delivered mail or proves that no abusive messages were accepted.

Normal rotation overlap preserves verification for queued legitimate messages. During compromise, keeping the exposed key verifiable can also preserve an attacker's capability. The incident owner must weigh containment against delayed-mail failures rather than applying the routine overlap schedule automatically.

Restore signing through a clean path

Generate replacement key material through a trusted supported process after addressing the exposure cause. Prefer a new supported selector so old and new evidence can be distinguished. Apply current cryptographic requirements. For RSA signing, RFC 8301 requires rsa-sha256 rather than rsa-sha1 and recommends at least 2048-bit keys.

Illustrative response: selector sales1 is exposed and its signing account is contained. A clean signer uses sales2 while sales1 is revoked. New controlled mail verifies with sales2 and aligns with From; delayed mail signed with sales1 may fail. This example describes an explicit trade-off, not a completed incident or a guarantee of universal receiver behavior.

Verify recovery and preserve uncertainty

Test every affected route, not just one mailbox. Save raw messages and trusted results, inspect the new selector, confirm alignment and verify that compromised credentials no longer authorize signing. Review provider logs and receiver reports for the exposure period, noting that reports do not cover every receiver or prove who sent each message.

Maintain a timeline of containment, DNS observations, replacement deployment and customer-impact assessment. Keep forensic copies access-controlled. Close the incident only with an identified owner for remaining investigation and a corrected key-custody or access failure. A successful new signature proves the recovery route works; it does not by itself establish the full scope of earlier misuse.

Exercise a tabletop before an emergency

In this synthetic timeline, service account A holds sales1 and clean account B holds sales2. At minute zero, contain A. At minute one, publish sales1 revocation. At minute two, a fictional resolver still has its old cached key, so old signatures may remain verifiable there. At minute three, start the clean sales2 route. At minute thirty, collect per-route received results and access evidence rather than declaring recovery from DNS alone. These timings illustrate ordering, not a promised propagation interval.

This written tabletop proposes five required recovery observations: old access disabled, exposure cause contained, new key published, fresh signature verified and fresh signature aligned. A scenario with new mail passing but old access still active fails the recovery gate. A scenario satisfying all five passes the modeled gate. Both sets of observations are synthetic; no tabletop program, tenant or message test was executed. Actual containment, cache observations, approvals and message tests remain required during a real incident.

Assign an owner to each unresolved recovery gate

Written case KEY-01 assumes the replacement selector sales2 produces a passing aligned signature for From sales@example.org with d=example.org, but the old service account remains active. The incident owner must keep recovery open and address access containment; a mail administrator’s successful signature test cannot close that gap. Old resolver caches and past abuse scope remain unknown. The identities and results are stipulated teaching assumptions, not an executed incident.

[ Takeaway ]

A new key does not remove an attacker’s existing access.

[ By role ]

What this means for you

Choose your role for practical next steps.

IT / Mail Admin

Replace the entire affected path

New DNS data is insufficient if an attacker retains signing access.

Next steps

  1. Inventory shared-key routes.
  2. Deploy a clean supported selector.
  3. Verify every restored route.

CISO / SecOps

Preserve a defensible incident timeline

Verification and attribution are different questions after key exposure.

Next steps

  1. Contain credentials and DNS access.
  2. Record cache and reporting uncertainty.
  3. Investigate and correct the exposure cause.

Founder / Non-technical

Coordinate containment and continuity

Emergency revocation can affect legitimate delayed mail as well as abuse.

Next steps

  1. Name the incident decision owner.
  2. Identify critical messages at risk.
  3. Approve a recovery communication plan.

[ FAQs ]

Frequently asked questions

Can an attacker with the private key sign as our domain?

They can create signatures under the affected key and signing domain while receivers can verify that key.

Does rotating the key revoke stolen account access?

No. Contain service credentials and permissions separately.

What does an empty p value mean?

RFC 6376 defines it as a revoked key.

Is DNS revocation immediate everywhere?

No. Cache state and prior message evaluations limit what a current change proves.

Should a compromised key receive routine overlap?

Not automatically. Continued verification can preserve misuse, so containment risk governs the decision.

Will revocation change already delivered messages?

It does not retroactively alter their original authentication results or delivery decisions.

Why use a new selector?

When supported, it separates replacement signing and investigation evidence from the exposed key.

What proves recovery?

Clean access, corrected custody, new per-route verified and aligned messages, and documented residual investigation.

[ Sources ]

Sources

  1. RFC 6376: DomainKeys Identified Mail Signatures

    Sections §3.4 · §3.6.1 · §3.7 · §6.1.2 · §8.3

  2. RFC 8301: Cryptographic Algorithm and Key Usage Update to DKIM

    Sections §3.1 · §3.2

  3. RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance

    Sections §4.4 · §5.3.1 · §5.3.5 · §7.4 · §11.7

[ Glossary ]

Glossary

DKIM
A signature-based mechanism binding selected message content to a signing domain.
SPF
Authorization of a connecting sending IP for the identity defined by the SPF protocol.
DMARC alignment
The required domain relationship between the author domain and a successfully authenticated identifier.
DKIM selector
The s value used with the signing domain to locate public verification data.

Enterprise provenance

Why top financial institutions and governments retired their email security dashboards.

Traditional email authentication platforms sell you a dashboard and ask your engineers to do the labour. In high-stakes environments, manual oversight means delayed enforcement, configuration drift and unmonitored shadow domains.

EmailAuth is the agentic email provenance platform. Our agents enforce p=reject, keep third-party senders aligned and move your domains to full RFC 9989 compliance, the new DMARC standard,, with human-in-the-loop auditability.

Governments Large enterprises Tier-1 financial institutions

SaaS · Dedicated tenancy · Air-gapped on-prem · BYOK encryption

Knowledge Base