[FEATURE] Support loading sensitive values from files using _FILE
suffixed environment variables
#2310
Labels
_FILE
suffixed environment variables
#2310
What's needed and why?
I'd like to add support for loading sensitive values (such as the database URI, crowdsec API key, etc) from a file on disk specified by an environment variable, rather than directly from the environment. This will support Docker secrets as well as provide an alternative for users looking to avoid putting sensitive data directly into the app environment.
This feature would work by replacing some usages of
os.getenv()
with a function that does the below, for example trying to load a sensitive value from the environment variableFOO
:FOO_FILE
existsFOO_FILE
is not set, return the value of the environment variableFOO
.I've put together a prototype for this change in my fork:
load_secret
functionos.getenv()
Implementations ideas (optional)
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: