Earlier quoted context omitted.
>just start a server or an app with different env variables in the command line. Just reference a different config file on the command line. >You don't want your config or keys to depend on an OS,or a language. A path to a config file isn't an OS or language. The ini format is pretty widely supported. >Finally Env variables can be restricted to a set of users,so third party process started with a different one cant a…
BEGIN { $API = new Backend($ENV{credentials}); delete $ENV{credentials}; }; Filesystem permissions do not make it possible for a program to internally partition access to those credentials unless you (a) start it as root, or (b) delete the credentials file after reading it.
Environment Variables Considered Harmful for Your Secrets
41–50 of 120 posts
Re: Environment Variables Considered Harmful for Your Secrets
#42why not just make use of the OS's secrets store? for example, like how https://pypi.python.org/pypi/keyring operates
Re: Environment Variables Considered Harmful for Your Secrets
#43Re: Environment Variables Considered Harmful for Your Secrets
#44Re: Environment Variables Considered Harmful for Your Secrets
#45Isn't this what TPM was designed to avoid ? Neither files nor env variables. Most chipsets have a rather unused TPM function, and it should be possible to have developers and processes hook into that. Perhaps using tmptool ? On master process startup ask user for passphrase, and use that to query the TPM stored values ? http://manpages.courier-mta.org/htmlman1/tpmtool.1.html
I have to admit that I don't know a thing about TPM. Like is it also available in virtual environments like AWS is providing? How could this be automated? You don't want to enter a passphrase every time a server (re)boots. Would love to hear if anybody successfully used that.
Cloud servers
=============
Xen supports virtual TPM.I'm no Amazon EC2 expert, but a quick google exposed a few keen souls who tried to use vTPM and failed. This would suggest that Amazon does not yet support vTPM.
Re-entering passphrases
========================
Well, unless the machine is permissioned by default you will need to give a fresh instance new authorization. Permissioning by default is the same security problem you're trying to avoid though... just shifted. Your overall goal is to have the credentials inaccessible to sniffing, right ?I guess you could set up some form of ssh-agent handshake to make the process less manual.
Re: Environment Variables Considered Harmful for Your Secrets
#46Earlier quoted context omitted.
I have to admit that I don't know a thing about TPM. Like is it also available in virtual environments like AWS is providing? How could this be automated? You don't want to enter a passphrase every time a server (re)boots. Would love to hear if anybody successfully used that.
Cloud servers ============= Xen supports virtual TPM. I'm no Amazon EC2 expert, but a quick google exposed a few keen souls who tried to use vTPM and failed. This would suggest that Amazon does not yet support vTPM. Re-entering passphrases ======================== Well, unless the machine is permissioned by default you will need to give a fresh instance new authorization. Permissioning by default is the same security…
Re: Environment Variables Considered Harmful for Your Secrets
#47I typically store the env _name_ in the environment, and then use that in my apps to build a path to the file containing secrets (e.g. /etc/{mycompany}/{environment}/myapp.conf). The file is locked down by ACLs or permissions.
Re: Environment Variables Considered Harmful for Your Secrets
#48Same thing while debugging : only the encrypted key is printed.
Re: Environment Variables Considered Harmful for Your Secrets
#49Assuming you arn't trying to go for top security, and just want a way to keep things safe from leaking due to errors and the such why not just make use of the OS's secrets store? for example, like how https://pypi.python.org/pypi/keyring operates
Re: Environment Variables Considered Harmful for Your Secrets
#50My company has an internal bit of infrastructure that I think is a somewhat novel approach that allows us to never have any secrets stored unencrypted on disk. There's a server (a set of servers, actually, for redundancy) called the secret server, and its only job is to run a daemon that owns all the secrets. When an app on another server is started up, it must be done from a shell (we use cap) which has an SSH agent…
One of the interesting (and optional) things is does, is provide a agent to run on your instances that require the secrets, the agent implements a FUSE filesystem, and access to this filesytem is controlled by policy. For example - A policy can say "Allow exactly 1 read of /secrets/AWS.json within 120 seconds of boot". Any out of policy access attempts can cause the instance to be blacklisted, preventing any future secret access etc..
[1]: https://www.openstack.org/summit/portland-2013/session-video...