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

How to read the root token and use it to call Vault APIs? #324

Closed
apetrut opened this issue Jul 17, 2023 · 1 comment
Closed

How to read the root token and use it to call Vault APIs? #324

apetrut opened this issue Jul 17, 2023 · 1 comment

Comments

@apetrut
Copy link

apetrut commented Jul 17, 2023

Hi,

I am trying to read the root token in a secure way using ReadSecretAsync but without passing the root token in the IAuthMethod.

AuthMethodInfo authMethod = new TokenAuthMethodInfo("123456789");
var vaultClientSettings = new VaultClientSettings("http://127.0.0.1:8200", authMethod);
var vaultClient = new VaultClient(vaultClientSettings);

var secret = await vaultClient.V1.Secrets.KeyValue.V2.ReadSecretAsync("auth/token/root");
var rootToken = secret.Data.Data["token"];

Is there a way to do that programatically and secure?

@rajanadar
Copy link
Owner

@apetrut That's not a valid use case. KV Secret is used to store your own secrets.
Root token is a starting point and you need to have access.

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

2 participants