-
Notifications
You must be signed in to change notification settings - Fork 81
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: Restrict kms keys #524
Conversation
…g of the default role
…lias. athena bucket
…onment-roles-permissions
…r imported dataset view
…ate docs for KMSAlias
…le from table syncer, fixed tests for kmsAlias, docs
@@ -62,26 +63,47 @@ def __init__(self, scope, id: str, target_uri: str = None, **kwargs) -> None: | |||
|
|||
env_group = self.get_env_group(notebook) | |||
|
|||
cdk_exec_role = SessionHelper.get_cdk_exec_role_arn(notebook.AWSAccountId, notebook.region) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we use environment.CDKRoleArn and avoid this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we could also do it that way - currently notebooks stack has no helper function to get the environment, only to get the env group. So either it would be adding that helper function in the Notebook Stack to get the environment and the environment.CDKRoleArn
property or using the get_cdk_exec_role_arn()
defined above
This is the only use of get_cdk_exec_role_arn()
but in future it could be used more if needed - similar to how we have get_cdk_look_up_role_arn()
. The value is rather static where the IAM role ARN would only change if we had custom synthesizers in CDK changing the qualifier - which I see little risk for. What are your thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 things.
- Independently of how we get the role arn, we need to be consistent across modules. Either we use the environment property or the method but I would not have a mix of both.
- I am more inclined to use a method exactly because of what you pointed out, custom qualifiers in CDK. Let's say that one customer wants to implement something like this. It would be relatively easy to add an SSM parameter with the qualifier and then get it in the
get_cdk_exec_role_arn()
method. Plus, we can get rid of an unnecessary column in RDS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do a final testing as well, but it looks good
### Feature or Bugfix Release PR with the following list of features. Refer to each PR for the details ### Detail - #498 - #482 - #543 - #524 (which also solves #531) - #532 - #535 - #497 - #515 - #529 - #562 - #455 - #572 - #567 - #573 - #579 - #578 - #582 ### Breaking changes - release notes -⚠️ IMPORTANT: upgrade to a version >V1.5.0 before upgrading to V1.6 to avoid deletion of resources in custom resource deletion -⚠️ IMPORTANT: requires an update of environments and then datasets after upgrading. Either using cdk.json parameter `enable_update_dataall_stacks_in_cicd_pipeline`, waiting for overnight update stack task, or manually updating first environments and then datasets - CloudFront distribution replace for #529 - Additional EC2 permissions in CDK Synth CodeBuild stage for #543 --> this can be avoided by upgrading to v1.5.6 before upgrading to v1.6.0 - local development affected by more restrictive pivotRole trust policy ### Relates V1.6.0 release By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Gezim Musliaj <102723839+gmuslia@users.noreply.github.com> Co-authored-by: Noah Paige <69586985+noah-paige@users.noreply.github.com> Co-authored-by: nikpodsh <124577300+nikpodsh@users.noreply.github.com> Co-authored-by: chamcca <40579012+chamcca@users.noreply.github.com> Co-authored-by: Nikita Podshivalov <nikpodsh@amazon.com> Co-authored-by: dbalintx <132444646+dbalintx@users.noreply.github.com> Co-authored-by: mourya-33 <134511711+mourya-33@users.noreply.github.com>
Feature or Bugfix
Detail
This PR restricts the KMS Keys created in Data.all Environments (i.e. linked AWS Accounts), including
Additional as part of this PR:
Consolidate Environment Keys
Remove Unused Custom Resources
Remove KMS Key Permissions in Environment Roles where applicable
Relates
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.