-
Notifications
You must be signed in to change notification settings - Fork 24
PLFM-9354: Add key for RDS snapshot and associated policy. #808
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
Open
xschildw
wants to merge
6
commits into
Sage-Bionetworks:develop
Choose a base branch
from
xschildw:dev-plfm-9354-rds-snapshot-kms
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8934cf3
Add key for RDS snapshot and associated policy.
xschildw 676e4b0
Missing file
xschildw 7a47851
Merge branch 'develop' into dev-plfm-9354-rds-snapshot-kms
xschildw 0027526
Just check resources exist in template.
xschildw b77d6d8
Merge branch 'develop' into dev-plfm-9354-rds-snapshot-kms
xschildw 514136c
Remove expected templates
xschildw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
src/main/resources/templates/global/rds-snapshot-encryption-key.json.vpt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| , | ||
| "${stack}RdsSnapshotCmk": { | ||
| "Type": "AWS::KMS::Key", | ||
| "Properties": { | ||
| "Description": "The encryption key for ${stack} stack RDS snapshots", | ||
| "EnableKeyRotation": true, | ||
| "KeyPolicy": { | ||
| "Version": "2012-10-17", | ||
| "Id": "key-default-1", | ||
| "Statement": [ | ||
| { | ||
| "Sid": "Enable IAM User Permissions", | ||
| "Effect": "Allow", | ||
| "Principal": { "AWS": "arn:aws:iam::#[[${AWS::AccountId}]]#:root" }, | ||
| "Action": "kms:*", | ||
| "Resource": "*" | ||
| }, | ||
| { | ||
| "Sid": "Allow access for Key Administrators", | ||
| "Effect": "Allow", | ||
| "Principal": { | ||
| "AWS": | ||
| #if(${stack} == 'prod') | ||
| { "Fn::Sub": "arn:aws:iam::#[[${AWS::AccountId}]]#:role/aws-reserved/sso.amazonaws.com/AWSReservedSSO_Administrator_6620166dd0e7f1b6" } | ||
| #else | ||
| { "Fn::Sub": "arn:aws:iam::#[[${AWS::AccountId}]]#:role/aws-reserved/sso.amazonaws.com/AWSReservedSSO_Administrator_693a85eb20cd5043" } | ||
| #end | ||
| }, | ||
| "Action": [ | ||
| "kms:Create*", | ||
| "kms:Describe*", | ||
| "kms:Enable*", | ||
| "kms:List*", | ||
| "kms:Put*", | ||
| "kms:Update*", | ||
| "kms:Revoke*", | ||
| "kms:Disable*", | ||
| "kms:Get*", | ||
| "kms:Delete*", | ||
| "kms:TagResource", | ||
| "kms:UntagResource", | ||
| "kms:ScheduleKeyDeletion", | ||
| "kms:CancelKeyDeletion", | ||
| "kms:RotateKeyOnDemand" | ||
| ], | ||
| "Resource": "*" | ||
| }, | ||
| { | ||
| "Sid": "Allow use of the key", | ||
| "Effect": "Allow", | ||
| "Principal": { "AWS": "arn:aws:iam::766808016710:root" }, | ||
| "Action": [ | ||
| "kms:Decrypt", | ||
| "kms:DescribeKey" | ||
| ], | ||
| "Resource": "*" | ||
| }, | ||
| { | ||
| "Sid": "Allow attachment of persistent resources", | ||
| "Effect": "Allow", | ||
| "Principal": { "AWS": "arn:aws:iam::766808016710:root" }, | ||
| "Action": [ | ||
| "kms:CreateGrant", | ||
| "kms:ListGrants", | ||
| "kms:RevokeGrant" | ||
| ], | ||
| "Resource": "*", | ||
| "Condition": { | ||
| "StringEquals": { "kms:ViaService": "rds.us-east-1.amazonaws.com" }, | ||
| "Bool": { "kms:GrantIsForAWSResource": "true" } | ||
| } | ||
| }, | ||
| { | ||
| "Sid": "AllowRDSToDecryptSourceSnapshotForExport", | ||
| "Effect": "Allow", | ||
| "Principal": { "Service": "export.rds.amazonaws.com" }, | ||
| "Action": [ | ||
| "kms:Decrypt", | ||
| "kms:DescribeKey" | ||
| ], | ||
| "Resource": "*" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| "${stack}RdsSnapshotCmkAlias": { | ||
| "Type": "AWS::KMS::Alias", | ||
| "Properties": { | ||
| "AliasName": "alias/synapse/${stack}/rds-snapshot-cmk", | ||
| "TargetKeyId": { "Ref": "${stack}RdsSnapshotCmk" } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not of a fan of testing by comparing a file to what is seen in a test. I like to test by ensuring that the resulting JSON loads and is valid JSON. Then spot check the JSON for "key" resource.