-
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
s3.Bucket.grantDelete on bucket with KMS SSE generates invalid policy #4380
Comments
Taking a look at the code aws-cdk/packages/@aws-cdk/aws-s3/lib/bucket.ts Lines 451 to 454 in 960d71f
Which leads to aws-cdk/packages/@aws-cdk/aws-s3/lib/bucket.ts Lines 540 to 542 in 960d71f
Eventually (via aws-kms grant) leads to this, without any checks on actions being empty aws-cdk/packages/@aws-cdk/aws-iam/lib/grant.ts Lines 167 to 171 in 69bff3d
|
At first glance, doesn't seem like it. Based on the code snippets I provided above, I believe this issue is due to an empty 'actions' parameter that translates to an empty 'Actions' block in the template. #4381 has to do with a perceived difference between read/write and encrypt/decrypt. (I don't know enough to tell whether it's actually an issue) |
Yep, this should have had an "empty array" check in there. |
Added empty array check for keyActions. This will make sure that `grantDelete` will not create malformed policy when used with `KMS` key. Added a new integ test to check CloudFormation will not error out during the deployment. Fixes #4380
Added empty array check for keyActions. This will make sure that `grantDelete` will not create malformed policy when used with `KMS` key. Added a new integ test to check CloudFormation will not error out during the deployment. Fixes aws#4380
Reproduction Steps
This simple stack
Generates the following policy
The problematic part is below, note lack of 'Action' block
Error Log
During CloudFormation stack update, the update fails with a Malformed Policy error due to missing Action block.
Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: