Skip to main content
HIGHEKSSecurity

EKS Secrets Encryption Disabled

eks-secrets-encryption-disabled

What this rule checks

Detects EKS clusters without envelope encryption for Kubernetes secrets in etcd.

How to fix it

  1. 1Configure EncryptionConfig with a KMS key referencing resources: ["secrets"]
FlaggedNo EncryptionConfig for "secrets" means Kubernetes secrets are stored unencrypted in etcd.
import { aws_ec2 as ec2, aws_eks as eks, aws_iam as iam } from 'aws-cdk-lib';

const vpc = new ec2.Vpc(this, 'Vpc', { maxAzs: 2 });
const role = new iam.Role(this, 'EksRole', { assumedBy: new iam.ServicePrincipal('eks.amazonaws.com') });
new eks.CfnCluster(this, 'Cluster', {
  roleArn: role.roleArn,
  resourcesVpcConfig: { subnetIds: vpc.privateSubnets.map((s) => s.subnetId) },
});
FixedAdding EncryptionConfig with a KMS key enables envelope encryption of secrets at rest in etcd.
import { aws_ec2 as ec2, aws_eks as eks, aws_iam as iam, aws_kms as kms } from 'aws-cdk-lib';

const vpc = new ec2.Vpc(this, 'Vpc', { maxAzs: 2 });
const role = new iam.Role(this, 'EksRole', { assumedBy: new iam.ServicePrincipal('eks.amazonaws.com') });
const key = new kms.Key(this, 'SecretsKey');
new eks.CfnCluster(this, 'Cluster', {
  roleArn: role.roleArn,
  resourcesVpcConfig: { subnetIds: vpc.privateSubnets.map((s) => s.subnetId) },
  encryptionConfig: [{ resources: ['secrets'], provider: { keyArn: key.keyArn } }],
});

CDK Insights pinpoints the exact file and line in your CDK source for every finding, so you can jump straight to the fix.

Affected resource types

AWS::EKS::Cluster

Compliance frameworks

SOC2HIPAAPCI-DSSNIST

AWS documentation

Read the AWS guidance

Intentional? Suppress this finding

Sometimes a flag is deliberate — a genuinely public endpoint, say. You can dismiss eks-secrets-encryption-disabled and the reason is kept in the report, not silently hidden.

In .cdk-insights.json:

{
  "ignoreRules": [
    { "id": "eks-secrets-encryption-disabled", "reason": "Why this is intentional" }
  ]
}

Or inline in your CDK code:

Validations.of(scope).acknowledge({
  id: 'cdk-insights::eks-secrets-encryption-disabled',
  reason: 'Why this is intentional',
});

Use the rule ID eks-secrets-encryption-disabled shown above — not the CDK-* ID from SARIF / GitHub code scanning. To dismiss every finding on one construct instead, use ignorePaths. Suppression docs →

Catch this in your stack

$ npx cdk-insights scan

CDK Insights runs this and 118+ other rules locally against your synthesised CDK app — free, no account, your code never leaves your machine.

More EKS rules