Had to read to the end of the description of why environment variables are bad to discover that it is effectively an advertisement for Docker. I don't use Docker so the article told me pretty much nothing that wasn't fairly obvious already, although it is a valuable reminder.
Don't use ENV variables for secret data (2017)
11–20 of 147 posts
Re: Don't use ENV variables for secret data (2017)
#12As for secret storage: didn't we solve this problem with keyrings? If I must put a secret in long-term plaintext storage, I might as well put it in a file, where I can see, access-control it, and audit it. Where's the audit log for someone reading an environment variable value?
Re: Don't use ENV variables for secret data (2017)
#131. Using docker-secret inside of a Docker swarm
2. Using Keywhiz [1], a Java server together with a FUSE client.
This seems overkill for a lot of cases. If environment variables are such a security problem, why not just use a config file (not checked into the source code repository) with proper permissions set?
[1] https://developer.squareup.com/blog/protecting-infrastructur...
Re: Don't use ENV variables for secret data (2017)
#14Re: Don't use ENV variables for secret data (2017)
#15Earlier quoted context omitted.
It's way better than hard coding them into the code.
Why is that? Also, as an aside: The very premise of plaintext credentials for computer-computer database connections always seemed strange to me. Maybe I'm just not knowledgeable enough here, but I wish the standard for database credentials was key-based.
Re: Don't use ENV variables for secret data (2017)
#16Earlier quoted context omitted.
It's way better than hard coding them into the code.
Why is that? Also, as an aside: The very premise of plaintext credentials for computer-computer database connections always seemed strange to me. Maybe I'm just not knowledgeable enough here, but I wish the standard for database credentials was key-based.
Bigger companies also may have different compliance restrictions which means developers don't get access to production, only the Administrators.
Re: Don't use ENV variables for secret data (2017)
#17Re: Don't use ENV variables for secret data (2017)
#18Earlier quoted context omitted.
It's way better than hard coding them into the code.
Why is that? Also, as an aside: The very premise of plaintext credentials for computer-computer database connections always seemed strange to me. Maybe I'm just not knowledgeable enough here, but I wish the standard for database credentials was key-based.
Injecting via secrets allows us to tightly control where the secret goes and who has access as well as make it easy to tumble.
Re: Don't use ENV variables for secret data (2017)
#19- make sure to sanitize the environment before spawning any child processes.
- Be sure to `set +x` (or your shell's equivalent) in your CI process
- that your secrets never get interpolated into a string through your scripting language.
Re: Don't use ENV variables for secret data (2017)
#20What's a best practice that doesn't use this Docker-specific feature ?