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

oidc-client-secret in kubeconfig.yaml, how secure is it? #1088

Closed
ktzsolt opened this issue May 6, 2024 · 2 comments
Closed

oidc-client-secret in kubeconfig.yaml, how secure is it? #1088

ktzsolt opened this issue May 6, 2024 · 2 comments
Labels
question Further information is requested

Comments

@ktzsolt
Copy link

ktzsolt commented May 6, 2024

Describe the question

I have set up kubelogin with (onprem) gitlab, all is working fine, I get this in my kubeconfig.yaml:

users:
- name: oidc
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - oidc-login
      - get-token
      - --oidc-issuer-url=https://mygitlab.com
      - --oidc-client-id=...
      - --oidc-client-secret=....
      - --oidc-extra-scope=email

The set up procedure says that I can share this kubeconfig with my team, and it works fine with rolebindings as it is supposed.

I have set scopes only for openid, profile, email:
kép

My question is how secure is it to share this kubeconfig file that includes the oidc-client-id and oidc-client-secret. If the secret gets compromised (e.g.: pushed to a public repo ) can it be used to do harm in any way?

Thank you!

Your environment

  • OS: ubuntu
  • kubelogin version: v1.28.0
  • kubectl version: v1.26.3
  • OpenID Connect provider: gitlab (self hosted)
@ktzsolt ktzsolt added the question Further information is requested label May 6, 2024
@davidfrickert
Copy link

davidfrickert commented May 18, 2024

If you commit that to a repo then the client essentially becomes a public client. In these cases, where the secret cannot be safely protected you should use --oidc-use-pkce. It should be fine.

@ktzsolt
Copy link
Author

ktzsolt commented May 21, 2024

Hi @davidfrickert!

I replaced the - --oidc-client-secret=... to - --oidc-use-pkce and rm -rf the ~/.kube/cache dir and the auth works, thanks!

@ktzsolt ktzsolt closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants