AGWA / git-crypt

Transparent file encryption in git
https://www.agwa.name/projects/git-crypt/
GNU General Public License v3.0
8.18k stars 475 forks source link

Git-crypt workflow - deployment to multiple servers or circleci/travisci #153

Closed AvnerCohen closed 6 years ago

AvnerCohen commented 6 years ago

Trying to understanding the full workflow of a git-crypt based secret keeping solution.

The tool itself works pretty nicely when on a dev machine, even scaling to multiple developers seems to work fine.

However, it is not clear to me how will this work when deployed to a multiple servers on a cloud, some are created on-demand:

  1. Challenge of unattended creation of GPG key on the new server (someone needs to create the passphrase, or is it in a source control, and than, what is all this even worth?)

  2. Once a GPG is created, how is it being added to the ring?

Say we decide to skip (1) and just share a key across servers, how is the passphrase being supplied as part of the "git-crypt unlock" process when a new server is created?

( Tried a stack-overflow first: https://stackoverflow.com/questions/51168048/git-crypt-workflow-deployment-to-multiple-servers-or-circleci-travisci

Will try here as well. )

alerque commented 6 years ago

As I commented on SO, I'm nut sure why this question is directed at git-crypt, shouldn't adding a key to a GPG ring or injecting some other passphrase variable be part of your system setup and deployment? What git-crypt handles is farther down the pipeline than where than sort of system prep should happen. What platform are you using?

AvnerCohen commented 6 years ago

Thanks @alerque appreciate you taking the time to read and reply.

To be clear this is not in any way directed towards git-crypt or suggesting anything is wrong with the git-crypt solution. This is about a new-comer, trying to understand what is the best-practice or possible workflow I should follow.

We are running CentOS machines, We use AWS, and CloudFormation to create our servers, some of which are started via autoscaling rules.

Talking with others, I've noticed some people will build docker containers that already contained an unlocked version of the keys, such that the "deployment" and the "build" process are separated, this is one option to resolve the complexity.

What I'm trying to understand, is what are other possible workflows. Thanks.

alerque commented 6 years ago

I've taken a stab at answering this on SO. Perhaps if that doesn't answer it for you you could edit your question there to clarify or ask something specific about AWS CloudFormation. I know there is an EC2 API for injecting secrets including key files into an API that can be read from inside the machines, but that is somewhat out of scope for this Github issue. I suggest this issue can probably be closed as git-crypt has relatively little role to play in this equation.

AvnerCohen commented 6 years ago

@alerque thank you very much for taking the time to review this. Hopefully others will benefit from this as well. If anything more is needed, will continue that on SO.