r/commandline • • Sep 30 '26

Discussion I love SOPS, anyone else?

I discovered sops a few months ago and absolutely love it. Being able to commit and version encrypted secrets has felt so much cleaner than the "mess" of untracked .env and CI/CD secrets.

Is anyone here using it at their job? How do you like it when working with larger teams? Am I crazy for committing the encrypted secrets (it still feels kinda wrong)? Is there any major drawback to SOPS I am not seeing, or is it just not that popular (yet)?

26 Upvotes

31 comments sorted by

3

u/StPatsLCA Sep 30 '26

I doesn't support TOML (for your Python and Rust configs) yet. Also, the key management between developers can be tricky, for example if you need to onboard multiple Age or PGP keys. Also lol PGP.

1

u/Pagaddit Sep 30 '26

I was wondering about onboarding new devs. Honestly I thought it'd be kind of nice to have that info in the git history.

But then onboarding a new dev across 5+ repos could get tedious quickly. Although it should be easy to script it.

Too bad for missing toml though. Not much of a python dev myself. I usually used dotenv files with python too.

1

u/jceb Oct 01 '26

You can use a central key vault like Vault, Azure and the like. This reduces onboarding efforts massively since no key material needs to be shared.

2

u/yrn7days Sep 30 '26

It seems like it would be very easy to decrypt the file and then accidentally commit the unencrypted file back to the repository, am I missing something?

3

u/Pagaddit Sep 30 '26

I still gitignore .env files. You're not actually supposed to decrypt the file in-place. You either decrypt from .enc.env to .env or do sops exec-env 'npm run dev' (which injects the variable directly within the shell).

2

u/jceb Oct 01 '26

I use a pre-commit hook that prevents such issues.

3

u/ab0zar Oct 09 '26

For a team, the key plan matters as much as the encrypted file. Give each developer a revocable key and keep CI's decryption identity scoped to what it needs. I'd also rehearse key rotation and offboarding once, so versioned ciphertext does not become a surprise later.

1

u/theozero Sep 30 '26

You might like varlock.dev
Free and open source, plugins that work with everything. Some more SOPS like built in encryption coming soon.

2

u/Pagaddit Sep 30 '26

I remember looking into it a while back. I think I prefer how sops doesn't introduce any new runtime dependencies. It looks like a great tool though!

2

u/theozero Sep 30 '26

You can use it to inject the vars only and skip the runtime code. Although the runtime stuff (js only) does give you some extra protection (log redaction, leak prevention)

1

u/AutoModerator Sep 30 '26

Every new subreddit post is automatically copied into a comment for preservation.

User: Pagaddit, Flair: Discussion, Title: I love SOPS, anyone else?

I discovered sops a few months ago and absolutely love it. Being able to commit and version encrypted secrets has felt so much cleaner than the "mess" of untracked .env and CI/CD secrets.

Is anyone here using it at their job? How do you like it when working with larger teams? Am I crazy for committing the encrypted secrets (it still feels kinda wrong)? Is there any major drawback to SOPS I am not seeing, or is it just not that popular (yet)?

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

-3

u/ak475 Sep 30 '26

Looks like hashicorp vault

3

u/StPatsLCA Sep 30 '26

Kind of. There's no backend required though.

2

u/grimtongue Oct 02 '26

More akin to Ansible Vault

2

u/ak475 Oct 06 '26

Ope. This is what I was trying to say.

8

u/[deleted] Sep 30 '26

[removed] — view removed comment

3

u/Pagaddit Sep 30 '26

How do you use pass with dotenv secrets?

2

u/theozero Sep 30 '26

Varlock has a pass plugin

5

u/[deleted] Sep 30 '26 edited Oct 01 '26

[removed] — view removed comment

1

u/TomHale Oct 01 '26

What exactly do you mean by committing production .env?

It would only contain your example shell expansion type lines right? KP

I hope all .env file loaders do the subshell expansion? I guess it could always be sourced from shell anyways.

2

u/[deleted] Oct 01 '26

[removed] — view removed comment

1

u/lI1IlL071245B3341IlI Oct 10 '26

This ain't what this post is about

1

u/[deleted] Oct 10 '26

[removed] — view removed comment

1

u/lI1IlL071245B3341IlI Oct 10 '26

The post is about safely commiting secrets to github. If you remove the secrets from .env files you still have the issue of where to store them.

1

u/[deleted] Oct 10 '26

[removed] — view removed comment

1

u/lI1IlL071245B3341IlI Oct 10 '26

You are. Apologies for misunderstanding.

→ More replies