Other Articles
- IAM - Enable User MFA
- IAM - Enforce Key Rotation
- IAM - Enforce Active Key Limit
- IAM - Disable Unused User Credentials
- IAM - Enforce Group Permission
- IAM - Enforce Password Length
- IAM - Prohibit Password Reuse
- IAM - Check Root Access Keys Existence
- IAM - Enable Root MFA
- IAM - Establish Support Role
- IAM - Enable Key Rotation
- Purge Expired Certificates
- EC2 Volume – Enable EBS Volume Backup
- EC2 Volume – Enable EBS Encryption
- EFS – Enable EFS Storage Backup
- S3 Bucket – Enable S3 Bucket Versioning
- S3 Bucket – Enable S3 Bucket Encryption
- S3 Bucket – Block S3 Bucket Public Access
- RDS DB Instance – Encryption of Storage
- RDS DB Instance – Enable Deletion Protection
- RDS DB Instance – Enable Auto Minor Version Upgrade
- DynamoDB Table – Enable Table Encryption
- DynamoDB Table – Enable Table Point In Time Recovery
- DynamoDB Table – Enable Table Deletion Protection
- EKS Cluster – Enable Secrets Encryption
- OpenSearch Domain – Enable Encryption at Rest
- RDS DB Cluster – Retain Backups for 7 Days
- RDS DB Cluster – Encryption of Storage
- RDS DB Cluster – Enable Deletion Protection
- EC2 Instance – Monitor CPU Utilization
- ECS Service – Monitor CPU Utilization
- ECS Service – Monitor Memory Utilization
- RDS DB Instance – Monitor Free Storage Space
- RDS DB Instance – Monitor CPU Utilization
- SQS Queue – Monitor Message Age
- SQS Queue – Monitor Message Visibility
- DynamoDB Table – Monitor Table Read Capacity
- DynamoDB Table – Monitor Table Write Capacity
- DynamoDB Table – Monitor Table Latency
- Enable CloudTrail
- Encrypt CloudTrail Logs
- EC2 VPC – Ensure Flow Logs are Enabled
- EKS Cluster – Enable Control Plane Logging
- CloudWatch Log Group – Enable KMS Encryption
- CloudWatch Log Group – Configure Retention
- Load Balancer – Enable Access Logs
- RDS DB Instance – Block Public Access
- EC2 Security Group – Restrict Public SSH and RDP Access
- EC2 Security Group – Restrict Public Database Access
- EKS Cluster – Restrict Public Endpoint
- EC2 VPC – Restrict Default Security Group Traffic
- Load Balancer – Redirect HTTP Traffic to HTTPS
- Load Balancer – Use Strong TLS Policies
- OpenSearch Domain – Enable Node-to-Node Encryption
- OpenSearch Domain – Enforce HTTPS
- OpenSearch Domain – Restrict Public Access
- RDS DB Cluster – Block Public Access
- EC2 Instance – Enable Deletion Protection
- ECS Service – Enable Auto Scaling
- Load Balancer – Enable Deletion Protection
- Enable AWS Security Hub
- Enable GuardDuty
- CloudFront Distribution – Enforce HTTPS for Viewers
- CloudFront Distribution – Require TLS 1.2 for Viewers
- CloudFront Distribution – Associate a WAF Web ACL
- CloudFront Distribution – Protect S3 Origin Access
- SNS Topic – Enable Encryption
- SNS Topic – Restrict Topic Policy Access
KMS Key – Avoid Pending Deletion
Secure Configuration Checks > AWS
This check flags customer-managed AWS KMS keys that are pending deletion or pending replica deletion, so that you can review them before the deletion completes. Deleting a KMS key cannot be undone. Everything that was encrypted with the key becomes unreadable for good.
Check Details
- Resource: KMS Key (customer-managed)
- Check: Avoid KMS key pending deletion (
NoPendingDeletion) - Risk: Data, backups, volumes, secrets and logs that use the key are lost for good once the deletion completes
Key states covered
- Pending deletion (
PendingDeletion): The key is scheduled for deletion. It cannot be used and is deleted when the waiting period of 7 to 30 days ends. - Pending replica deletion (
PendingReplicaDeletion): The key is a multi-Region primary key that is scheduled for deletion, but it still has replica keys. The waiting period starts after the last replica is deleted.
Remediation via AWS Console
-
Log in to the AWS Management Console and open the AWS Key Management Service (KMS) console.
-
In the left navigation pane, click Customer managed keys. Look for keys with the status Pending deletion or Pending replica deletion.
- Select the key and review its details, aliases and the deletion date.
- Click Key actions and then Cancel key deletion. Confirm the action.
- The key is now Disabled. Click Key actions and then Enable if the key must be used again.
- Repeat steps 3 to 5 for every key that you want to keep. Leave a key as it is only if you have confirmed that it is no longer needed.
Remediation via AWS CLI
-
Log in to the AWS Management Console and click the CloudShell icon (
>_) in the top-right corner.
-
List the customer-managed keys that are pending deletion. The output shows the key ID, the state, the deletion date and the description:
for k in $(aws kms list-keys --query 'Keys[].KeyId' --output text); do aws kms describe-key --key-id "$k" --output json | \ jq -r '.KeyMetadata | select(.KeyManager == "CUSTOMER" and (.KeyState == "PendingDeletion" or .KeyState == "PendingReplicaDeletion")) | [.KeyId, .KeyState, (.DeletionDate // "n/a"), (.Description // "")] | @tsv' doneThe command covers one region. Add
--region <region>to eachawscommand to check another. -
Check the aliases and grants of the key to see what still depends on it:
aws kms list-aliases --key-id <key-id> aws kms list-grants --key-id <key-id>
-
Cancel the deletion of a key that you want to keep:
aws kms cancel-key-deletion --key-id <key-id>
The key is now disabled. Enable it again so that it can be used:
aws kms enable-key --key-id <key-id>
-
Verify the state of the key:
aws kms describe-key \ --key-id <key-id> \ --query 'KeyMetadata.[KeyId,KeyState,Enabled]' \ --output text
The state must be
Enabled, notPendingDeletionorPendingReplicaDeletion.
Replace <key-id> with the ID of the key, for example 1234abcd-12ab-34cd-56ef-1234567890ab.
Repeat steps 3 to 5 for each key that you want to keep.
Updated on 04 November, 2026