(aws-cdk): cdk deploy generates IAM roles that don't adhere to Security Hub compliance packs #21526
Labels
@aws-cdk/aws-iam
Related to AWS Identity and Access Management
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
I noticed the following security issue via Security Hub for IAM roles created by the cdk deploy process (specifically the roles with Tags of
{key: aws-cdk:bootstrap-role, value: deploy}
):[KMS.2] IAM principals should not have IAM inline policies that allow decryption and re-encryption actions on all KMS keys
(https://docs.aws.amazon.com/console/securityhub/KMS.2/remediation)Expected Behavior
I expected IAM policies generated by cdk deploy to down scope the KMS resource to avoid breaching Security Hub policies.
Current Behavior
The generated AWS CDK bootstrap roles are granted the following policy:
"Action": [ "kms:Decrypt", "kms:DescribeKey", "kms:Encrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*" ], "Resource": "*"
Reproduction Steps
cdk init
[KMS.2] IAM principals should not have IAM inline policies that allow decryption and re-encryption actions on all KMS keys
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.35.0 (build 5c23578)
Framework Version
No response
Node.js Version
v14.18.1
OS
MacOS
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: