by jondubois · 10y ago · 0 comments
Multiple major security flaws:
1. Company source code should only be published to private docker images.
2. You should never store API keys or passwords inside the source code. A better approach is to use environment variables and have the container read those.
A better way is to store it into a config file and store them into global variables at the start of the server (while globals are normally bad, it is ok to use them for thinks like configs if you don't plan to change them after initizalization. Environment vars are globals after all).
I don't think using config files is a bad solution, it just isn't categorically better because some programs have been written to dump env vars on a crash.