cortex icon indicating copy to clipboard operation
cortex copied to clipboard

Is it possible to use AWS IAM Roles to Deploy/Update Cortex?

Open ug911 opened this issue 6 years ago • 2 comments

The cluster.yaml file has keys where we can define the AWS Key and Secret Key. However, the AWS Keys require Administrator Access and thus have been raised as a security concern by the DevOps team. They have asked me if I could instead deploy and manage the Cortex deployment using AWS IAM Roles that have been attached to the EC2 instance.

It would be really helpful if someone could point me in the right direction.

ug911 avatar May 20 '20 15:05 ug911

@ug911 Thanks for reaching out. Administrator access is required to create a cluster. If I understand correctly, does your EC2 instance have an admin IAM role? If so, it may be possible to support your use case (although we do not today, I can look into what this might involve).

It will still be necessary to have an AWS Key and Secret Key to give to the Cortex operator, however this can have a much narrower set of permissions. Please see https://www.cortex.dev/miscellaneous/security#iam-permissions

As we explore if this will be possible, in the short term there are two options:

  1. The DevOps team can spin up the cluster, and then you can connect your Cortex CLI to the cluster by having an AWS Key/Secret Key for any IAM user in the AWS account (no special permissions are required). You would connect your CLI by running cortex env configure aws once the cluster is running.

  2. The DevOps team can give you two sets of keys, one with admin access and one with the permissions listed here. You can set the appropriate cluster configuration / environment variables when spinning up your cluster (described here). Then once the cluster is running, you can revoke the admin credentials (you may need new admin credentials when you want to spin the cluster down).

Would one of these options work for you?

deliahu avatar May 20 '20 16:05 deliahu

Thanks for your suggestion @deliahu. I am currently using Option 1 to deploy and have got a DevOps engineer on board who would take care of the security issues for now.

ug911 avatar May 28 '20 21:05 ug911