Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Read sensitive config variables from files #2042

Open
kapsh opened this issue Feb 7, 2025 · 0 comments
Open

[Feature] Read sensitive config variables from files #2042

kapsh opened this issue Feb 7, 2025 · 0 comments

Comments

@kapsh
Copy link

kapsh commented Feb 7, 2025

Is your feature request related to a problem? Please describe.

Environment variables are not inherently safe, they are visible in process' details for processes with the same uid. Considering people will usually run everything under their account or, with docker, as 1000 (documented for this project) or 911 (lscr defaults) or 568 (recommended in truenas), etc, so containers/applications can possibly snoop on each other as long as they have same id and access to host's /proc. Other concerns are dumping env for debugging or leaking it in some other way.

Describe the solution you'd like

If environment variable with suffix _FILE exists and points to existing file, read configuration value from it. This could be supported for sensitive information as passwords/tokens/keys or checked automatically for all possible variables in order of preference: VAR_FILE > VAR > config.php.
Intended usage is docker secrets: instead of MAIL_PASSWORD="password" write MAIL_PASSWORD_FILE=/run/secrets/password , but any file can also be used.

Additional context

This convention is already adopted in popular software: Postgres, Authelia, Grafana as recent examples from memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant