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

vault auth should not show token in output #2758

Closed
blalor opened this issue May 23, 2017 · 10 comments
Closed

vault auth should not show token in output #2758

blalor opened this issue May 23, 2017 · 10 comments

Comments

@blalor
Copy link
Contributor

blalor commented May 23, 2017

The vault auth command returns the token to the console. This strikes me as an anti-pattern, especially when users don't grasp the importance and sensitivity of the Vault token: I've had more than one user share the output of vault auth with others.

@jefferai
Copy link
Member

What do you suggest should be done instead? While we could probably add a flag to suppress this output, novice users won't know to use it anyways.

@andrewsav-bt
Copy link

@jefferai I'd like a flag, so it's not stored in the log. I'm using vault CLI as part of a provisioning process that kicks off from TeamCity powershell script. TeamCity collects stdout / stderr to execution log. This information is valuable in case vault auth command fails for any reason. However, storing the succesfully generating token in the log file is something that I'd like to avoid. Currently it's quite binary, I can suppress the whole output (/dev/null) or I can include the whole output, including the token. I'd like to have a middle ground.

@jefferai
Copy link
Member

I don't understand what you're asking for. The auth command is meant to be interactive. If it's not printed, what is the behavior you're looking for? Why not just use the API directly in that case?

@AndrewSav
Copy link

@jefferai

I don't understand what you're asking for.

I'm supporting your idea of adding a flag to suppress the output of the token.

Why not just use the API directly in that case?

Vault cli is easy to use. Calling API directly with powershell can be problematic (not many examples around the net, not easy to get support, since it's not a mainstream use case) the powershell wrapper is less then ideal, since it tries to mimic the cli, which in my view a bit pointless.

@jefferai
Copy link
Member

The output of the command is easily suppressed via normal shell mechanisms.

jefferai added a commit that referenced this issue Apr 25, 2018
Trivially manually tested

Closes #2758
jefferai added a commit that referenced this issue Apr 25, 2018
Trivially manually tested

Closes #2758
@ericfrederich
Copy link

Can we re-open this issue until there is documentation for this? The documentation for login doesn't mention this feature.

@jefferai
Copy link
Member

jefferai commented Mar 8, 2019

It's in the output of vault login -h. I'll add it to the docs though, no need to reopen.

@tino
Copy link

tino commented Oct 8, 2020

What is the use of Token (will be hidden): that is displayed, when the token is echoed right back at you.

I would say hiding this should be the default. Usually you don't care about the token, as it is stored for you and you can interact with vault without actually knowing or accessing it.

@wernerfred
Copy link

100% agree. It is really confusing seeing the extra added message (will be hidden) but then printing it directly after hitting enter 😕 💻

@modbender
Copy link

Is it possible to login silently?

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

8 participants