EKS clusters should be configured to have kubernetes secrets encrypted using KMS¶
Ensure that AWS Elastic Kubernetes Service clusters are configured to have Kubernetes secrets encrypted using AWS Key Management Service (KMS) keys.
How to fix¶
Attribute encryption_config[0].provider[0].key_arn of aws_eks_cluster must be non-empty.
Implementation options¶
Choose the option that matches how you manage Terraform. All options satisfy this control.
Option 1: Compliance.tf module (recommended)¶
Use the compliance.tf registry module to get this control enforced by default. This control is mapped to the frameworks shown in the tabs above. To begin, see get started with compliance.tf.
module "eks" {
source = "acscism2023.compliance.tf/terraform-aws-modules/eks/aws"
version = ">=21.0.0"
cluster_name = "abc123"
subnet_ids = ["subnet-abc123", "subnet-def456"]
vpc_id = "vpc-12345678"
}
module "eks" {
source = "eugmpannex11.compliance.tf/terraform-aws-modules/eks/aws"
version = ">=21.0.0"
cluster_name = "abc123"
subnet_ids = ["subnet-abc123", "subnet-def456"]
vpc_id = "vpc-12345678"
}
module "eks" {
source = "hipaa.compliance.tf/terraform-aws-modules/eks/aws"
version = ">=21.0.0"
cluster_name = "abc123"
subnet_ids = ["subnet-abc123", "subnet-def456"]
vpc_id = "vpc-12345678"
}
module "eks" {
source = "hipaasecurity2003.compliance.tf/terraform-aws-modules/eks/aws"
version = ">=21.0.0"
cluster_name = "abc123"
subnet_ids = ["subnet-abc123", "subnet-def456"]
vpc_id = "vpc-12345678"
}
module "eks" {
source = "nistcsfv11.compliance.tf/terraform-aws-modules/eks/aws"
version = ">=21.0.0"
cluster_name = "abc123"
subnet_ids = ["subnet-abc123", "subnet-def456"]
vpc_id = "vpc-12345678"
}
module "eks" {
source = "pcidssv321.compliance.tf/terraform-aws-modules/eks/aws"
version = ">=21.0.0"
cluster_name = "abc123"
subnet_ids = ["subnet-abc123", "subnet-def456"]
vpc_id = "vpc-12345678"
}
module "eks" {
source = "pcidss.compliance.tf/terraform-aws-modules/eks/aws"
version = ">=21.0.0"
cluster_name = "abc123"
subnet_ids = ["subnet-abc123", "subnet-def456"]
vpc_id = "vpc-12345678"
}
Option 2: Open source module (terraform-aws-modules)¶
If you use terraform-aws-modules/eks/aws, configure the required module inputs to satisfy this control. You can later migrate to the compliance.tf module with minimal changes because it is compatible by design.
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = ">=21.0.0"
cluster_name = "abc123"
subnet_ids = ["subnet-abc123", "subnet-def456"]
vpc_id = "vpc-12345678"
}
Option 3: 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_eks_cluster.
resource "aws_eks_cluster" "this" {
enabled_cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
name = "pofix-example"
role_arn = "arn:aws:iam::123456789012:role/example-role"
vpc_config {
subnet_ids = ["subnet-abc123", "subnet-def456"]
}
encryption_config {
provider {
key_arn = "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
}
resources = ["secrets"]
}
}
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:
eks_cluster_secrets_encryptedAWS Config Managed Rules:
EKS_CLUSTER_SECRETS_ENCRYPTED,EKS_SECRETS_ENCRYPTEDCheckov Check:
CKV_AWS_58Powerpipe Control:
aws_compliance.control.eks_cluster_secrets_encrypted