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

Do AKS support oidc token generated for azureAD config? #2916

Closed
ashu8912 opened this issue Apr 28, 2022 · 10 comments
Closed

Do AKS support oidc token generated for azureAD config? #2916

ashu8912 opened this issue Apr 28, 2022 · 10 comments
Labels
resolution/answer-provided Provided answer to issue, question or feedback.

Comments

@ashu8912
Copy link
Member

ashu8912 commented Apr 28, 2022

I wanted to know if I have an oidc token generated for azure AD config using the go-oidc package will that work with accessing an AKS cluster that has the azure AD config enabled??

What happened:
I took an oidc token generated using go-oidc package and requested on the resources on AKS cluster but it doesn't seem to work, I get a 401 unauthorized errror

How to reproduce it (as minimally and precisely as possible):
Create a cluster with azure AD enabled, register an application on azureAD and use the endpoints to get a oidc token(using go-oidc package) use the token to access the cluster resources.
Note: I already have a clusterrole and clusterrolebinding that allows the azureAD group to access the resources. I also have RBAC enabled on my cluster.
Environment:

  • Kubernetes version (use kubectl version): Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.6", GitCommit:"ad3338546da947756e8a88aa6822e9c11e7eac22", GitTreeState:"clean", BuildDate:"2022-04-14T08:49:13Z", GoVersion:"go1.17.9", Compiler:"gc", Platform:"linux/amd64"}
  • Size of cluster (how many worker nodes are in the cluster?) 1
@ghost ghost added the triage label Apr 28, 2022
@ghost
Copy link

ghost commented Apr 28, 2022

Hi ashu8912, AKS bot here 👋
Thank you for posting on the AKS Repo, I'll do my best to get a kind human from the AKS team to assist you.

I might be just a bot, but I'm told my suggestions are normally quite good, as such:

  1. If this case is urgent, please open a Support Request so that our 24/7 support team may help you faster.
  2. Please abide by the AKS repo Guidelines and Code of Conduct.
  3. If you're having an issue, could it be described on the AKS Troubleshooting guides or AKS Diagnostics?
  4. Make sure your subscribed to the AKS Release Notes to keep up to date with all that's new on AKS.
  5. Make sure there isn't a duplicate of this issue already reported. If there is, feel free to close this one and '+1' the existing issue.
  6. If you have a question, do take a look at our AKS FAQ. We place the most common ones there!

@ghost ghost added the action-required label Apr 30, 2022
@ghost
Copy link

ghost commented Apr 30, 2022

Triage required from @Azure/aks-pm

@CocoWang-wql
Copy link
Contributor

Hello @ashu8912, currently AKS cluster does not support go-oidc. We have a feature named "External Identity Provider" and it's in plan: #2861

@ghost ghost removed the action-required label Apr 30, 2022
@CocoWang-wql CocoWang-wql added resolution/answer-provided Provided answer to issue, question or feedback. and removed triage labels Apr 30, 2022
@ashu8912
Copy link
Member Author

ashu8912 commented May 1, 2022

Hey @CocoWang-wql thank you for your answer one small question what if i use the access token generated from oauth flow will that work?? Also i tried a msal generated token as well and used it to access the aks cluster which has azure ad and kubernetes RBAC enabled but it too didn't worked.

@ashu8912
Copy link
Member Author

ashu8912 commented May 2, 2022

Also @CocoWang-wql what do you mean by when you say AKS doesn't supports go-oidc does it mean if i take a azureAD app config and generate a access token via go-oidc that will not work??

@miwithro
Copy link
Contributor

miwithro commented May 2, 2022

@ashu8912 we are working on adding in OIDC capabilities into AKS and Azure AD. Have a look at https://azure.github.io/azure-workload-identity/docs/ this is a project that leverages "Service Account Token Volume Projection" and "OIDC Issuer" to issue a token to a pod to access Azure resources. It is based on App Registration today, but we are adding in Managed Identity support very soon.

@ashu8912
Copy link
Member Author

ashu8912 commented May 3, 2022

thanks @miwithro, can i test this project with my AKS cluster??

@miwithro
Copy link
Contributor

miwithro commented May 3, 2022

@ashu8912 of course

@ashu8912
Copy link
Member Author

ashu8912 commented May 4, 2022

Thanks @miwithro I will try setting up the oidc issuer on my cluster and see if it works for me.

@ghost
Copy link

ghost commented May 6, 2022

Thanks for reaching out. I'm closing this issue as it was marked with "Answer Provided" and it hasn't had activity for 2 days.

@ghost ghost closed this as completed May 6, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 5, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution/answer-provided Provided answer to issue, question or feedback.
Projects
None yet
Development

No branches or pull requests

3 participants