-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Can I make the CloudFormationExecutionRole have least privilege? #3282
Comments
CloudFormation assumes the execution role to deploy applications (which can consist of arbitrary resources). You can create an IAM role with reduced permissions and pass its ARN during the bootstrapping process (e.g. through |
@hoffa Thanks, |
I am working on this feature and will document them once it gets finalized. It's almost done. |
This seems a bit old. Can we at least consider denying IAM access to this role? It seems unsafe as it allows privilege escalation via creation of an administrative IAM role/user via cloudformation. I think if, at least, this is denied, it would provide a much more secure role. It might also be a good idea to maybe prevent allowing importing resources via cloudformation by default? Maybe this could be skipped but the IAM part seems almost necessary. Edit: Actually, IAM permissions are needed, at least, to some extent. Creating roles and policies is definitely a need. I feel like there should still be a way to prevent allowing access to resources outside what is defined by a stack as well as preventing things like creating an administrative user/role/policy via the stack. |
Describe your idea/feature/enhancement
I hope that the CloudFormationExecutionRole have least privilege.
Currently SAM-CLI attaches the following policy to the execution role:
This seems to allow CloudFormation to create/delete anything in an account including IAM resouces, even if I just wan't to deploy an API.
Proposal
I hope that there were policy templates for tipical usecases such as an API or an S3 event handler.
Additional Details
The text was updated successfully, but these errors were encountered: