-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add doc warning about shell history logging for commands that accept credentials #3371
Comments
In theory it is a good idea. In practice that seems quite complicated, if not impossible. But... 1. If I remember right, a good trick to know for such cases (at least in bash) is to prefix the command with an empty space so that it is not added to the history. 2. If you omit the value, then it is prompted interactively, and thus the actual token is not added to the history.
|
@sinoroc these two solutions look quite good to me. That would just be a matter of documenting this so people are at least aware of that (small) potential risk. You think it's impossible to patch the current command because it's too dependent on the system you are on? (Eg. deleting the last history line) |
Because as far as I know, no command/binary/program/executable can instruct the calling shell to alter (or not save) the command into its history. I would not know how to do that. And it would need to work with all shells, even ones that might not exist yet. Maybe there are solutions, and I just do not know about them... Even the trick with the leading empty space, might not always work. It seems to work with bash by default, but it actually depends on how the You best bet is to simply not write the secret on the command line directly. |
@sinoroc For me, indeed, the simplest solution is to omit the password. I feel like that should be the standard (documented) way because having a password in the history isn't something I find very safe. On the other hand when someone has access to your local history its very likely that this will not be the only issue. I just noticed that and came here to let you know about that minor issue. I'm still curious about how this could be solved tho. I don't know how commonly the |
Thing is that
Agreed, I believe it should be considered as well.
I would also be interested to see how this could be solved. |
It's also used by zsh. But apparently not by fish. |
We should just add a warning about this risk in the documentation alongside examples talking about configuring secrets. Maybe update the title and description as such. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
I think to make sure private keys/password are secured, we should remove
poetry config
commands that have any sensitive information from the terminal history (or replace sensitive information with stars?):Expected behaviour would be to have:
It seems like a bit of work to make that work in every situation, but on the other hand its probably relatively easy for the most common use cases (bash/zsh/fish). Did anyone worked on that yet?
The text was updated successfully, but these errors were encountered: