- Newest
- Most votes
- Most comments
Your understanding is correct. If the KMS key policy contains an explicit Deny for kms:PutKeyPolicy and kms:ScheduleKeyDeletion that applies to all principals, adding IAM permissions or using the root user won't override it.
KMS permissions are evaluated with the key policy, IAM policies, grants, etc., and an explicit deny takes precedence. AWS also notes that KMS keys can become unmanageable if the key policy no longer leaves any principal with permission to update it.
In this situation, there isn't an IAM or CLI workaround you can apply from the account. AWS documentation specifically says that when a KMS key becomes unmanageable, you must contact AWS Support to regain access.
So I would keep the existing Support case and ask specifically for escalation to the AWS KMS service team for key-policy lockout recovery. Include:
- Key ARN(s) and Region(s)
- The relevant
Denystatement - The exact
AccessDeniedException - Confirmation that you're the account owner/root user
- That the keys are unused test resources and are continuing to generate cost
I wouldn't post the Support case ID publicly on re:Post. Provide it only through an AWS Support/private channel if an AWS employee asks for it.
For future keys, avoid an unconditional deny on kms:PutKeyPolicy. KMS has a policy-lockout safety mechanism specifically to reduce the chance of creating an unmanageable key.
Hi,
I'm so sorry for the concern this has caused. While we're unable to action your case, we have shared your requests with our teams. Keep an eye on your case for updates.
- Sage A.
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 3 years ago
