How to Prevent AWS KMS Key Deletion Using Key Policies
A gaming company uses Amazon Redshift for analytics. The Redshift cluster stores user data that must be encrypted at rest using a customer-managed KMS key. The company has enabled audit logging using AWS CloudTrail. The security team wants to ensure that any attempt to disable or delete the KMS key is immediately detected and triggers an automated response. They have set up a CloudWatch Events rule that triggers an SNS notification when the KMS key is scheduled for deletion. However, they also want to prevent the key from being deleted accidentally. What should they do?
Quick Answer
The answer is to add a statement to the KMS key policy that denies the `kms:ScheduleKeyDeletion` action for all principals except the root user. This works because KMS key policies are the authoritative access control mechanism for a customer-managed key; a resource-based policy can explicitly deny an action, overriding any allow from an IAM policy or other principal, thereby preventing accidental or unauthorized deletion. On the AWS Certified Data Engineer Associate DEA-C01 exam, this question tests your understanding of the hierarchy of AWS access controls—specifically that key policies take precedence over IAM policies for KMS operations. A common trap is confusing detection (CloudTrail or CloudWatch Events) with prevention, or assuming key rotation blocks deletion. Memory tip: think of the key policy as the "last line of defense" for the key itself—deny the delete action at the resource level, not just the identity level.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Add a statement to the KMS key policy that denies 'kms:ScheduleKeyDeletion' for all principals except the root user.
Adding a statement to the KMS key policy that denies 'kms:ScheduleKeyDeletion' for all principals except the root user explicitly prevents any user (including IAM users with full admin permissions) from scheduling deletion of the key. This is the most direct and authoritative control to prevent accidental deletion. Option A is incorrect because automatic key rotation does not prevent the key from being deleted; it only changes the backing key material. Option C is incorrect because an IAM policy attached to the Redshift cluster role does not affect permissions on the KMS key; the key policy is the authoritative control for actions on a customer-managed key. Option D is incorrect because CloudTrail monitoring only detects deletion events but does not prevent the deletion itself.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Enable automatic key rotation for the KMS key to ensure that even if the key is deleted, the data remains encrypted.
Why it's wrong here
Key rotation does not prevent deletion.
- ✓
Add a statement to the KMS key policy that denies 'kms:ScheduleKeyDeletion' for all principals except the root user.
Why this is correct
This prevents any IAM user or role from scheduling key deletion.
- ✗
Attach an IAM policy to the Redshift cluster role that denies 'kms:ScheduleKeyDeletion'.
Why it's wrong here
The key policy controls access to the key; an IAM policy alone may not be sufficient if the key policy allows deletion.
- ✗
Set up a CloudTrail trail to monitor for 'ScheduleKeyDeletion' events and send an alert to the security team.
Why it's wrong here
This detects deletion but does not prevent it.
Go deeper
Related to this question
About these practice questions
One of 1,711 original DEA-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on DEA-C01
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A data engineer receives an alert that an AWS KMS key has been scheduled for deletion by mistake. What is the immediate action to prevent the key from being deleted?
easy- ✓ A.Cancel the key deletion from the KMS console or API.
- B.Create a new KMS key and re-encrypt the data.
- C.Wait for the key to be deleted and restore it from backup.
- D.Disable the key immediately to stop usage.
Why A: When a KMS key is scheduled for deletion, the deletion can be canceled from the AWS KMS console or via the CancelKeyDeletion API during the pending deletion period. This immediate action restores the key to its previous state and prevents it from being deleted. Option B is incorrect because creating a new key does not cancel the deletion of the existing key. Option C is incorrect because deleted KMS keys cannot be restored; the default waiting period of 7–30 days exists specifically to allow cancellation. Option D is incorrect because disabling the key does not affect the deletion schedule.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DEA-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DEA-C01 exam.