Skip to content
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

feat(kinesisfirehose-alpha): enable server-side encryption for delivery stream by default #31858

Closed
wants to merge 3 commits into from

Conversation

paulhcsun
Copy link
Contributor

Reason for this change

SSE on delivery streams were disabled by default (unencrypted) which is against security best practices. This PR changes that default to enable SSE with an AWS_OWNED key.

Description of changes

Changed default value for encryption property from StreamEncryption.unencrypted() to Stream.awsOwnedKey().

Description of how you validated changes

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

BREAKING CHANGE: Changed default value for encryption property from StreamEncryption.unencrypted() to Stream.awsOwnedKey(). To get the old behaviour, disable SSE by explicitly setting encryption: StreamEncryption.unencrypted() in your stack.

@aws-cdk-automation aws-cdk-automation requested a review from a team October 22, 2024 23:58
@github-actions github-actions bot added the p2 label Oct 22, 2024
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 22, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: a111f68
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@paulhcsun paulhcsun added the pr/do-not-merge This PR should not be merged at this time. label Oct 23, 2024
@paulhcsun
Copy link
Contributor Author

This PR may be closed and a warning added instead with unencrypted() still as the default value as the current behaviour in the AWS console is that SSE is disabled by default for direct put (and is not possible to enable for Stream or MSK as a source as encryption would be done on the source itself in that case).

@@ -328,17 +331,20 @@ export class DeliveryStream extends DeliveryStreamBase {
});
}

const encryption = props.encryption ?? StreamEncryption.awsOwnedKey();
const encryptionKey = encryption.encryptionKey ?? (encryption.type === StreamEncryptionType.CUSTOMER_MANAGED ? new kms.Key(this, 'Key') : undefined);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This encryptionKey feels a bit off to me. Generally if it's a customer managed key, I believe we should allow users to be able to specify a key themselve instead of always creating a key for them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For customer managed key, passing in their own key is optional so this only creates a key when customer managed key is set if they didn't pass in their own, otherwise const encryptionKey = encryption.encryptionKey would use the key provided.

Comment on lines +192 to +194
"DeliveryStreamEncryptionConfigurationInput": {
"KeyType": "AWS_OWNED_CMK"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we use unencrypted in the integration test file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wait you're right. that's weird..lemme double check that

@paulhcsun
Copy link
Contributor Author

Closing this PR as we've decided to keep the default value as unencrypted() to match the AWS console.

@paulhcsun paulhcsun closed this Oct 25, 2024
@paulhcsun paulhcsun deleted the firehose-enable-sse-by-default branch October 25, 2024 18:36
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contribution/core This is a PR that came from AWS. p2 pr/do-not-merge This PR should not be merged at this time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants