4 ms·
Just asking: If you pass security tokens via environment variables to the process, doesn't it make sense to delete them from within the process after they have
by qwertox 3y ago
Just asking: If you pass security tokens via environment variables to the process, doesn't it make sense to delete them from within the process after they have been used?
- eqvinox 3y agoYes it would make sense, but no there is no way to actually ensure they have been deleted. A trivial but nonetheless very common case would be if your process is started with a wrapper shell script. But even just within your process, there is no guarantee at all against some random library (or the kernel) making a copy of the entire environment. If you want to pass secrets into a process at startup, I would strongly recommend passing a pipe as an additional open file descriptor (e.g. fd #4, but this FD number you can then put in an env variable) and writing it onto the pipe. It can only be read once, and you can control where the value propagates.