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

Changing the default path of auth login like kubernetes #143

Closed
EZEDSEA opened this issue Dec 4, 2019 · 17 comments
Closed

Changing the default path of auth login like kubernetes #143

EZEDSEA opened this issue Dec 4, 2019 · 17 comments
Assignees

Comments

@EZEDSEA
Copy link

EZEDSEA commented Dec 4, 2019

I'm wondering if there's a way to change the default path of the kubernetes login.

In the documentation, the CLI allows you to do it:
https://www.vaultproject.io/docs/auth/kubernetes.html

Say for example I wanted to goto: auth/kubernetes-rancher/login

But I noticed in the code for this library, it's based on "mount_point" of some sort. But it's not clear to me how to set this beforehand.

Is this feature missing or am I just not understanding it correctly?

@whatever555
Copy link

having a similar issue here @EZEDSEA. Did you ever find a solution?

@EZEDSEA
Copy link
Author

EZEDSEA commented Feb 12, 2020

The solution we used was basically not use this library for auth login. We made a rest call instead to the endpoint we wanted. And then used this lib after auth.

@MPV
Copy link

MPV commented Nov 18, 2020

I might have run into this also, not sure yet (still troubleshooting).

The way I interpret the documentation, it seems to indicate that this should be supported though?
https://github.com/kr1sp1n/node-vault/blob/master/features.md#vaultkuberneteslogin

Edit: Got it to work by using that feature.

@bchrobot
Copy link

bchrobot commented Jan 7, 2021

@MPV could you share how you got it to work with a custom path?

We have not been able to get the custom path to work with the vault.kubernetesLogin() method and have been making our own request as @EZEDSEA has suggested.

@wsierakowski
Copy link

This can be controlled by the param mount_point as in the example here: https://github.com/kr1sp1n/node-vault/blob/70097269d35a58bb560b5290190093def96c87b1/example/auth_kubernetes.js#L17

The other issue I have is that I would like to add a namespace to the URL as well - like here: <vault_domain>/v1/<name_space>/auth/<mountpoint>/login.

@wsierakowski
Copy link

ok it looks like support for namespaces have been added already: #137

@bchrobot
Copy link

This can be controlled by the param mount_point as in the example here:

https://github.com/kr1sp1n/node-vault/blob/70097269d35a58bb560b5290190093def96c87b1/example/auth_kubernetes.js#L17

enableAuth makes a POST request to /sys/auth/{{mount_point}} to create an auth method on the Vault server. This seems like it a) would require authenticating as a privileged user via a different auth method before enableAuth() could succeed, and b) does not address the more common use case of authenticating against an existing auth method with a non-standard mount point. But I could just be misunderstanding the example.

@aviadhahami
Copy link
Collaborator

Hey folks :)
I'm trying to cleanup all the issues;
Is this issue still a thing? is a feature/fix needed?

@erivandosena
Copy link

hi!

where I can apply the configuration so that my Vault agent authenticates in an API request, for example at: http://vault.vault.svc:8200/v1/auth/kubernetes/myk8s/login instead of: http:// vault.vault.svc:8200/v1/auth/kubernetes/login

@erivandosena
Copy link

Eu também posso ter encontrado isso, ainda não tenho certeza (ainda solucionando problemas).

A maneira como interpreto a documentação parece indicar que isso deve ser suportado? https://github.com/kr1sp1n/node-vault/blob/master/features.md#vaultkuberneteslogin

Editar: funcionou usando esse recurso.

As you did ?

vault.kubernetesLogin
POST /auth/{{mount_point}}{{^mount_point}}kubernetes{{/mount_point}}/login

pankaj-jain11 pushed a commit to pankaj-jain11/node-vault that referenced this issue Feb 8, 2024
kubernetes path can be provided in vault when creating the auth when running a multicluster setup.
defaults to kubernetes.
@pankaj-jain11
Copy link

since its quite old cannot says you can use it now but to any one new you can use the fix i did. You can download the repo in your local and run npm pack

use the tarball created in your projects with entry in package.json using the tarball for node vault

"node-vault": "file:<generated-in-above.tgz>"

@aviadhahami
Copy link
Collaborator

@pankaj-jain11 heya!
would you be able to PR this? I'll merge it asap

@pjlucy
Copy link

pjlucy commented Feb 29, 2024

@aviadhahami #245

aviadhahami pushed a commit that referenced this issue Feb 29, 2024
kubernetes path can be provided in vault when creating the auth when running a multicluster setup.
defaults to kubernetes.
@aviadhahami
Copy link
Collaborator

aviadhahami commented Feb 29, 2024

@pjlucy merged this - thanks!

edit --> one of the CIs failed (the trufflehog🐖 ); please ignore it as I fixed it in 922f847

@aviadhahami
Copy link
Collaborator

@pjlucy can I close this issue?

@pjlucy
Copy link

pjlucy commented Feb 29, 2024

Thanks for the merge :)

@pjlucy
Copy link

pjlucy commented Feb 29, 2024

This can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants