271 points · by smartmic · 4y ago · 148 comments
It's is a bash script that makes it convenient and easy to use gpg2, the OpenPGP encryption tool. Frankly, I'm kind of shocked at how difficult it is to use the gpg2 command line utility. Clearly it's an extremely powerful tool, but it's written with the assumption that the user has a very deep understanding of how encryption and key signing work. To use `pass` effectively you should have a basic understanding of encryption, but unlike gpg2 you don't need to dedicate a week to grok the manpage.
[0] https://chiselapp.com/user/rkeene/repository/hunter2/ [1] https://github.com/rkeene/hunter2 (mirror)
Did you have to do that manually at one time? All the keypairs that I make start out that way when created.
When creating a keypair for pass all you have to do is generate the key using defaults while remembering a bit of the user ID to give to pass.
If your passwords are the only part of your password manager you think are secret, then you're probably not considering the utility of an enumeration of all your network handles. Mine aren't very interesting, but I wouldn't post that on GitHub, even in a private repo.
I love pass and use it. But when I need to carry my password database around, I don't rely on pass alone - I throw the pass database in a Veracrypt container. That way if my flash drive is stolen, it's just an encrypted blob.
Seems like pass wants to use the Unix philosophy of “do one thing well” so it relies on gpg for encryption instead of rolling its own.
But simple and user-friendly UX design is hard. As a user of `pass`, I'm grateful for what I have.
https://www.openbsd.org/papers/bsdcan-signify.html
> There are no key servers for signify. No web of trust. Just keys.
I'm not sure how that would work for quorum publishing, which guards against any single set of credentials being compromised by requiring multiple trusted signatories. The idea is that packages are signed by multiple identities, and if as a downstream user, you trust enough of those identities to form a quorum (2, or 3, or some score-based criteria), then you consider the release trustworthy enough to accept automatically. (The underlying theory is just multifactor auth.)
Downstream users need some way of determining how to trust keys, and that mechanism should be decentralized. This seems to be at odds with the priority the BSD authors place on key rotation:
> After each release of OpenBSD, we generate a new key pair for the release after next. That's plus two. For example, after 5.6 was released, keys for 5.8 were generated. This way, the 5.8 keys are then included in the 5.7 release. So, if you upgrade every release, you will have an unbroken chain of keys back to your initial installation.
So it sounds like there's a single set of keys for each release, which has to be kept safe. I'm sure that the OpenBSD folks take great care, but the idea of quorum publishing is to require multiple factors so that an attacker has to compromise multiple identities to spoof a release.
To fix this as well pass it into curl as a config via eg: curl [...] -K- <<< "--header auth:$(pass mysecret)"
What if non-root could see their own processes in detail, but only the program name for other users' processes?
Would that break a lot of other things?
Individual units can opt-in to this behaviour with the ProtectProc= option though. But I don't think there's currently a good way to apply it to users' interactive processes.
https://www.cyberciti.biz/faq/linux-hide-processes-from-othe...
Biggest surprise is that people can't run top/ps to see where load is coming from, but that aside I never noticed any particular downsides.
sudo mount -o remount,hidepid=1 /proc
At which point you might as well ask why do you need to see other users processes at all? And indeed, that is an option in grsec. I don't think it causes any major breakage, but there are probably some xkcd #1172 sort of things that break.
edit: apparently there is nowdays also options in mainline for that too: https://pipo.blog/articles/20130930-hidepid-process-hiding and also possibly with selinux?
Bind this script to a keybinding, and it will load all your passwords into dmenu and let you type the first few characters of a website name, then copy the password to the clipboard. No CLI needed.
Also, Password Store by Harsh Shandilya on Android is a wonderful little tool. Too pity is has only two sponsors on Github.
Reason is that you can use e.g. YubiKey to unlock individual entries on touch, this means that you can't lose whole password database on ransomware attack, (unless the ransomware has been there for a very long time).
Filippo Valsorda wrote about this: https://blog.filippo.io/touch-to-operate-password-store-yubi...
With YubiKey you can make the GPG private key on offline machine and upload it to YubiKey. This way you can always have a offline backup of your private key, and thus you can backup your password database too.
Could also disable the touch to decrypt feature while you performed the rekey?
Edit: oh. Adding a new key, not password. I see how I misread.
export SECRET_API_TOKEN={{ pass "api/token" | quote }}
For more info see https://github.com/twpayne/chezmoi/blob/master/docs/HOWTO.md... and https://github.com/twpayne/chezmoi/blob/master/README.md.[1] https://masterminds.github.io/sprig/strings.html [2] https://pkg.go.dev/text/template
https://askubuntu.com/questions/354915/quote-command-in-the-...
Works well enough for us.
1. https://medium.com/@davidpiegza/using-pass-in-a-team-1aa7adf...
I'd like to see something similar but with age support .
Pasting my password into a form isn't that bad, and it feels far safer.
`fzf-dmenu` spawns an alacritty window running fzf over given input.
`pass-dmenu` calls the former with available password names; takes the result (if any) and decrypts & types it with `pass show $result | xdotool type --file -`.
Instead of clicking "Add to Firefox", you can right-click and "Save Link As..."
pass lets you use GPG-smartcards, and many of those (such as Yubikeys) will let you enforce touch-policies for signing/encruption.
As a combination of both these however, I must touch my Yubikey every time I pull a new docker image.
Another cool use-case is that I use the terraform-pass-provider to save secrets for my personal terraform project.
This makes it easy to fill in card info online using the same password tools you're already using (passmenu, rofipass, etc.), without needing to go find your wallet, or rely on your browser's form auto-fill database (and worry about hidden fields attempting to exfiltrate that auto-fill data).
I'm tempted to use `pass` to store TOTP seeds as well, but this seems like a bad idea because you'd be putting both factors in one place. Maybe a separate pass db stored offline or something...
kubectl create secret generic -o yaml --dry-run \
--from-literal "foo=$(pass show foo)"
foo | kubectl apply -f -
I was very pleased with it - It was simple enough for developers to use where necessary, easy to distribute passwords, and worked very well.The next guy ripped it out and replaced with Vault and none of the passwords have been rotated since.
Instead, stuff the creds into pass, and since dotenv leverages bash, you can put substitutions in your .envrc file. Bonus, now that the creds are in a personal secured repo, you don't have to go hunting for the creds every time you want to spin up a new dev machine. (you do unfortunately still have to migrate your .envrc, I tried writing git tooling to make it easier but I could never find a convenient place to store them. I have ideas to extend git to try out the next time I want to iterate on this)
This does require your app to be properly configurable with environment variables, meaning if an envvar is present, it should override all other settings. Envvars don't get set by accident so they should be treated as the ultimate settings. This is usually the case with most frameworks but I've run into Node apps where this wasn't the case. Maddening.
In wayland you can pipe the password into wl-copy -o so it will only be pasted once then disappear.
In Xorg you'd need a callback after running pass that runs xclip -i /dev/null some time after the password is copied.
There is no good solution to this in Linux that does not involve discipline.
vault_password_file = tools/vault.sh
In my tools/vault.sh I have: echo -n $(pass infrastructure/ansible-vault)
This lets me store my ansible vault master password for managing my personal infrastructure inside pass. I like it.[1]: https://docs.ansible.com/ansible/latest/collections/communit...
For example I should like a 1-character password, from the alphabet of A, B and C.
So that's 2 bits. We read two bits (awkward, the random device is of course byte oriented). Now, we have a 2-bit value and we're trying to pick A, B or C. But what do we do with the 4th possibility from our 2-bit value?
We could decide too bad we'll treat it as A (or B, or C) anyway, but now we've introduced a non-random bias to our supposedly random password.
The non-horrible option is to throw away this possibility and read two more bits hoping for a different outcome. The exact same algorithm pass uses, except you've added the extra complexity of reading less than one byte at a time from the device...
tr -dc "0-z" < /dev/urandom | head -c10• opens you up to timing attacks on your PRNG (unlikely to be a problem in real life, but you never know)
• might run forever
That is, for most people it is well outside the attack surface that they need to care about.
Stellar. Absolutely stellar piece of software. Always does exactly what I want it to, never gets in my way ever!
Works wonderfully and with OTPauth also.
Run a bare git repo on your own network and there is no reason to use Bitwarden.
Edit - and for those that are in AWS, you can use pass along with aws-vault to keep your ~/.aws creds in check. https://github.com/99designs/aws-vault
https://github.com/roddhjav/pass-import
maybe you can "bridge it" with bitwarden-cli via some export/import commands or may as well use bitwarden-cli directly (but i find the pass ui much bettwer than bw cli command)
Just setup isync yesterday. So close to having freedom to move from Google whenever I want