Join our Newsletter — 33% off our NHI Course
Home› Guides› If your cloud key management service (KMS) is…
Guide Data Security

If your cloud key management service (KMS) is compromised: contain admin abuse and restore key trust

PDF for newsletter subscribers · free to read online

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

An attacker who reaches the administrative plane of your cloud key management service can rewrite who may decrypt your data, schedule your keys for deletion or quietly add their own account as a key user, without ever touching key material. That is a different incident from a leaked key. The key may be intact, but the policies, grants and administrative roles that decide how it is used can no longer be trusted, and every storage service, database, backup and secrets manager that relies on the KMS inherits that doubt. This guide is a vendor-neutral response playbook for KMS control-plane compromise: key policy tampering, grant abuse, scheduled key deletion and cross-account access. It covers how the incident shows up, triage, containment without causing an outage, rebuilding trusted policy, recovery, evidence and notification. It is for cloud incident responders, platform and cryptography engineers and data owners. When raw key material itself has been exposed, switch to the Encryption Key Compromise Playbook for re-keying and re-encryption, and use Securing the cloud key management service (KMS) itself for the preventive controls this page assumes.

Key takeaways

  • Cancel destruction first. A key in its deletion waiting period can usually be restored; once destroyed, data encrypted under it is gone. Check every key's state in the first hour.
  • Control-plane compromise is a policy problem before it is a key problem. If the material never left the service, fixing policies, grants and administrative identities usually contains the incident without re-encrypting data.
  • Grants and cross-account statements are the persistence. Removing the attacker's administrator role does nothing about a grant or an external principal they added to fifty key policies.
  • Rebuild from code, not from the console. Restore key policies from a version-controlled known-good baseline and diff everything else against it.
  • Usage logs decide the data impact. Decrypt and data-key calls by attacker-added principals show which data was readable, and that drives notification.

How a KMS control-plane compromise differs

NIST SP 800-57 Part 1 Rev. 5 describes key states from pre-activation to destroyed, including a compromised state. In a control-plane incident the key usually stays in its normal state while the rules around it change. The table separates the scenarios so the response matches what the attacker actually reached.

ScenarioAttacker canMaterial exposed?Response track
Key policy tamperingAdd their own principal as key user or administrator, remove your administrators, widen conditionsNo, unless export is permittedThis playbook: restore policy, review usage under the tampered policy
Grant abuseCreate delegated permissions that let a principal decrypt or generate data keys, often without a visible policy changeNoThis playbook: inventory and retire grants, review grantee usage
Scheduled deletion or disablingMake data unreadable at the end of the waiting period (T1485 Data Destruction)NoThis playbook: cancel deletion, re-enable, lock down deletion rights
Cross-account accessLet an external account use your key, then copy encrypted snapshots or objects and decrypt them there (T1537 Transfer Data to Cloud Account)No, but data may beThis playbook plus data breach assessment
Attacker-controlled keyCreate a key with a policy they own, re-encrypt your data under it, then withhold it (T1486 Data Encrypted for Impact)Your keys unaffectedThis playbook plus the Cloud Ransomware Response Playbook
Raw key material exported or leakedDecrypt offline, indefinitelyYesSwitch to the Encryption Key Compromise Playbook

The entry point is almost always an identity: a cloud administrator, an automation role that deploys key policy, or a pipeline credential. Adding a principal to a key policy or creating a grant is a form of T1098 Account Manipulation, and the access often begins with T1078.004 Cloud Accounts. Treat the KMS response and the identity response as one incident; see the Cloud Credential Compromise Playbook.

Triggers and triage

Invoke this playbook for: a key policy change with no change record; a grant created for a principal you do not recognise; any disable or schedule-deletion call outside a planned decommission; a key used by a principal in an account outside your organisation; a burst of new keys created by an administrator identity; key rotation or KMS logging turned off; or a cloud credential compromise where the identity held key administration rights.

  1. Check key state across every account and region: list keys that are disabled, pending deletion or whose imported material is due to expire. This is the only step that cannot wait for evidence collection, because the waiting period is running.
  2. Preserve evidence: export KMS audit records for management and cryptographic operations, cloud identity logs for every principal that touched key policy, and organisation-level policy change history, to storage outside the affected account.
  3. Snapshot current state as found: every key policy, grant, alias, rotation setting and key tag, plus the administrative role membership that governs the KMS. You will diff this against the baseline.
  4. Identify the actor's capability: which identity was used, whether it could change policy, create grants, schedule deletion, import material or only use keys, and in which accounts.
  5. Set the window: from the earliest possible access to now, extended back to the last time key policies matched the version-controlled baseline.
  6. Classify: critical if any key protecting production, backup or regulated data was pending deletion, shared cross-account or granted to an unknown principal; high if policy changed but no unknown principal used a key.

Decision: the incident commander confirms which track applies, with the key custodian, and whether raw material may have been exported. Export or import permissions on an affected key move the incident onto the key compromise track as well.

Containment by priority

PriorityActionWhy this order
1. Within the first hourCancel every scheduled deletion and re-enable keys disabled without approval, after confirming no legitimate decommission is in progressDestruction is irreversible; NSA and CISA note data encrypted under a destroyed key can no longer be decrypted
2Revoke sessions and disable the compromised administrative and automation identities; suspend the pipeline that deploys key policy until it is checkedStops further changes, including re-scheduling deletion
3Apply an organisation-level deny on key deletion, disabling, policy change, grant creation and material import, except for named responder rolesA guardrail above the account survives a missed backdoor in individual key policies
4Remove unknown principals and external accounts from key policies and retire unknown grantsCloses the decrypt path the attacker built
5Block sharing of encrypted snapshots and backups to outside accounts while you reviewStops data leaving under a key the attacker can still use elsewhere
6Rotate credentials of every identity that held key administration rights, not only the one known to be compromisedAssume the attacker enumerated who else could administer keys
  • Do not disable keys to contain a policy problem: disabling a key encryption key stops every service from unwrapping its data keys, which is an outage you cause yourself. If the material was not exported, removing the attacker's access in policy and grants contains the threat with no downtime.
  • Use a break-glass path that does not depend on the compromised identities: if the attacker removed your administrators from key policies, recovery may need the account's top-level identity or a provider support route. See the Break-Glass Account Guide.
  • Keep evidence keys alive: the NSA and CISA key management guidance warns that keys needed to decrypt forensic evidence must be preserved. Do not destroy any key during the incident.

Rebuilding trusted key policy

Containment removes what you have found. Rebuilding proves nothing else remains. Work from a known-good baseline, ideally policies held as code, and treat the live console as evidence rather than as the source of truth.

  1. Diff policies: compare every key policy against the baseline. Look for added principals, wildcard actions, removed conditions (such as encryption context or calling-service conditions), new external accounts and changes to who may administer the key.
  2. Inventory grants: list every grant on every key, with grantee, operations and creation time. Retire any grant created in the window that does not map to a known service. Grants do not always appear in policy reviews, so review them separately.
  3. Review aliases and default keys: an alias repointed to an attacker-controlled key causes applications to encrypt new data under that key. Confirm each alias points to the expected key ID.
  4. Find attacker-created keys: list keys created in the window, their policies and whether anything was encrypted under them. Keys whose policy names principals outside your organisation are the priority.
  5. Check rotation, logging and expiry: confirm automatic rotation, data-plane audit logging and imported material expiry dates match the baseline.
  6. Restore from code: redeploy key policies through a pipeline you have verified, with a second approver. The NSA and CISA guidance favours policies that default to deny and name each operation a role needs; take the opportunity to remove broad action categories.
  7. Check organisation guardrails: an attacker with organisation administrator rights may have relaxed the policies that blocked external grants or deletion. Restore them.

Assessing data impact

Decrypt, re-encrypt and generate-data-key records tell you what an attacker-added principal could read. The OWASP Key Management Cheat Sheet expects a key management system to record who used a key and when, and periodic audits to treat unusual events as possible attack indicators.

QuestionEvidenceIf yes
Did an attacker-added principal call decrypt or generate a data key?KMS cryptographic operation records filtered by that principalMap key to data store; treat data accessible in that window as potentially read
Were encrypted snapshots, backups or objects copied or shared outside?Storage and backup audit logs; snapshot sharing changesAssume the external party can decrypt while their access lasted; data breach assessment
Was data re-encrypted under an unknown key?Encryption calls under attacker-created keys; storage default key changesCloud ransomware track; recover from backups encrypted under your keys
Could material be exported?Key origin and policy: export or wrap permissions, imported materialKey compromise track: new key, re-encryption

Data-plane logging may be off, sampled or retained for a short period. If records for the window are missing, state that the impact cannot be bounded and treat all data under the affected keys as potentially accessed. NSA and CISA recommend periodically auditing where, how and by whom keys are used; that baseline is what makes this step possible.

Recovery and return to service

  1. Restore administrative trust: rebuild the key administrator and break-glass roles with new credentials, phishing-resistant MFA and just-in-time elevation. See the Tiered Administration and Enterprise Access Model Guide.
  2. Re-enable the policy pipeline only after its credentials, runners and repository history have been checked for tampering.
  3. Lift the emergency deny in stages: grant creation for named services first, then policy changes through the pipeline, and leave deletion behind two-person approval permanently.
  4. Retire attacker-created keys safely: disable them and watch for failed calls, which reveal anything still depending on them, before scheduling deletion with the longest waiting period. Confirm no data you need is encrypted only under those keys.
  5. Verify backups: restore a sample of backups taken before and after the window and confirm they decrypt under your own keys, as NIST CSF 2.0 RC.RP-03 asks.
  6. Roll back if a service breaks: re-grant only the specific operation and key the service reports as missing, through the pipeline. Never restore a wildcard or an unknown grant to restore service.

Material that never left the service does not need rotating. If you rotate anyway as a precaution, remember that rotation which keeps old versions for decryption does not remove access already granted; the policy and grant clean-up does that.

Evidence and notification

  • Evidence to preserve: KMS management and cryptographic audit records, key policy and grant snapshots as found, organisation policy history, cloud identity sign-in and role assumption logs, pipeline run history and storage sharing logs, all exported with hashes to write-once storage under a separate account.
  • Personal data: GDPR Article 33(1) requires the controller to notify the supervisory authority without undue delay and, where feasible, not later than 72 hours after becoming aware of a personal data breach, unless it is unlikely to result in a risk. Article 34(3)(a) relieves the duty to tell individuals when data was rendered unintelligible, such as by encryption. That relief is weak if an attacker held decrypt rights on the key: assess it explicitly. Use the Data Breach Notification Checklist for other regimes.
  • Cloud provider: open a support case early if you cannot regain administrative control of a key or need help preserving logs.
  • Internal: brief data owners for every affected key, and record decisions on disable, restore and destruction with who decided and on what evidence.

Scaling the response to your estate

Small estates with a single account and a handful of customer-managed keys can run triage by hand in hours: list keys, compare policies with the last known configuration and review grants manually. The priority is cancelling deletion and removing unknown principals. Large estates with hundreds of accounts need the inventory and baseline in place before an incident: an organisation-wide query that returns key state, policy hash and grant count per key, an emergency deny policy ready to attach, and a pipeline that can redeploy every key policy from code. Multi-region and multi-account keys add a step: confirm replicas and every account that shares a key have the same clean policy. Where keys are held externally, include the external key manager's own administration logs in scope; see the BYOK, HYOK and External Key Management Guide.

Detection and measurement

  • Alerts that should fire: any disable or schedule-deletion call; key policy change not made by the pipeline identity; grant created for a principal outside an allow list; key use from an account outside the organisation; alias changes; rotation or logging disabled (T1685 Disable or Modify Tools). Route deletion alerts to a channel that does not depend on the same cloud account.
  • Drift detection: a scheduled comparison of live key policy hashes against the code baseline.

Metrics that show readiness and response quality:

  • Time from a schedule-deletion call to alert and to cancellation, measured in drills.
  • Percentage of key policies deployed from code and matching the baseline.
  • Number of grants with no named owning service (target: zero).
  • Percentage of keys with data-plane logging retained for the full investigation window.
  • Time to produce a full key, policy and grant inventory across all accounts.

Common failure patterns

  • Waiting for forensics before checking key state: the deletion window expires while evidence is collected, and data is lost permanently.
  • Disabling keys as a reflex: production outages follow, with no security gain when the material was never exposed.
  • Fixing policies but not grants: the attacker's delegated permission survives the clean-up and keeps decrypt access.
  • Restoring from the console: responders edit policies by hand from memory, reintroducing old wildcards or missing the attacker's subtle condition change.
  • Cleaning the key, not the identity: the automation role that deployed the tampered policy keeps its rights and the change returns at the next pipeline run.
  • Keys and ciphertext reachable together: the same administrative identity can both share encrypted backups to another account and add that account to the backup key policy. Keep backup keys under a different administrative team so one compromised identity cannot reach both.

Framework mapping

Response areaNIST SP 800-53 Rev. 5NIST CSF 2.0ATT&CK
Key management and availabilitySC-12, SC-12(1)PR.DS-01T1485, T1486
Administrative separationAC-5, AC-6(5)PR.AA-05T1098, T1078.004
Audit protection and reviewAU-6, AU-9(2)DE.AE-02, RS.AN-03T1685
Containment and eradicationIR-4RS.MI-01, RS.MI-02T1537
Recovery and backupsCP-9, CP-10RC.RP-01, RC.RP-03T1490
ReportingIR-6RS.CO-02All of the above, as evidence

ISO/IEC 27001:2022 Annex A control 8.24 Use of cryptography covers key management as a whole. NIST SP 800-61 Rev. 3 places incident response within CSF 2.0, which is why the mapping uses the Respond and Recover functions.

Practitioner checklist

  • Check every key for disabled, pending deletion and expiring material status in the first hour, and cancel unauthorised deletions.
  • Export KMS, identity and organisation policy logs to write-once storage in a separate account before changing anything else.
  • Disable compromised administrative and automation identities and suspend the key policy pipeline.
  • Attach an organisation-level deny on deletion, disabling, policy change, grant creation and import, except for named responders.
  • Remove unknown and external principals from key policies, retire unknown grants and check every alias.
  • Rebuild key policies from a verified code baseline with two-person approval.
  • Map decrypt and data-key calls by attacker-added principals to data stores and run the breach assessment.
  • Retire attacker-created keys by disabling first and deleting only after a watch period.
  • Restore sample backups under your own keys before closing the incident.
  • Drill the deletion-cancellation and emergency deny steps at least once a year.

Standards and references

Related NHI Mgmt Group resources: Encryption Key Compromise Playbook · Securing the cloud key management service (KMS) itself · AWS KMS Security Guide · Cloud key management service (KMS) health check

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

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

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.