Live data from Hacker News

Shell-secrets – GPG-encrypted environment variables

github.com

11–20 of 43 posts

Re: Shell-secrets – GPG-encrypted environment variables

#11

Couldn't you just use pass and have something like this in your bash script/env: export SOME_SECRET="$(pass show some/secret)"

That hides it in the source, but doesn't hide it in the execution environment that can access the ENV. Everything you run inside your shell could still read it. (but if you're running untrusted things...you've already lost)

Re: Shell-secrets – GPG-encrypted environment variables

#12
post #8
post #7

Coincidentally I’ve written something similar to this too. My main takeaway was that GPG isn’t nearly as user friendly as it needs to be.

Highly true. Yet. If you complain or even offer patches (which will, always, without fail, be rejected). You'll get told off by the GPG devs with something along the lines of "encryption is supposed to be hard".

I have been following the GnuPG mailing list for some years now. I must of missed that. Could we have some references to where someone has been told something to the effect of "encryption is supposed to be hard".

Re: Shell-secrets – GPG-encrypted environment variables

#14
Unless you're good at actually maintaining your gpg keychain and need other people to access this, I really wouldn't bother with gpg. There are way better and simpler options.

Age has a simpler interface and SSH key support https://github.com/FiloSottile/age

ejson2env has the environment variable integration and ejson has multiple backends https://github.com/Shopify/ejson2env

direnv can support any cli secrets manager per project directory https://direnv.net/

I've dealt with enough "why did this break" situations with gpg secrets files used by capable teams that I'd never recommend that to anyone. And unless you really need the public key support (teams and deployment support), you're unlikely to gain anything better over a password manager.

Re: Shell-secrets – GPG-encrypted environment variables

#15
post #9
post #8

Earlier quoted context omitted.

Highly true. Yet. If you complain or even offer patches (which will, always, without fail, be rejected). You'll get told off by the GPG devs with something along the lines of "encryption is supposed to be hard".

How hard would it be to devise an easy to use wrapper on top of GPG, kind of porcelain-like?

It already exists and it's called Kleopatra. It's developed by KDE with some support from the GPG developers and is part of the Gpg4Win suite.

It's used by quite a few companies and public administrations.

Re: Shell-secrets – GPG-encrypted environment variables

#17
post #9
post #8

Earlier quoted context omitted.

Highly true. Yet. If you complain or even offer patches (which will, always, without fail, be rejected). You'll get told off by the GPG devs with something along the lines of "encryption is supposed to be hard".

How hard would it be to devise an easy to use wrapper on top of GPG, kind of porcelain-like?

The easier and more productive thing is to make an easy-to-use tool that does a specific workflow vs trying to be a swiss army knife.

https://github.com/FiloSottile/age is this for encrypting files.

https://en.wikipedia.org/wiki/Signify_(OpenBSD) and https://jedisct1.github.io/minisign/ are this for signing files.

Signal/Whatsapp/etc that use the Signal Protocal are this for messaging.

It turns out solving one problem at a time and ending up with a bunch of purpose-built tools is way easier to get right than trying to jam an entire toolbox into one thing.

Re: Shell-secrets – GPG-encrypted environment variables

#18
post #9
post #8

Earlier quoted context omitted.

Highly true. Yet. If you complain or even offer patches (which will, always, without fail, be rejected). You'll get told off by the GPG devs with something along the lines of "encryption is supposed to be hard".

How hard would it be to devise an easy to use wrapper on top of GPG, kind of porcelain-like?

There's a library wrapper, https://www.gnupg.org/software/gpgme/index.html

>GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG easier for applications. It provides a High-Level Crypto API for encryption, decryption, signing, signature verification and key management. Currently it uses GnuPG's OpenPGP backend as the default, but the API isn't restricted to this engine. We have, in fact, already developed a backend for CMS (S/MIME).

Re: Shell-secrets – GPG-encrypted environment variables

#19

Unless you're good at actually maintaining your gpg keychain and need other people to access this, I really wouldn't bother with gpg. There are way better and simpler options. Age has a simpler interface and SSH key support https://github.com/FiloSottile/age ejson2env has the environment variable integration and ejson has multiple backends https://github.com/Shopify/ejson2env direnv can support any cli secrets manage…

age looks really interesting, thanks. I also learned from that page that appending ".keys" to your GitHub profile URL (so https://github.com/yourusername.keys) returns a list of your SSH public keys! (Where is this documented...?)

Re: Shell-secrets – GPG-encrypted environment variables

#20

Unless you're good at actually maintaining your gpg keychain and need other people to access this, I really wouldn't bother with gpg. There are way better and simpler options. Age has a simpler interface and SSH key support https://github.com/FiloSottile/age ejson2env has the environment variable integration and ejson has multiple backends https://github.com/Shopify/ejson2env direnv can support any cli secrets manage…

age looks really interesting, thanks. I also learned from that page that appending ".keys" to your GitHub profile URL (so https://github.com/yourusername.keys ) returns a list of your SSH public keys! (Where is this documented...?)

Another trick with github urls: you can append .patch or .diff to any PR or commit URL, and you'll get back a git-formatted patch or diff.

https://github.com/rust-lang/rust/pull/139966

https://github.com/rust-lang/rust/pull/139966.patch

https://github.com/rust-lang/rust/pull/139966.diff

Post reply on HN