aws-s3: key rotation is not enabled while creating KMS encrypted S3 buckets #31982
Labels
@aws-cdk/aws-kms
Related to AWS Key Management
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p1
Describe the bug
If an encryption key is not provided while creating the S3 bucket, then S3 construct creates a key by default but it does not enable key rotation. This could cause a security risk on downstream consumers.
S3 bucket creation where key is created without keyrotation enabled
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-s3/lib/bucket.ts#L2160
Similar example with DynamoDb where keyrotation enabled by default
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts#L1696
Change should be straightforward since enableKeyRotation doesn’t require a replacement on update.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
S3 created KMS keys to have key rotation enabled
Current Behavior
S3 created KMS keys do not enable key rotation
Reproduction Steps
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-s3/lib/bucket.ts#L2160
Possible Solution
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-dynamodb/lib/table.ts#L1696
Additional Information/Context
No response
CDK CLI Version
Latest
Framework Version
No response
Node.js Version
18
OS
AL2
Language
Java
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: