jupyterhub / team-compass

A repository for team interaction, syncing, and handling meeting notes across the JupyterHub ecosystem.
http://jupyterhub-team-compass.readthedocs.io
62 stars 33 forks source link

Use `sops` instead of `git-crypt` + `ssh-vault` #473

Open choldgraf opened 2 years ago

choldgraf commented 2 years ago

Proposed change

I just spent 30 minutes trying to set up git-crypt and ssh-vault again from scratch, and I cannot for the life of me figure it out. What do people think about switching our secrets authentication to instead use the sops tools from mozilla? We've been using it in 2i2c, and doing authentication via gcloud instead of via passing around a private key. This seems like a more streamlined and secure process (since we can more easily give and take away access, and since it'll be explicit who has access because it will depend on their membership in the project).

In case it is helpful, here is the 2i2c team documentation on sops. We have been using it for a while and it has been quite nice IMO!

Alternative options

We can improve the documentation around how to install ssh-vault and git-crypt, and how to use them to decrypt secrets.

Who would use this feature?

Any team member who needs access to these secrets!

choldgraf commented 2 years ago

Note for future - here is what I have tried to get git-crypt working, but still without success:

manics commented 2 years ago

I don't have access to any git-crypt secrets but from the description sops with external auth sounds sensible!

If you're re-encrypting secrets as part of this process it might be a good time to rotate them?

Is this related to the OIDC integration between GitHub workflows and cloud providers which means you can get rid of the hard-coded secrets needed to authenticate the workflow for the deploy? https://docs.github.com/en/actions/deployment/security-hardening-your-deployments

minrk commented 2 years ago

I'm fine with any reasonable secret-sharing tool folks like. Can sops encrypt whole files? I think we do need that.

sgibson91 commented 2 years ago

Can sops encrypt whole files?

Yes, this is primarily how we use it at 2i2c :)

sgibson91 commented 2 years ago

you can get rid of the hard-coded secrets needed to authenticate the workflow for the deploy

One key is required to authorise the workflow to get access to the SOPS encryption key: e.g., a Service Account if your backend is in Google Key Management. This is 2i2c's deployment file if it helps https://github.com/2i2c-org/infrastructure/blob/master/.github/workflows/deploy-hubs.yaml

minrk commented 2 years ago

Gotcha, I saw notes about encrypting lines instead of files. 👍 to anything that makes folks' lives easier. I'll let one of the 2i2c people who has experience with sops take the lead on migration, if folks want to do that.