Join our Newsletter — 33% off our NHI Course
Home› Guides› If your email encryption gateway is compromised: revoke…
Guide Email & Communications Security

If your email encryption gateway is compromised: revoke keys, protect archived mail and rebuild

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 14 November 2026 15 min read
On this page

A compromised email encryption gateway can expose every message it was trusted to protect, because it holds the private keys that decrypt inbound mail, the signing keys that vouch for outbound mail and the policy that decides which messages get encrypted at all. This playbook covers the response when that gateway, or the accounts that run it, can no longer be trusted: how the compromise shows up, the first hour of triage, containment in priority order, key and certificate revocation, rebuild, and what to tell partners and regulators. It applies to self-hosted gateways, virtual appliances and cloud policy-based encryption services, including the external recipient portal many of them run. It is written for messaging engineers, PKI teams and incident responders, and it is vendor-neutral, so confirm exact menus and commands in your own product's documentation. Preventive hardening is in Securing the Email Encryption Gateway Itself, and filtering gateways are handled separately in If your email security gateway is compromised; this page does not repeat either.

Key takeaways

  • Decide early whether private keys left the gateway. If keys were exportable and an attacker had admin or root access, assume they were copied and revoke them; if keys sat non-exportable in an HSM, the exposure is limited to the period the attacker could use them.
  • Revocation protects the future, not the past. A copied decryption key still opens every archived or intercepted message encrypted to it, so scope the past exposure separately from issuing new keys.
  • Escrow decides whether you can recover. Retrieve escrowed keys under split custody before rebuilding, or archived mail may become unreadable to you while staying readable to the attacker.
  • Policy tampering is as serious as key theft. A bypass rule that sent mail in clear, or a routing change that copied decrypted mail out, exposes content without touching a key.
  • Partners must learn your new certificates. Gateway to gateway encryption and S/MIME signing fail or stay exposed until correspondents replace the old public keys you have revoked.

What an attacker gains, by component

An encryption gateway concentrates three kinds of power. The response for each is different, so establish early which of them the attacker reached.

What was reachedImmediate consequencePast exposurePrimary response
Decryption private keys (S/MIME, OpenPGP or domain keys for gateway to gateway encryption)Attacker can read any message encrypted to those keys, wherever it is stored or capturedAll archived and intercepted mail encrypted to the keys, for their whole lifetimeRevoke with a key compromise reason, issue new keys, scope archive exposure
Signing private keysAttacker can send mail that verifies as signed by your users or domainSignatures made during the window are suspectRevoke, reissue, tell partners which signatures to distrust
Encryption and bypass policyChosen recipients or domains receive mail in clear, or decryption scanning is skippedMessages sent under the altered rulesRoll back to a reviewed baseline, trace affected messages
Routing, journaling and connectorsDecrypted copies sent to an attacker mailbox or relayEverything routed during the windowRemove routes on gateway and mail platform, rotate connector trust
External recipient portalAccess to messages held for outside recipients, or recipient account takeoverMessages stored in the portal and their downloadsReset portal admin and recipient access, review downloads
Integration credentials (directory bind, CA enrolment, archive, API)Directory enumeration, issuance of trusted email certificates, bulk archive readsCertificates issued and archive reads in the windowDisable, rotate, revoke any certificates the enrolment credential issued

RFC 8551 describes a trusted gateway removing the encryption envelope of a message while leaving its signature intact. That is the normal job of an inbound gateway, and it is why the gateway and every point downstream of it hold plaintext. Relevant ATT&CK techniques are T1114 Email Collection and T1114.002 Remote Email Collection for mail copying, T1649 Steal or Forge Authentication Certificates for key and certificate theft, T1557 Adversary-in-the-Middle for rerouting, T1098 Account Manipulation for new admin roles and T1685 Disable or Modify Tools for switching encryption policy off.

How the compromise shows up

  • Key events: a key or certificate export, an escrow recovery, a new key import or a change to key admin roles that no change ticket explains.
  • Policy drift: new bypass entries for domains or recipients, encryption rules switched from enforce to optional, or decryption scanning disabled for a group.
  • Routing changes: new journaling or blind copy destinations on the gateway, or new transport rules and connectors on the mail platform that send mail around or out of the gateway.
  • Portal anomalies: bulk downloads, admin sign-ins from new locations, or a spike in passcode failures against recipient accounts.
  • Outside signals: a partner reports signed mail from your domain that you did not send, or a CA reports certificates issued to your email addresses that nobody requested.
  • Platform compromise: a vendor security advisory for your version, unexpected processes or outbound connections from a self-hosted appliance, or a vendor notice about its own cloud service.

Triage: the first hour

  1. Classify the access. Was it an admin account in the console, root or code execution on the platform, an integration credential, or a vendor-side incident? Root access means every key the platform could read is presumed copied.
  2. Establish key storage. For each key, record whether it was non-exportable in an HSM or key service, or held in software on the gateway. See the HSM Deployment and Operations Guide.
  3. Fix the window. Find the earliest suspicious event in gateway and mail platform audit logs; this bounds which messages, policies and certificates you review.
  4. Locate escrow. Confirm where escrowed encryption keys are held, who the custodians are, and whether the escrow store was reachable from the compromised accounts.
  5. List dependants: partner domains using gateway to gateway encryption, users with gateway-held S/MIME certificates, the archive, the CA enrolment profile and the portal.
  6. Decide on mail flow. Choose whether sensitive outbound mail is paused, sent through an alternative path, or held, and tell the business which classes of mail are affected.

Containment by priority

  1. Freeze and capture. Export gateway policy, bypass lists, routing, admin roles and audit logs before anyone changes them, and forward a copy to storage the gateway admins cannot alter.
  2. Lock admin access. Disable every gateway admin account except a named response group, reset the built-in or local administrator, revoke API keys and sessions, and remove admin role mappings from directory groups until reviewed.
  3. Cut copy paths. Remove unknown journaling, blind copy and outbound routes on the gateway, and unknown transport rules and connectors on the mail platform. This stops ongoing collection even before keys are replaced.
  4. Restore enforcement. Reinstate the last approved encryption policy and remove bypass entries that lack an owner and approval, so outbound mail is not leaving in clear during the response.
  5. Disable integration credentials. Suspend the directory bind account, the CA enrolment credential, archive and journaling accounts and automation clients, then issue new ones only to the rebuilt gateway.
  6. Isolate a compromised platform. Where code execution occurred, take a self-hosted gateway off the network apart from a forensic path and route mail through a standby or the mail platform's own encryption feature.

Rollback: keep the captured configuration so that a containment step that breaks a legitimate business flow can be reversed deliberately, with a record of who approved it.

Key and certificate revocation

Revocation tells relying parties to stop trusting a key from now on. It does not make previously encrypted mail safe. Work through the keys in this order.

Key or credentialActionStandard or note
Gateway-held S/MIME certificates for users and the domainAsk the issuing CA to revoke with reason keyCompromise; issue new certificates on new key pairsRFC 5280 defines keyCompromise among the CRL revocation reasons
OpenPGP keys held by the gatewayPublish a key revocation signature with reason code 2, key material has been compromised; generate and distribute new keysRFC 9580: if a key is compromised, all signatures it created are suspect
Domain keys for gateway to gateway encryptionRevoke, generate new keys, send new public keys to each partner through an authenticated channelPartners must remove the old key from their trust stores
Signing keysRevoke and reissue; tell partners the window in which signatures should be distrustedSigning keys should not be escrowed; there is nothing to recover
TLS certificates on the gateway and connectorsRevoke and reissue with new keys; update mail platform connectors to trust only the new certificateSee the Encryption Key Compromise Playbook
CA enrolment credentialRevoke the credential, list every certificate it issued in the window and revoke any not requestedSee If your internal PKI and certificate authority is compromised
Directory, archive and API credentialsRotate, narrow scope, restrict to the rebuilt gatewayNIST SP 800-53 IA-5 authenticator management

Non-exportable keys: where the HSM or key service logs show the keys never left it, you may decide to keep them after the attacker's access is removed. That is a risk decision: the attacker could still have used the keys to decrypt captured mail during the window. Most organisations re-key anyway, because the cost of new certificates is small compared with the doubt.

Escrow before rebuild: recover escrowed encryption keys under the agreed split custody into a clean key store first. Without them, archived mail encrypted to the old keys cannot be read after the rebuild. The Cryptographic Key Management Guide covers custody models.

Scoping the past exposure

  • Keys copied: treat every message encrypted to those keys as potentially readable by the attacker, including archives, backups and anything captured in transit. Identify which mailboxes, partners and data classes that covers.
  • Policy or routing tampering: use message trace for the window to list messages that matched altered rules or new routes, and record their recipients and classification. See the Email Gateway and Message Trace Detection Guide.
  • Portal: list messages held and downloaded during the window, and which recipient accounts were accessed from unusual locations.
  • Plaintext stores: check quarantine, journaling targets and any decryption scanning output, which hold readable copies regardless of key status.
  • Signatures: ask partners to report signed mail from your domain received during the window, so forged instructions, such as payment changes, can be caught.

Eradication and rebuild

  1. Build a fresh gateway on a current release from vendor media, not from a full configuration backup taken during the window.
  2. Create the key store first. Generate new keys non-exportable in an HSM or key service where supported, and import recovered escrow keys only for decrypting archived mail, never for new encryption.
  3. Re-create policy from a reviewed baseline, entry by entry, with an owner and expiry on every bypass rule.
  4. Split admin roles for platform, key, policy, review and audit before returning access to anyone. NIST SP 800-53 AC-5 is the reference.
  5. Reconnect integrations with new credentials: certificate based connectors to the mail platform, a read only directory account and an enrolment profile limited to email protection certificates.
  6. Clean the mail platform of rules, connectors and application consents created in the window.

Recovery and partner coordination

  1. Pilot outbound encryption with one internal domain and one partner, confirming that messages encrypt with the new keys and decrypt correctly.
  2. Distribute new public keys to every gateway to gateway partner, with a contact who confirms the old key has been removed from their configuration.
  3. Re-enrol users whose S/MIME certificates were gateway-held, and publish the new certificates to the directory used for recipient lookup.
  4. Test archive access by decrypting a sample of archived mail with the recovered escrow keys.
  5. Restore the portal with new admin credentials, forced re-verification of recipient accounts and message expiry applied to items held during the window.
  6. Widen in rings until all mail flows through the new gateway, then retire the standby path.

Evidence and notification

  • Preserve: the isolated gateway or its disk image, HSM and key service logs, gateway and mail platform audit logs, policy and routing exports, portal access logs, CA issuance records and message trace for the window.
  • GDPR Article 33: the controller notifies the supervisory authority without undue delay and, where feasible, not later than 72 hours after becoming aware, unless the breach is unlikely to result in a risk to individuals.
  • GDPR Article 34(3)(a): notifying individuals is not required where measures such as encryption made the data unintelligible to unauthorised people. That protection is lost when the attacker holds the decryption key, so do not rely on it for messages encrypted to a copied key.
  • Other regimes: sector and national reporting rules may apply. See the Data Breach Notification Checklist and the Cyber Incident Reporting Requirements Map.
  • Partners and vendor: tell correspondents which keys were revoked and why, and open a case with the gateway vendor, keeping case numbers and indicators of compromise.

Decision guidance

SituationChooseTrade-off
Root or code execution on a gateway with software-held keysRevoke all keys, rebuild, treat archives as exposedPartner disruption and notification work, but no lingering doubt
Admin console misuse, keys non-exportable in an HSMReset admin access, roll back policy, re-key at the next opportunityFaster recovery; depends on complete HSM usage logs
Only policy or routing changedRoll back, trace affected messages, rotate admin and connector credentialsKeys stay valid; notification depends on what was sent in clear
Vendor-side incident in a cloud encryption serviceFollow the vendor's scope statement, re-key where it cannot rule out key accessContinuity versus trust in the provider's investigation
Small organisation without a standby gatewayPause outbound encryption of the most sensitive classes and use the mail platform's built-in message encryption temporarilyDifferent user experience for recipients for a period

Detection and measurement

  • Time to revoke: hours from declaration to revocation of every key presumed copied.
  • Keys in hardware: percentage of gateway private keys held non-exportable; the higher this is, the smaller the next incident.
  • Partner re-key coverage: partners confirmed on the new keys, out of all gateway to gateway partners.
  • Bypass hygiene: bypass rules with an owner and expiry, out of all bypass rules; target 100%.
  • Escrow recovery test: date of the last successful recovery and archive decryption test.

Alert on key export attempts, escrow recovery, bypass and routing changes on both the gateway and the mail platform, and portal bulk downloads, in a SIEM the gateway admins cannot alter. See the SIEM Guide.

Framework mapping

FrameworkReferenceWhere it applies
NIST CSF 2.0RS.MA-01, RS.AN-03, RS.MI-01, RS.MI-02, RS.CO-02, RC.RP-05Coordinated response, analysis, containment, eradication, notification, verified restore
NIST SP 800-53 Rev. 5IR-4, IR-6, IA-5, SC-12, SC-17, AC-5, CM-3, AU-9Incident handling and reporting, authenticators, key management, certificates, separation of duties, change control, protected logs
NIST SP 800-57 Part 1 Rev. 5Key management recommendationKey purposes, custody and cryptoperiods for re-keying
CIS Controls v8.1Control 3, Control 9, Control 17Data protection, email protections, incident response
ISO/IEC 27001:2022 Annex A5.14, 5.24 to 5.28, 8.24Information transfer, incident management and evidence, use of cryptography
MITRE ATT&CKT1114.002, T1649, T1557, T1098, T1685Mail collection, certificate theft, rerouting, account manipulation, policy disablement

Common failure patterns

  • Revoking and calling it contained. Revocation does nothing for archived or captured mail encrypted to a copied key; the exposure assessment still has to happen.
  • Rebuilding before recovering escrow. The new gateway cannot read years of archived mail, and legal hold obligations fail.
  • Fixing the gateway but not the mail platform. A transport rule that routes around the gateway keeps sending mail in clear after the rebuild.
  • Forgetting the enrolment credential. The attacker keeps the ability to obtain trusted email certificates for your addresses from your own CA.
  • Not telling partners. Correspondents keep encrypting to the revoked key, so their new mail is readable by the attacker until they update.
  • Restoring a backup from the window. The attacker's bypass rules and admin roles return with it.

Practitioner checklist

  • Record, for every gateway key, whether it is non-exportable and where it is escrowed.
  • Capture policy, routing, roles and logs before changing anything.
  • Lock admin access and remove unknown copy paths on gateway and mail platform.
  • Revoke presumed-copied keys with a key compromise reason and issue new ones.
  • Revoke the CA enrolment credential and any certificates it issued without a request.
  • Recover escrowed keys under split custody before rebuilding.
  • Scope past exposure for archives, captured mail, portal and plaintext stores.
  • Distribute new public keys to partners and confirm the old ones are removed.
  • Assess GDPR Article 33 and 34 duties, without relying on encryption for messages under a copied key.
  • Test archive decryption and partner encryption before widening the new gateway.

Standards and references

Related NHI Mgmt Group resources: OpenPGP and S/MIME Email Encryption Guide · Email Encryption · If your certificate lifecycle manager is compromised · Service Account Security Guide

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 14 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org