Sidenote: I really like the cookie consent form on this site. It's unobtrusive, clear, opt-out by default and the highlighted and only button is "Continue to site". And it even has a built-in GDPR request form! Bravo to https://www.clym.io/ Nice article, covers the basics well. Credential files seem like simplest way to go and are secure enough for most local uses. For anything more involved a secrets manager is prob…
How to handle secrets on the command line
11–20 of 77 posts
Re: How to handle secrets on the command line
#12Re: How to handle secrets on the command line
#13Sidenote: I really like the cookie consent form on this site. It's unobtrusive, clear, opt-out by default and the highlighted and only button is "Continue to site". And it even has a built-in GDPR request form! Bravo to https://www.clym.io/ Nice article, covers the basics well. Credential files seem like simplest way to go and are secure enough for most local uses. For anything more involved a secrets manager is prob…
About the cookie: just install the extensions `CookieAutoDelete` and `I don't care about cookies`. No more cookie warnings, no more privacy problems. About the article: TL;DR: use a secrets file.
Re: How to handle secrets on the command line
#14The only annoying thing about `pass` is the generic name, so searching for information on it, or dealing with issues is a pita. Luckily, there are few.
Edit: I was wrong about what this article covers. Which is how to pass secrets to processes without leaking to `ps` or audit log.
----
Pass is still worth a look, https://www.passwordstore.org/
Keeping the password storage in a gitlab repo makes it very useful for managing those secrets internally. Keep the list of public gpg keys for each team member, and a README, some helping initialization script for setting it up, and that's pretty much it.
Then, all cases presented where the command would either be used directly in the command line, or within another script, is just replaced with a call to
$(pass the/secret/we/need)Re: How to handle secrets on the command line
#15> Some operating systems still make every process’s environment variables world readable. (But, in all the Linuxes I’ve seen, /proc/ /environ is not world-readable.) A couple years ago this came up and someone made this claim, but no one could ever name an OS where this is the case. Maybe someone on HN knows one? :)
Re: How to handle secrets on the command line
#16No mention of `pass`? Certainly solves all my needs, and works well for version controlling secrets across a team. The only annoying thing about `pass` is the generic name, so searching for information on it, or dealing with issues is a pita. Luckily, there are few. Edit: I was wrong about what this article covers. Which is how to pass secrets to processes without leaking to `ps` or audit log. ---- Pass is still wort…
Re: How to handle secrets on the command line
#17On macOS, you can use pbcopy and pbpaste from/to the clipboard. On Linux, that's:
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
Or use secret files or something like Vault for automation.Re: How to handle secrets on the command line
#18No mention of `pass`? Certainly solves all my needs, and works well for version controlling secrets across a team. The only annoying thing about `pass` is the generic name, so searching for information on it, or dealing with issues is a pita. Luckily, there are few. Edit: I was wrong about what this article covers. Which is how to pass secrets to processes without leaking to `ps` or audit log. ---- Pass is still wort…
How does pass solve this problem? Surely entering "command `pass accountdata`" has the same problem that the secret shows up in ps as command's argument.
A few comments on the actual article, which was a lot more insightful than I had thought:
- Protecting yourself from an audit logs is not really worth the effort, as the audit log should be treated as confidential as the secrets themselves.
- Utilities can themselves hide arguments, and will not show on the ps output. For example, `mysqlsh` shows as `--password=********`, as does `mysql`. I'm not 100% if modifying argv data has any effect on /proc, but then again, if you are protecting yourself from something that can access /proc (i.e. root), then nothing will work in the end. Protecting yourself from a rogue process that can monitor `ps` is also already a lost battle.
Re: How to handle secrets on the command line
#19If the concerns are just shell history and process info: On macOS, you can use pbcopy and pbpaste from/to the clipboard. On Linux, that's: alias pbcopy='xclip -selection clipboard' alias pbpaste='xclip -selection clipboard -o' Or use secret files or something like Vault for automation.
Re: How to handle secrets on the command line
#20Earlier quoted context omitted.
About the cookie: just install the extensions `CookieAutoDelete` and `I don't care about cookies`. No more cookie warnings, no more privacy problems. About the article: TL;DR: use a secrets file.
How is that different/better than uBlock with annoyances filters turned on?
The downside is that you will need to whitelist every site that you want to remember your login/settings for when revisiting them.