terraform.aws.security.aws-timestream-database-encrypted-with-cmk.aws-timestream-database-encrypted-with-cmk
semgrep
Author
unknown
Download Count*
License
Ensure Timestream database is encrypted at rest using KMS CMKs. CMKs gives you control over the encryption key in terms of access and rotation.
Run Locally
Run in CI
Defintion
rules:
- id: aws-timestream-database-encrypted-with-cmk
patterns:
- pattern: |
resource "aws_timestreamwrite_database" $ANYTHING {
...
}
- pattern-not-inside: |
resource "aws_timestreamwrite_database" $ANYTHING {
...
kms_key_id = ...
...
}
message: Ensure Timestream database is encrypted at rest using KMS CMKs. CMKs
gives you control over the encryption key in terms of access and rotation.
metadata:
category: security
technology:
- terraform
- aws
owasp:
- A03:2017 - Sensitive Data Exposure
cwe:
- "CWE-320: CWE CATEGORY: Key Management Errors"
references:
- https://owasp.org/Top10/A02_2021-Cryptographic_Failures
subcategory:
- audit
likelihood: LOW
impact: LOW
confidence: LOW
license: Commons Clause License Condition v1.0[LGPL-2.1-only]
vulnerability_class:
- Cryptographic Issues
languages:
- hcl
severity: WARNING
Examples
aws-timestream-database-encrypted-with-cmk.tf
# pass
resource "aws_timestreamwrite_database" "enabled" {
database_name = "timestream"
kms_key_id = var.kms_key_id
}
# failure
# ruleid: aws-timestream-database-encrypted-with-cmk
resource "aws_timestreamwrite_database" "default" {
database_name = "timestream"
}
Short Link: https://sg.run/7nyZ