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

Not working for showing groups information #18

Open
posquit0 opened this issue Mar 11, 2022 · 5 comments
Open

Not working for showing groups information #18

posquit0 opened this issue Mar 11, 2022 · 5 comments

Comments

@posquit0
Copy link

posquit0 commented Mar 11, 2022

Problem

It works when I try kubectl whoami --all command to AWS EKS cluster via aws-iam-authenticator default authentication method.

It doesn't work when I try kubectl whoami --all command to AWS EKS cluster via different OIDC Identity Provider authentication. In my case, I tried with Okta OIDC identity provider. The output is same with kubectl whoami command.

@rajatjindal
Copy link
Owner

Hi @posquit0

thanks for reporting the issue.

is it possible for you to please submit a PR for this? I don't have access to EKS cluster setup.

Thanks
Rajat Jindal

@rajatjindal
Copy link
Owner

rajatjindal commented Aug 1, 2022

I just tried with onelogin OIDC provider + EKS, and it seems to have worked. and showing me all groups that I am part of.

could you please try once more.

@posquit0
Copy link
Author

posquit0 commented Aug 3, 2022

Hi, thank you for following this issue. I'm so glad to hear that.
I tried with v0.0.44, but it just same outputs.

What is your configuration for users[].user.exec.command and users[].user.exec.args in .kube/config
I used kubectl command and oidc-login args.

@rajatjindal
Copy link
Owner

i am using a custom login plugin instead of oidc-login, but i don't think that matters. We make use of k8s api calls to fetch whoami info.

could you please add some logging on your laptop and help submit a PR for this?

@asaf400
Copy link

asaf400 commented Nov 30, 2022

I found a solution for a related issue,

in order for kubectl-whoami to show the ARN information for a user,
it is required that the k8s role assigned to the user\group would have this rule:

  • apiGroups: [ "authentication.k8s.io" ]
    resources: [ "tokenreviews" ]
    verbs: [ "create" ]

Without this rule within a ClusterRole assigned to that user,
extracting ARN is not possible..

Sorry if this isn't relevant, but I did see that both printing Groups and ARNs are within the same if condition.
Anyways, @rajatjindal you might want to add that information in the README.md, maybe troubleshooting section?

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