getsops / sops

Simple and flexible tool for managing secrets
https://getsops.io/
Mozilla Public License 2.0
16.16k stars 854 forks source link

Q: How to prevent unencrypted files from being committed #571

Open kilianc opened 4 years ago

kilianc commented 4 years ago

I prefer sops over git-crypt but I like the filter pattern. Is there a good way to prevent a file that matches a filter from being committed unless is encrypted?

autrilla commented 4 years ago

545 would help with this I guess?

kilianc commented 4 years ago

Yeah, filestatus in combo with a filter/hook could work!

xunholy commented 3 years ago

Has anyone been able to find a git-crypt equivalent method using SOPS. I also like that git-crypt has the ability to un-encrypt after you've unlocked the secrets for the first time that are stored in the repo, seems fairly tedious with SOPS to do individual secret files each time.

kilianc commented 3 years ago

@xUnholy there was work related to this to avoid double encrypting files and potentially make automation and UX better. https://github.com/mozilla/sops/pull/545

seems fairly tedious with SOPS to do individual secret files each time

I wrote a simple bash wrapper to handle my specific use case. The convention is that encrypted files end with .enc. This way I can setup filters and rules to avoid committing unencrypted files or encrypting them twice.

aDingil commented 1 year ago

Maybe this helps: https://github.com/yuvipanda/pre-commit-hook-ensure-sops

davinkevin commented 7 months ago

Looking for the same thing, especially to use sops with .dotfiles and secrets.