Cloud KMS Key Not Rotated
Your KMS encryption keys don't have automatic rotation enabled, meaning the same key material is used indefinitely — increasing the risk if the key is ever compromised.
How It Works
KMS keys encrypt your most sensitive data at rest. If a key is compromised (via insider threat, misconfigured IAM policy, or key material export), all data encrypted with that key is at risk. Key rotation limits exposure: even if an old key is compromised, only data encrypted in that rotation window is at risk. AWS KMS supports automatic annual rotation at no extra cost.
// BAD: KMS key without automatic rotation (Terraform)
resource "aws_kms_key" "app_key" {
description = "App encryption key"
enable_key_rotation = false // key never rotates — risky
deletion_window_in_days = 30
}// GOOD: enable automatic annual key rotation
resource "aws_kms_key" "app_key" {
description = "App encryption key"
enable_key_rotation = true // AWS rotates the key material annually
deletion_window_in_days = 30
}Real-World Example
While there are no major public breaches attributed solely to KMS key non-rotation, PCI-DSS, HIPAA, and SOC 2 auditors regularly flag non-rotated encryption keys as a compliance finding. It's a low-effort configuration that satisfies multiple regulatory requirements at once.
How to Prevent It
- Enable enable_key_rotation: true on all AWS KMS customer-managed keys — it's free and automatic
- For GCP Cloud KMS, set rotationPeriod in your key ring configuration
- Use AWS Config rule cmk-backing-key-rotation-enabled to detect non-rotating keys
- Document key rotation policies as part of your security runbook
- For imported key material, manually rotate according to your key management policy
Affected Technologies
Data Hogo detects this vulnerability automatically.
Scan Your Repo FreeRelated Vulnerabilities
S3 Bucket Public Access
criticalYour S3 bucket is publicly readable due to a public ACL, disabled Block Public Access settings, or a wildcard bucket policy — anyone on the internet can list and download your files.
Cloud Metadata SSRF
criticalYour app fetches user-supplied URLs without blocking cloud metadata endpoints like 169.254.169.254, letting attackers steal your cloud credentials via SSRF.
AWS Credentials Hardcoded
criticalAWS access keys (starting with AKIA) or secret access keys are hardcoded in your source code, giving anyone who reads the code full access to your AWS account.
IAM Overly Permissive Policy
highYour IAM policy uses Action: '*' or Resource: '*', granting far more permissions than needed and turning any credential leak into a full account takeover.