Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage secret encryption using sops #293

Open
sgibson91 opened this issue Oct 20, 2020 · 2 comments
Open

Manage secret encryption using sops #293

sgibson91 opened this issue Oct 20, 2020 · 2 comments
Labels
to-be-scoped Ideas that need further scoping

Comments

@sgibson91
Copy link
Collaborator

sgibson91 commented Oct 20, 2020

Using git-crypt would be easier for local development a la mybinder.org-deploy. Docs: https://github.com/AGWA/git-crypt

Instead of git-crypt, let's look at using sops

@sgibson91 sgibson91 added the to-be-scoped Ideas that need further scoping label Oct 20, 2020
@sgibson91
Copy link
Collaborator Author

Pros:

  • Use only one CI vendor (e.g. GitHub Actions and store git-crypt secret as a repo secret)
  • Easier for local deployment (no need to fill out the template)
  • Would simplify the CD pipeline - no reliance on a keyvault or sed templating

@sgibson91
Copy link
Collaborator Author

https://github.com/mozilla/sops

Pros of sops over git-crypt:

  • sops is a bit more clever about encryption that git-crypt. Instead of just turning the whole file into an encrypted binary, it only encrypts the values, leaving the keys untouched (assuming the file you are encrypting is a key:value-pair type such as JSON and YAML). This leaves the file in a much more human-understandable state without leaking sensitive info.

Steps to be taken:

  • Create a central place to store sops key(s)
    • Azure key vault makes most sense. I'd recommend deploying a new one that appropriate folks have access rights to.
  • Generate a sops key and store it to new Azure key vault
  • Create a secrets directory (.gitignore may need editing) and .sops.yaml config file in the root of the project
  • Extract secrets from old Azure key vault (and then decommission it)
  • Move deploy/prod-template.yaml to secrets/prod.yaml, substitute in secrets from old key vault, encrypt using sops and then commit the file change
  • Update .az-pipelines/cd-pipeline.yml to use sops and updated config files, granting access to new key vault where appropriate

@sgibson91 sgibson91 changed the title Ditch Azure Key Vault and use git-crypt instead? Manage secret encryption using sops Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to-be-scoped Ideas that need further scoping
Projects
None yet
Development

No branches or pull requests

1 participant