Lurker News
We just had an interesting data loss at work, that was due to data being encrypted at rest. We somehow managed to delete the encryption keys (still figuring out how), which became an obvious problem once our main database instance was rebooted.

Luckily we were able to restore the data, but now I (we) really want to learn what a proper setup would look like.
If you have any clear overview reading on the topic I'd be very interested to to know about it.
In particular I'm wondering: how do you back up your encryption keys, or even put them in escrow somewhere? Assuming we don't rotate the keys constantly I would love to just save them in somewhing like a passsword manager that's secured with 2FA/FIDO.
Would love to hear your thoughts!

Comments (238) 101 threads

Earlier comments
gingerlime2 replies#
We use Bitwarden[0] for our secrets. It's open-source with a hosted option. Makes sharing passwords and keys across the team pretty straightforward.

In addition to it, we use envwarden[1], which is a simple open-source wrapper around the Bitwarden CLI to manage our server secrets. It's super simple, but does the job for us well. We can then manage both passwords and keys in one place.
Disclaimer: I created envwarden. I'm not affiliated with Bitwarden in any way however. Just a happy customer.
[0] https://bitwarden.com/
[1] https://github.com/envwarden/envwarden

shekhardesigner#
I didn't know about envwarden till you mentioned it here.

We migrated from bitwarden to offline client machine for the reason that we didn't wanted a copy of our encryption key be available anywhere else online.

lux#
envwarden looks awesome! Is there any potential for the Bitwarden project to incorporate it/make it officially supported?
ComputerGuru#
We commit encryption keys, themselves encrypted, to git alongside the code and everything else. They’re fully versioned and therefore protected against data loss, and we don’t treat dev keys as any different from production keys (just stored in a separate file).

I first wrote about it back in 2017 (1) and we released an open framework for multiple languages/frameworks (2).
1: https://neosmart.net/blog/2017/securestore-a-net-secrets-man...
2: https://neosmart.net/blog/2020/securestore-open-secrets-form...

hellcow1 reply#
We use shh for secrets (https://egt.run/shh).

It's designed to integrate really well with your existing CLI tools like vim, xargs, and diff. It offers user-based permissions, and secrets are encrypted into a single file that's safe to commit into your git repo. We can stream secrets out of it directly to our remote servers during deploys.
Unlike Vault you don't need to manage infra to run it -- it's just a file. Unlike cloud secret managers, there's no lock-in.

ahnick1 reply#
A couple of questions..

1. Does every client have a copy of shh to interact with the secrets? Or are the secrets in the file served from a single centralized node?
2. What is your process of exchanging user keys with shh?
3. If someone leaves the company, what is the process you go through to change the secrets and rotate keys?

hellcow#
1. Every client (i.e. developer) has their own copy of shh but interacts with a shared .shh file in the project root. Secrets can be decrypted locally in memory then streamed to the remote servers over ssh. You could in theory run this on a server to help address your third point.

2. Exchanging public user keys is done via email when an employee starts, then added to the .shh file and committed in the repo.
3. You'd need to write a script for this, which probably involves `shh rm-user {email}`. There is no silver bullet here for changing secrets; since developers have access to secrets, any secret they had would need to be regenerated. `shh` makes no assumptions about how you deploy, what secrets you keep, or their formats.

z3ugma1 reply#
We use Bitwarden https://bitwarden.com/#organizations to store passwords as well as encryption secrets as a backup.

Application repos have the encrypted secrets (meta) stored in their repos using Ansible-vault and the .vault_keys are stored in Bitwarden.

pqdbr#
We do exactly the same.

Load more comments