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

Use system:node:$nodeName as username for worker nodes #57

Closed
rtripat opened this issue Mar 12, 2018 · 3 comments
Closed

Use system:node:$nodeName as username for worker nodes #57

rtripat opened this issue Mar 12, 2018 · 3 comments

Comments

@rtripat
Copy link

rtripat commented Mar 12, 2018

To use features like TLS bootstrapping of nodes the username returned by the authenticator for nodes should be of the format "system:node:$nodeName" where $nodeName is the private DNS for EC2 instances like ip-10-0-125-14.us-west-2.compute.internal

The authenticator can accept an additional IAM role as a parameter or use the EC2 instance role to query EC2 DescribeInstances API and map instance id (returned by GetCallerIdentity) to private DNS name of the instance.

@mattlandis
Copy link
Contributor

I propose we add a EC2DescribeInstancesRole to the configuration for the server and a new value {{ec2PrivateDNS}} to that can be used in the parameter substitution for the configmap. This value causes the authenticator to to use the provided role to call ec2 Describe Instance for the instance and get the private dns name.

Should it be one role or a map of account to role?

An alternative would be to have the authenticator token generation know that it is supposed to generate the dns name as the session for role on the assumed that signs the sts get caller identity request. I think this approach will over complicate the role setup for the instances and should not be used in favor of the first approach, but wanted to call it out as a possibility.

@rtripat
Copy link
Author

rtripat commented Mar 13, 2018

Since the authenticator supports multiple accounts then it has to be a map from account to roles. I'd like it to default to using the Ec2 instance role on which its running if the override "EC2DescribeInstancesRole" isn't provided. This makes it simpler to run the authenticator in the same account as Node groups.

I also thought about the second approach but decided against it since we cannot trust the token generator to embed the correct value of private DNS.

@nckturner
Copy link
Contributor

@matlan @rtripat How about only looking up the private DNS when using a new mapNodes key where the username is not specified:

mapNodes:
  - roleARN: arn:aws:iam::000000000000:role/KubernetesNodeRole
    ec2DescribeInstancesRoleARN: arn:aws:iam::000000000000:role/RoleInNodeAccount
    groups:
    - system:bootstrappers
    - aws:instances

and similarly, if the ec2DescribeInstancesRoleARN isn't provided then the authenticator will use its own EC2 Instance Role.

This gives the user a better idea of when the authenticator will lookup private DNS.

joanayma pushed a commit to joanayma/aws-iam-authenticator that referenced this issue Aug 11, 2021
joanayma pushed a commit to joanayma/aws-iam-authenticator that referenced this issue Aug 11, 2021
joanayma pushed a commit to joanayma/aws-iam-authenticator that referenced this issue Aug 11, 2021
joanayma pushed a commit to joanayma/aws-iam-authenticator that referenced this issue Aug 11, 2021
joanayma pushed a commit to joanayma/aws-iam-authenticator that referenced this issue Aug 11, 2021
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

3 participants