Just wondering if there is any way to secure the environment variables in a *nix system such that they can not be read from any plain text file, but is available in the environment.
I know we can always use filesystem level permissions for .bashrc/.bash_profile, but what if certain variables (like db passwords) are to be hidden completely?
One way to do would be to write some sort of program/perl script to:
- Take inputs from a plain text file and encrypt/hash the content (and then get rid of the plain text file)
- Use the same to decrypt the file runtime and export the values from the decrypted output (I know this program can be used to dump the decrypted values somewhere, but I am not concerned about that right now)
Is there any other better and more obvious way to achieve this?
Thanks!
-Gaurav