Skip to content

Cluster admin roles #3

Closed
wants to merge 3 commits into from
Closed

Cluster admin roles #3

wants to merge 3 commits into from

Conversation

nangu001
Copy link
Collaborator

@nangu001 nangu001 commented May 9, 2024

Adding cluster-admin-roles for inf-admin-t2 and inf-admin-t3.

Copy link
Contributor

@mcgin314 mcgin314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we discussed.

@badra001
Copy link
Collaborator

I do not want to do this this way. The SSO auth part will vary, and we do not want the use of the specific permissionset as part of it. We need to stick with the TF formatted profile of {account_id}-{alias}.

I want the entirety of the cluster build to use a role which is assumed, r-inf-terraform-eks. This role does not yet exist in every account, but it will through the use of a stackset.

What we need to setup this role is the list of permissions for creating and administering the cluster and all the sub-components that it uses.

Then, the provider would be something like "aws.eks" which is setup using an assume role profile to the r-inf-terraform-eks.

This way, as the cluster is built, we will always have the builder available as this role, and it will simplify access to the k8s components.

This is similar to the cluster admin roles.

Comment on lines +79 to +90
default = [
{
rolearn : "arn:aws-us-gov:iam::224384469011:role/AWSReservedSSO_inf-admin-t3_b200ae7af469cdc8"
aws_rolename : ""
username : "admin"
groups = ["system:masters"]
},
{
rolearn : "arn:aws-us-gov:iam::224384469011:role/AWSReservedSSO_inf-admin-t2_f3912d726991bbfa"
aws_rolename : ""
username : "admin"
groups = ["system:masters"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not hardcode role ARNs here, especially SSO roles. This is not at all portable.

@badra001
Copy link
Collaborator

I do not want to do this this way. The SSO auth part will vary, and we do not want the use of the specific permissionset as part of it. We need to stick with the TF formatted profile of {account_id}-{alias}.

I want the entirety of the cluster build to use a role which is assumed, r-inf-terraform-eks. This role does not yet exist in every account, but it will through the use of a stackset.

What we need to setup this role is the list of permissions for creating and administering the cluster and all the sub-components that it uses.

Then, the provider would be something like "aws.eks" which is setup using an assume role profile to the r-inf-terraform-eks.

This way, as the cluster is built, we will always have the builder available as this role, and it will simplify access to the k8s components.

This is similar to the cluster admin roles.

This is also probably the time to look at the new authentication configuration options. Specifically, I believe we want to use API_AND_CONFIG_MAP.

@badra001
Copy link
Collaborator

I do not want to do this this way. The SSO auth part will vary, and we do not want the use of the specific permissionset as part of it. We need to stick with the TF formatted profile of {account_id}-{alias}.
I want the entirety of the cluster build to use a role which is assumed, r-inf-terraform-eks. This role does not yet exist in every account, but it will through the use of a stackset.
What we need to setup this role is the list of permissions for creating and administering the cluster and all the sub-components that it uses.
Then, the provider would be something like "aws.eks" which is setup using an assume role profile to the r-inf-terraform-eks.
This way, as the cluster is built, we will always have the builder available as this role, and it will simplify access to the k8s components.
This is similar to the cluster admin roles.

This is also probably the time to look at the new authentication configuration options. Specifically, I believe we want to use API_AND_CONFIG_MAP.

We do need someone to research the needed permissions to apply to such a role. I had asked someone months ago, but nothing came out of it.

@morga471
Copy link
Contributor

morga471 commented May 15, 2024

AWS managed policies for Amazon Elastic Kubernetes Service Should we perhaps consider using these for the EKS Permissions boundary you describe?

Keep in mind that AWS managed policies might not grant least-privilege permissions for your specific use cases because they're available for all AWS customers to use. We recommend that you reduce permissions further by defining [customer managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#customer-managed-policies) that are specific to your use cases.

My thought is to start with the Managed Policy as the default used for the r-inf-terraform-eks, then a customer admin can be granted the scoped admin role (or the defined admin role). This way we have the boundary permission represented by the r-inf-terraform-* for a given service. Thoughts?

@badra001
Copy link
Collaborator

AWS managed policies for Amazon Elastic Kubernetes Service Should we perhaps consider using these for the EKS Permissions boundary you describe?

Keep in mind that AWS managed policies might not grant least-privilege permissions for your specific use cases because they're available for all AWS customers to use. We recommend that you reduce permissions further by defining [customer managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#customer-managed-policies) that are specific to your use cases.

My thought is to start with the Managed Policy as the default used for the r-inf-terraform-eks, then a customer admin can be granted the scoped admin role (or the defined admin role). This way we have the boundary permission represented by the r-inf-terraform-* for a given service. Thoughts?

These policies are what is needed by the nodes to RUN EKS, not to provision the EKS necessarily.

I do not intend for a customer to get the r-inf-terraform-eks role. They would be using the cluster admin role (also through an assume role).

@morga471
Copy link
Contributor

https://github.e.it.census.gov/terraform/252903981224-ma5-gov/pull/249
I think that was the reason you wanted this eks role added to the r-inf-terraform role stackset?

@morga471
Copy link
Contributor

superseeded by #18

@morga471 morga471 closed this Sep 10, 2024
@morga471 morga471 deleted the cluster-admin-roles branch October 23, 2024 00:19
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
4 participants