Or just overwrite the variables when you're done with them. Hell, you can wipe out the entirety of your __environ when you're done and it won't show up in /proc anymore. Sure, in docker world you can still see them with docker inspect but if someone has that level of access you're done anyway.<p>Environment variables are no ones favorite method of associating data with processes, but they're everyone's favorite.<p>The kernel keyring and secret files are "better" but they have an impedance mismatch which is that they're user/uid oriented rather than process oriented.<p>Here's an example in C. I'm a terrible C programmer but you get the picture. If you run this and then `ps eww` on the process it will be empty.<p><pre><code> #include <stdio.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char **argv, char **envp) {
while (*envp) {
printf("%s", *envp);
int len = strlen(*envp);
memset(*envp, 0, len);
*envp++;
}
while (1) {
sleep(10);
}
}</code></pre>