News for hackers. Stuff that matters.
Re:Vault – A tool for managing secrets by perlgeek on Tuesday April 28, 2015 @03:29PM (#9454578)
It sounds very exciting.

But, the first example made me flinch:

    $ vault write secret/foo value=bar
Don't ever pass passwords on the command line. On linux, other users can see your command line (ps aux), and it usually ends up in a shell's history file.
Re:Vault – A tool for managing secrets by mitchellh on Tuesday April 28, 2015 @03:38PM (#9454633)
Absolutely true! We support values coming from the command-line, stdin, and files: https://vaultproject.io/docs/commands/read-write.html So you should use what you feel is most secure given the data you're entering.
Re:Vault – A tool for managing secrets by sliverstorm on Tuesday April 28, 2015 @04:50PM (#9455078)
I think the argument is something like, why support a method that is insecure nearly all the time and leads less-experienced users to make the wrong choices.

Good security software gently herds the non-expert to make good choices. Too many options, especially specialty risky options, don't help that goal.

Re:Vault – A tool for managing secrets by zobzu on Tuesday April 28, 2015 @05:36PM (#9455301)
true most ppl will do it command line..
Re:Vault – A tool for managing secrets by mpdehaan2 on Wednesday April 29, 2015 @08:29AM (#9457770)
This is why ansible-vault (which is not trying to do the same thing) spawned a temporary editor, and immediately upon save encrypted the file - it doesn't exist in history, nor is there a chance of leaving it behind on disk.

There's probably a way to do what you have launching an editor with stdin, but I'd probably suggest documenting an example, to avoid the risk of leaving the secret around.

Also +1 to removing the insecure history option. Documenting the stdin to use 'cat' or something that's not in the history would probably take care of that one.

Re:Vault – A tool for managing secrets by kylequest on Tuesday April 28, 2015 @07:04PM (#9455635)
Why not use interactive CLI instead of command line CLI (like routers have) to avoid leaks through the shell command history and other related channels?
Re:Vault – A tool for managing secrets by nunull on Wednesday April 29, 2015 @06:20AM (#9457312)
I think what you mean by "interactive CLI" is reading from stdin, which seams to be supported.
Re:Vault – A tool for managing secrets by jolan on Tuesday April 28, 2015 @05:10PM (#9455173)
Hopefully they use setproctitle() to erase it. Pretty sure this is what mysql does:

jolan 4950 0.0 0.0 46164 8820 pts/12 S+ 16:06 0:00 mysql -uroot -px xxxxxxxx

Probably still a race condition and can be viewed before it is erased but at least it would be something.

Re:Vault – A tool for managing secrets by Freaky on Tuesday April 28, 2015 @04:57PM (#9455112)
> On linux, other users can see your command line (ps aux)

On FreeBSD I like doing:

/boot/loader.conf: mac_seeotheruids_load="YES"

/etc/sysctl.conf: security.mac.seeotheruids.enabled="1"

Which restricts users to seeing only their own processes. You can make exceptions for a specific group or users with the same primary group.

I still don't put anything sensitive in a command line, of course.

Re:Vault – A tool for managing secrets by daurnimator on Wednesday April 29, 2015 @02:48AM (#9456785)
on linux you can mount procfs with the option 'hidepid' to similar effect.
Re:Vault – A tool for managing secrets by istvan__ on Tuesday April 28, 2015 @09:38PM (#9456095)
Yes FreeBSD got this one right.
Re:Vault – A tool for managing secrets by odiroot on Tuesday April 28, 2015 @03:33PM (#9454605)
Put a space before the command and it's gone from the history, AFAIR.
Re:Vault – A tool for managing secrets by lenish on Tuesday April 28, 2015 @03:59PM (#9454759)
This is only true in bash if HISTCONTROL contains ignorespace or ignoreboth (ignoreboth implies ignorespace and ignoredups), so you should check that before relying on this functionality.
Re:Vault – A tool for managing secrets by ams6110 on Tuesday April 28, 2015 @03:43PM (#9454660)
Yes but very easy to forget to do. BTDT.
Re:Vault – A tool for managing secrets by msutherl on Tuesday April 28, 2015 @05:26PM (#9455258)
Could you alias "vault" to " vault"?
Re:Vault – A tool for managing secrets by gknoy on Wednesday April 29, 2015 @04:09AM (#9456984)
I doubt it. My history file shows all the git-related aliases I use (st, gd, gd-) rather than the expansions (git status, git diff, git diff --cached).
Re:Vault – A tool for managing secrets by tetha on Wednesday April 29, 2015 @03:01PM (#9460840)
Honestly, I dislike the approach. I don't want to tell my mysql <hello, please allow the user foo to authenticate itself with the password bar> and my webapp <hello webapp, please use the user foo and the password bar for the mysql over there>.

I want to tell the system <look, I have a user foo, and the webapp over there needs access to the mysql over here with that user. Make it so.>

I don't need to know the password my application uses to access the database. I don't WANT that password. No human should ever see this password. And heck, if the system wants to, just swithc passwords every 60 minutes. I don't want to care.

Re:Vault – A tool for managing secrets by eb0la on Wednesday April 29, 2015 @04:00AM (#9456960)
Good point!

When I want to run something on a server and I don't want it to end in the .history file, I always run vi and execute the commands inside it ( <esc>:!command ).

It always shows in the process list; but for short-lived commands the opportunity window is small for an attacker.

Re:Vault – A tool for managing secrets by dmgbrn on Tuesday April 28, 2015 @06:21PM (#9455451)
Unless you're on your personal laptop.

It's a tricky question, one that we've spent a lot of time thinking about at my company (Conjur -- shameless plug, one of our use cases is secrets management). Obviously doing this on a server that others can access/pwn is a bad idea, but that's a very rare use case. Most secrets are being added via the command line from an admin's single user laptop.

In the end, we've settled on what seems to be the same solution as Vault: support other sources (stdin, files, etc.), but allow the command line.

That said, I think you're right that we should look into adding a warning for the CLI tools and placing more emphasis on this fact in our documentation.

Re:Vault – A tool for managing secrets by wslh on Tuesday April 28, 2015 @06:35PM (#9455504)
> Unless you're on your personal laptop.

It persists in your shell history... your notebook is stolen, then...

You can encrypt the filesystem but it is better to not have your secret information disseminated in your filesystem and computer memory.

Re:Vault – A tool for managing secrets by ams6110 on Tuesday April 28, 2015 @03:39PM (#9454641)
How many people these days share their linux machine with anyone else? If you're the only user, first point doesn't matter. History file is a concern, but can be mitigated e.g. setting HISTIGNORE
Re:Vault – A tool for managing secrets by metric10 on Tuesday April 28, 2015 @04:04PM (#9454783)
Depends on the situation. A Linux machine running as a server can still be accessed by multiple people. Also, a "user" could be a compromised process that can execute commands. Using stdin or a properly created file means one less possible attack vector.
Re:Vault – A tool for managing secrets by skywhopper on Tuesday April 28, 2015 @07:00PM (#9455623)
Doesn't storing the secret in a file first violate half the point of this service? Once it's written to disk in plaintext it's just as recoverable as your shell history.
Re:Vault – A tool for managing secrets by ceejayoz on Tuesday April 28, 2015 @04:11PM (#9454843)
All it takes is a WordPress vulnerability that lets someone run `exec` on your server.
Re:Vault – A tool for managing secrets by skywhopper on Tuesday April 28, 2015 @07:04PM (#9455636)
if you the sort to worry about vault's command line being a security risk, you shouldn't be managing your secrets from your wordpress host in the first place.
Re:Vault – A tool for managing secrets by IgorPartola on Tuesday April 28, 2015 @03:48PM (#9454690)
This is true on shared systems. But for example as I am setting up a brand new server, I might do this from there since I know I'm the only user. The second half of your complaint is solved (at least in bash) by adding a space character before the beginning of the command.

Edit: am I wrong? If so, please explain, I really am curious.