git-secret
You also need version control over secrets.
git-secret
is a bash script that extends git
to safely track secret files. As of writing this article, it is version 0.5.0-alpha1.
The basic workflow is as follows:
git secret add
: start treating a file as a secret file,git secret hide
: encrypt all the secret files using other members' public GPG keys,git add
,git commit
, andgit push
: add the encrypted files and push them to the repository, andgit pull
andgit secret reveal
: pull the repo with secret files and decrypt the secret files.
Some of the prominent merits of using git-secret
are the following.
- You can version control secrets.
- All the necessary files to build the project are in the git repo.
- You can use this method of sharing secret files in any kind of project.
The downside of using git-secret
arises from the requirement that all of the contributors to the project have to manage the GPG (The GnuPrivacy Guard) keys of everybody, i.e. each of the N
contributors has to manage N
GPG keys.
- All the members have to create GPG asymmetric keys and share them with the other members.
- You have to encrypt secret files using the repo members' public keys so that everybody can decrypt them later.
Side note: GPG keys are different from SSH keys as GPG public keys start with -----BEGIN PGP PUBLIC KEY BLOCK-----.