Skip to content
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

Dedicated IAM role for cluster creation #3189

Open
sebolabs opened this issue Oct 23, 2024 · 0 comments
Open

Dedicated IAM role for cluster creation #3189

sebolabs opened this issue Oct 23, 2024 · 0 comments

Comments

@sebolabs
Copy link

Is your request related to a new offering from AWS?

No

Is your request related to a problem? Please describe.

It seems that AWS consider clusters should be created using a dedicated IAM role. That role is expected not to be used to perform any actions on the clusters what can be easily satisfied with enable_cluster_creator_admin_permissions param.
The reason is obviously to have a back door in the case when your access configuration is corrupted and clusters become inaccessible.

Describe the solution you'd like.

Considering that the module is not only creating the cluster but also many different things around KMS, IAM, EC2 etc. you could perhaps incorporate that by making the aws_eks_cluster use another provider set up with such a dedicated IAM role, and also allowing overriding the trust policy for such a role so it could be hardened i.e. one could specify principals that are allowed to assume it while it could default to any principal in the current account with enough permissions.

In terms of permissions that role, if I'm not mistaken, could be limited to:

  • ec2:Describe*
  • eks:List*
  • eks:Describe*
  • eks:CreateCluster

on [*], plus:

  • iam:PassRole

on the cluster IAM role, and:

  • eks:*

on the cluster to be created.

Describe alternatives you've considered.

I have considered using a dedicated provider for the entire module but I don't like the idea of granting that IAM role too many permissions across many AWS services, especially when keeping them narrowed down wouldn't be easiest + they would have to be kept updated with time.

Additional context

Happy to hear your thoughts / recommendations :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant