StackExchange / blackbox

Safely store secrets in Git/Mercurial/Subversion
MIT License
6.69k stars 370 forks source link

Init Blackbox with an existing keyring? #266

Open thedjdoorn opened 6 years ago

thedjdoorn commented 6 years ago

Suppose one were to export a GPG keyring for user A, B, C and D, would it be possible to use it with Blackbox rather than running blackbox_addadmin for every user? This would be a really neat feature for large teams or teams that'd like get started with Blackbox but have a lot of repositories.

tlimoncelli commented 6 years ago

Could you post some shell example of how to do that?

thedjdoorn commented 6 years ago

Well, correct me if I'm wrong, but pubring.kbx is basically a collection of public keys and an encrypted version of the AES cipher that's used to encrypt the files for every public key, right?

So maybe if we could do this:

$ blackbox_initialize --from ../other-project/.blackbox/pubring.kbx

That'd be a lot easier than:

$ blackbox_initialize
$ blackbox_addadmin a@domain.com
$ blackbox_addadmin b@domain.com
$ blackbox_addadmin c@domain.com

Of course it would be smart to replace the AES cipher afterwards, in a blackbox_update_all_files way.

tlimoncelli commented 6 years ago

Assuming everyone in the .kbx should have access is risky. I'd rather specify the path to the repo's .blackbox directory so that the blackbox-admins.txt can be read and used to decide which to admins to pull over.

This seems like a good starter PR if we can get a volunteer, especially someone that knows GPG very well.