-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[sns] add sns service trust to key when subscribing to an encrypted queue #2504
Comments
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Keeping open 👍🏻 |
|
I have spent some time looking into this and will summarize my findings here for ease of discovery (this was my first google hit). There are two duplicates of this issue: Related issue to warn that the KMS key cannot get the necessary policy if it is an AWS managed key: This issue (#2504) was There is also a duplicate attempted implementation: That PR has some interesting comments about restricting CMK access by SourceArn, which is the reason I started looking into this. I had defined my CMK policy correctly with a condition on the subscribe SNS Topic ARN being the source, and was surprised when the L3 magic added a more permissive statement allowing any SNS service in the world access to my CMK. Apparently this is because CMK access couldn't be restricted when #14960 was implemented. Now it can, and it should be a trivial change for which I created this issue: |
Also useful to know: CloudFormation (and thus CDK) does not support enabling delivery status logging, but it's coming: aws-cloudformation/cloudformation-coverage-roadmap#66 The error when CMK policy isn't right is
|
When using Bucket Notifications with SQS (so, something like
bucket.onObjectCreated(queue)
), in the case the Queue is encrypted with a KMS Key, we correctly trust the S3 Service Principal in the Key's Resource Policy.We need to do something similar in the case of an SNS subscription to an encrypted SQS Queue (so,
topic.subscribeQueue(queue)
) - the Key should trust the SNS Service Principal in that case.The text was updated successfully, but these errors were encountered: