Skip to content

Commit fbccc8e

Browse files
feat(core): Adding Automatic rotation to KMS Key (#619)
* Adding Automatic rotation to KMS Key * enable encryption on SSM encryption key * remove stmt from docs Co-authored-by: Brian969 <56414362+Brian969@users.noreply.github.com>
1 parent 7bafd1c commit fbccc8e

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

docs/installation/installation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ Issues in Older Releases:
423423
- VPC Endpoints have no Name tags applied as CloudFormation does not currently support tagging VPC Endpoints.
424424
- If the Organization Management (root) account coincidentally already has an ADC with the same domain name, we do not create/deploy a new ADC. You must manually create a new ADC (it won't cause issues).
425425
- Firewall updates are to be performed using the firewall OS based update capabilities. To update the AMI using the Accelerator, you must first remove the firewalls and then redeploy them (as the EIP's will block a parallel deployment), or deploy a second parallel FW cluster and de-provision the first cluster when ready.
426-
- At this time we have not automated the rotation of KMS Customer Managed Keys. This is a roadmap item for a future release.
427426

428427
---
429428

src/deployments/cdk/src/deployments/defaults/shared.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export function createDefaultS3Key(props: { accountStack: AccountStack }): KmsDe
1818
const encryptionKey = new kms.Key(accountStack, 'DefaultKey', {
1919
alias: `alias/${keyAlias}`,
2020
description: `Default bucket encryption key`,
21+
enableKeyRotation: true,
2122
});
2223
encryptionKey.addToResourcePolicy(
2324
new iam.PolicyStatement({

src/deployments/cdk/src/deployments/defaults/step-1.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ function createCentralBucketCopy(props: DefaultsStep1Props) {
8383
const encryptionKey = new kms.Key(masterAccountStack, 'CentralBucketKey', {
8484
alias: `alias/${keyAlias}`,
8585
description: 'Key used to encrypt/decrypt the copy of central S3 bucket',
86+
enableKeyRotation: true,
8687
});
8788

8889
const bucket = new s3.Bucket(masterAccountStack, 'CentralBucketCopy', {
@@ -380,6 +381,7 @@ function createDefaultEbsEncryptionKey(props: DefaultsStep1Props): AccountRegion
380381
const key = new kms.Key(accountStack, 'EbsDefaultEncryptionKey', {
381382
alias: `alias/${keyAlias}`,
382383
description: 'Key used to encrypt/decrypt EBS by default',
384+
enableKeyRotation: true,
383385
});
384386

385387
key.addToResourcePolicy(

src/deployments/cdk/src/deployments/ssm/session-manager.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export async function step1(props: SSMStep1Props) {
7171
const ssmKey = new Key(accountStack, 'SSM-Key', {
7272
alias: `alias/${keyAlias}`,
7373
trustAccountIdentities: true,
74+
description: 'Key used to encrypt/decrypt SSM',
75+
enableKeyRotation: true,
7476
});
7577
ssmKey.grantEncryptDecrypt(new AccountPrincipal(cdk.Aws.ACCOUNT_ID));
7678
ssmKey.grantEncryptDecrypt(new ServicePrincipal('logs.amazonaws.com'));

src/lib/cdk-accelerator/src/core/secrets-container.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export class SecretsContainer extends cdk.Construct {
4040
this.encryptionKey = new kms.Key(this, `EncryptionKey`, {
4141
alias: `alias/${this.keyAlias}`,
4242
description: 'Key used to encrypt/decrypt secrets',
43+
enableKeyRotation: true,
4344
});
4445

4546
this.encryptionKey.addToResourcePolicy(

0 commit comments

Comments
 (0)