[pass] Feature proposal: secure environment variables
Gabe Mulley
gabe at edx.org
Thu May 5 04:20:34 CEST 2016
Hi Renato,
Thanks for the snippet, this is perfect. I meant that it feels "more
secure" to me to be storing these types of secrets in a gpg encrypted file
and only decrypting them on an as-needed basis instead of storing them in
cleartext in various config files in a home directory. Not ideal, but
seemed like the easiest way to integrate with third party tools (like
awscli) that support reading the secrets out of the environment. Let me
know if there is an even better way to do this.
Thanks,
-Gabe
On Wed, May 4, 2016 at 6:12 PM, Renato Alves <alves.rjc at gmail.com> wrote:
> Hi Gabe,
>
> A simple script:
>
> #!/bin/bash
> source <(pass $1)
> shift
> exec "$@"
>
> If called with:
>
> ./script.sh env/mytool/dev ./mytool.py takes_arguments
>
> Should produce what you desire.
>
> But as a general note I wouldn't call this "more secure" though. Once
> something is added to the environment it will often remain there during
> the lifetime of the process. Also true for forked processes if the
> environment is not sanitized.
>
>
> Cheers,
> Renato
>
>
> Gabe Mulley wrote on 05/04/2016 11:35 PM:
> > I am planning on developing a patch for this feature, but wanted to run
> > it by the list first. The goal of the feature is to enable more secure
> > usage and development of tools that expect passwords and other sensitive
> > data to be stored in environment variables.
> >
> > I want to do something like this:
> >
> > pass exec --env=env/mytool/dev ./mytool.py
> >
> > Where "env/mytool/dev" is a passfile with the following content:
> >
> > export MYTOOL_ENV=dev
> > export SOME_SECURE_VAR=secret
> > export ANOTHER_SECURE_VAR="another secret"
> >
> > The goal is run "./mytool.py" in a transient shell that has the
> > variables defined in the environment.
> >
> > Imagine something like this (open to ideas about how to make this work
> > with other shells):
> >
> > BASH_ENV=/dev/shm/password-store.sh.yhONUYbBTB8Mr/maTNsc-test bash -c
> > "./mytool.py"
> >
> > Where the temporary file contains the decrypted content of the passfile.
> >
> > This could be used to store AWS keys (for example).
> >
> > What are your thoughts? Would this type of patch be accepted if I
> > developed it? Is there a better way to accomplish this goal?
> >
> > Thanks,
> > -Gabe
> >
> >
> > _______________________________________________
> > Password-Store mailing list
> > Password-Store at lists.zx2c4.com
> > http://lists.zx2c4.com/mailman/listinfo/password-store
> >
>
>
>
> _______________________________________________
> Password-Store mailing list
> Password-Store at lists.zx2c4.com
> http://lists.zx2c4.com/mailman/listinfo/password-store
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20160504/4d4e6886/attachment.html>
More information about the Password-Store
mailing list