You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): assets are KMS-encrypted using wrong key (#18340)
Even though a custom KMS key is specified as the default encryption key
on the file assets bucket, all uploaded assets are encrypted using the
default key.
The reason is that in #17668 we added an explicit `encryption: kms`
parameter to the `putObject` operation, so that an SCP that is
commonly in use across large organizations to prevent files from
ending up unencrypted, can be used (the SCP can only validate
call parameters, such as whether the `putObject` call includes
the parameter that reuests encryption, not the effective end result,
such as whether a file would end up encrypted).
However, we did not include the KMS Key Id into the `putObject`
request, which caused S3 to fall back to the default key.
Solution: also look up the key id and pass that along as well.
Fixes#18262.
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
// We must include the key ID otherwise S3 will encrypt with the default key
60
+
paramsEncryption={
61
+
ServerSideEncryption: 'aws:kms',
62
+
SSEKMSKeyId: encryption2.kmsKeyId,
63
+
};
60
64
break;
61
-
caseBucketEncryption.DOES_NOT_EXIST:
65
+
case'does_not_exist':
62
66
this.host.emitMessage(EventType.DEBUG,`No bucket named '${destination.bucketName}'. Is account ${awaitaccount()} bootstrapped?`);
63
67
break;
64
-
caseBucketEncryption.ACCES_DENIED:
68
+
case'access_denied':
65
69
this.host.emitMessage(EventType.DEBUG,`Could not read encryption settings of bucket '${destination.bucketName}': uploading with default settings ("cdk bootstrap" to version 9 if your organization's policies prevent a successful upload or to get rid of this message).`);
0 commit comments