Skip to content

Commit 4c4014e

Browse files
kaizencccorymhall
authored andcommittedMay 11, 2023
fix(bootstrap): bootstrap doesn't work in non-aws partitions anymore (revert security hub finding fix) (aws#25540)
**NOTE**: This PR bumps the version of the bootstrap stack to 18, but there is no need to update your bootstrap stacks as this PR changes no functionality. We are reverting aws#24588 because it includes hardcoded partitions in the bootstrap causing the `p0` in aws#25272. Including intrinsics `${AWS::Partition}` here is impossible. In addition, aws#24588 was reported to not actually fix the Security Hub finding: aws#19380 (comment). Although this is a revert, I am rolling forward the bootstrap version to 18. reverts aws#24588. fixes aws#25272. see aws#25273 & aws#25507. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent e4a2c01 commit 4c4014e

File tree

1 file changed

+15
-30
lines changed

1 file changed

+15
-30
lines changed
 

‎packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml

+15-30
Original file line numberDiff line numberDiff line change
@@ -473,35 +473,20 @@ Resources:
473473
StringNotEquals:
474474
s3:ResourceAccount:
475475
Ref: 'AWS::AccountId'
476-
- Fn::If:
477-
- HasTrustedAccounts
478-
- Sid: PipelineCrossAccountArtifactsKey
479-
# Use keys only for the purposes of reading encrypted files from S3.
480-
Effect: Allow
481-
Action:
482-
- kms:Decrypt
483-
- kms:DescribeKey
484-
- kms:Encrypt
485-
- kms:ReEncrypt*
486-
- kms:GenerateDataKey*
487-
488-
# SecurityHub's rule KMS.2 complains if we put a '*' here, so instead we'll
489-
# turn the list of trusted accountIds ['111', '222', ...] into a list of
490-
# wildcard ARNS: ['arn:aws:kms:*:1111:*', 'arn:aws:kms:*:2222:*', ...].
491-
Resource:
492-
Fn::Split:
493-
- "|"
494-
- Fn::Sub:
495-
- "arn:aws:kms:*:${JoinedAccounts}:*"
496-
- JoinedAccounts:
497-
Fn::Join:
498-
- ":*|arn:aws:kms:*:"
499-
- { Ref: TrustedAccounts }
500-
Condition:
501-
StringEquals:
502-
kms:ViaService:
503-
Fn::Sub: s3.${AWS::Region}.amazonaws.com
504-
- { Ref: AWS::NoValue }
476+
- Sid: PipelineCrossAccountArtifactsKey
477+
# Use keys only for the purposes of reading encrypted files from S3.
478+
Effect: Allow
479+
Action:
480+
- kms:Decrypt
481+
- kms:DescribeKey
482+
- kms:Encrypt
483+
- kms:ReEncrypt*
484+
- kms:GenerateDataKey*
485+
Resource: "*"
486+
Condition:
487+
StringEquals:
488+
kms:ViaService:
489+
Fn::Sub: s3.${AWS::Region}.amazonaws.com
505490
- Action: iam:PassRole
506491
Resource:
507492
Fn::Sub: "${CloudFormationExecutionRole.Arn}"
@@ -633,7 +618,7 @@ Resources:
633618
Type: String
634619
Name:
635620
Fn::Sub: '/cdk-bootstrap/${Qualifier}/version'
636-
Value: '17'
621+
Value: '18'
637622
Outputs:
638623
BucketName:
639624
Description: The name of the S3 bucket owned by the CDK toolkit stack

0 commit comments

Comments
 (0)
Please sign in to comment.