-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[aws-eks] expose EncryptionConfig in eks.Cluster Construct #9140
Comments
Hi @iliapolo , I could contribute PR for this issue if nobody else started working on this. Could you help reviewing my PR? I have done all the logic and need to finish the integration test before submitting the PR. Thanks a lot! |
@davidsung that would be great! Happy to review |
Is there any workaround until this is merged? as it is not possible to edit the config after cluster creation. |
@SaikiranDaripelli If you are using If you are using However, I wouldn't recommend using I dont imagine it would take very long for this PR to be merged. Stay tuned. |
Introduce an option `secretsEncryptionKey` which, if specified, will configure the cluster to use a KMS key for encrypting Kubernetes secrets. This option can only be specified when the cluster is first created and currently cannot be updated due to a limitation in the EKS service. Resolves #9140
There also seems to an issue with AWS lambda runtime used to create custom resource. The latest nodejs12.x runtime uses AWS-SDK v2.631.0 which doesn't seem to have support for encryption. I get the following error:
AWS-SDK added support for envelope encryption only in v2.634.0. |
Indeed this API is still not supported by the AWS Lambda node.js runtime. Let's wait until lambda the SDK version in their runtime and then we can merge this. |
As figured out by @pahud, the Tested with Lambda function: const aws = require('aws-sdk');
exports.handler = async (event) => {
console.log("request:", JSON.stringify(event, undefined, 2));
const response = {
statusCode: 200,
body: JSON.stringify({version: aws.VERSION}),
};
return response;
}; |
Thanks for testing this. I am following up with the Lambda team to validate. |
@eladb Kindly take note that the version specified in the Lambda runtime docs has been updated to |
add envelope encryption support upon eks cluster creation add update event handling for secretEncryptionKey mutation attempt add test case for checking update event handling update readme Closes aws#9140 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
feat(eks): envelope encryption for secrets This PR adds envelope encryption support for Amazon EKS. Added a new key `secretsEncryptionKey` in `ClusterProps` for users to specify their own KMS CMK upon cluster creation: ```ts new eks.Cluster(this, 'Cluster', { version: eks.KubernetesVersion.V1_16, secretsEncryptionKey, }); ``` Closes: #9140 ---- ## Considerations 1. Confirmed `Secrets Encryption` is enabled in the provisioned Amazon EKS (both standard resource `AWS::EKS::Cluster` and custom resource `Custom::AWSCDK-EKS-Cluster`) after running an integration test from scratch. 2. By inspecting the CloudTrail logs after the integration test, confirmed the exact KMS IAM permission required for the cluster creation role as `['kms:Encrypt', 'kms:Decrypt', 'kms:DescribeKey', 'kms:CreateGrant']`. Note: The encryption provider is using its own way to generate data encryption key, not using KMS GenerateDataKey, and hence IAM permission`kms:GenerateDataKey*` is not required. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
❓ General Issue
Cloudformation supports passing in an EncryptionConfig when creating an EKS cluster.
CDK only exposes EncryptionConfig in the CfnCluster construct, not the high level eks.Cluster Construct.
The Question
Can we expose encryptionConfig as part of
ClusterProps
to allow this to be managed with the higher level CDK construct?Environment
Other information
CfnCluster exposes EncryptionConfig
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-eks.CfnClusterProps.html#encryptionconfig
ClusterProps does not expose EncryptionConfig
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-eks.ClusterProps.html
The text was updated successfully, but these errors were encountered: