Skip to content

Secrets Manager secrets should be encrypted using CMK

Ensure that all secrets in AWS Secrets Manager are encrypted using the AWS managed key (aws/secretsmanager) or a customer managed key that was created in AWS Key Management Service (AWS KMS). The rule is compliant if a secret is encrypted using a customer managed key. This rule is non-compliant if a secret is encrypted using aws/secretsmanager.

How to fix

Attribute kms_key_id of aws_secretsmanager_secret must be non-empty.

Implementation options

Choose the option that matches how you manage Terraform. All options satisfy this control.

Option 1: Terraform AWS provider resources

If you manage resources directly, configure the relevant Terraform AWS provider resources to meet this control. See docs for the resources involved: aws_secretsmanager_secret.

resource "aws_secretsmanager_secret" "this" {
  name = "pofix-example-secret"

  kms_key_id = "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
}
Which option should I choose?
  • Compliance.tf module (recommended): controls enforced by default and mapped to frameworks.
  • Open source module (terraform-aws-modules): compatible by design with compliance.tf. Same variable names for an easy, low-change migration path when you are ready.
  • Terraform AWS provider resources: manage Terraform resources directly.

Tool mappings

Use these identifiers to cross-reference this control across tools, reports, and evidence.

  • Compliance.tf (CTF) Control: secretsmanager_secret_encrypted_with_kms_cmk

  • AWS Config Managed Rule: SECRETSMANAGER_USING_CMK

  • Checkov Check: CKV_AWS_149

  • Powerpipe Control: aws_compliance.control.secretsmanager_secret_encrypted_with_kms_cmk