Best Practice question: restrictive IAM policies for lift #70
InvisibleKind
started this conversation in
General
Replies: 1 comment 3 replies
-
Hey @InvisibleKind! That's interesting, I wasn't aware of that limitation with CloudFront. I have opened the question in the AWS Hero group to see if there's a trick we don't know about. I'll let you know if I get any useful information. It may be also worth asking the AWS support. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello lift and serverless community,
I want to define an IAM policy for publishing static websites as restrictive as possible to exclude issues, when due to a misconfiguration or a bug something different is deleted/updated, than the resource in current serverless stack.
I've used https://github.com/dancrumb/generator-serverless-policy as a starting point and added more rules, specific to CloudFront.
At the end my policy looks like this (stack-name is just a dummy and should be replaced with a real stack name):
This set works, but makes me a bit nervous in a part "cloudfront:UpdateDistribution", "cloudfront:DeleteDistribution" with Resource set to *. Unfortunately I didn't find a way to restrict it somehow, because distribution's ARN doesn't contain a stack-name - it is randomly created.
And if I understand it correct, it is even not possible by design. The only possible value in this case according to CloudFront API permission Docs is *
Are there any best practices, recommendations or tricks on this? Or in other words, how do you configure your IAM roles, especially in a context of lift and cloudfront?
Beta Was this translation helpful? Give feedback.
All reactions