Ask HN: How does your company manage its encryption keys?
488 pointsWe 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 commentsIn 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
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.
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...
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.
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?
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.
Application repos have the encrypted secrets (meta) stored in their repos using Ansible-vault and the .vault_keys are stored in Bitwarden.
All comments shown.
Couldn't load more comments. Check your connection and try again.