News for hackers. Stuff that matters.
Re:The Twelve-Factor App by dharmab on Thursday October 12, 2023 @12:04PM (#37859076)
Check out the Secrets Operator for Kubernetes. Injects your secrets from a secrets store as a file mounted into your container.
Re:The Twelve-Factor App by marwis on Thursday October 12, 2023 @03:32PM (#37861991)
And how is /var/run/secrets any more secure than env?

I guess you avoid the risk of accidentally logging secrets with other env variables but otherwise it seems to be just as secure/insecure.

Re:The Twelve-Factor App by dharmab on Thursday October 12, 2023 @03:42PM (#37862155)
The secrets aren't in a shared location. They're stored in an ephemeral volume specific to each container which other processes cannot access.
Re:The Twelve-Factor App by marwis on Thursday October 12, 2023 @06:38PM (#37864059)
If someone has enough privileges to access /proc/*/environ of another process (i.e. root or the same user or process or child process) then they should be easily able to reach inside the container, no?
Re:The Twelve-Factor App by lmm on Thursday October 12, 2023 @11:25PM (#37866225)
Other processes running as the same user can be blocked from reading /var/run/secrets via the likes of SELinux/AppArmor whereas they can't be blocked from reading /proc/environ.

It's a pretty fine distinction and I don't know how many people actually bother doing SELinux etc. in practice, but theoretically it's marginally better.

Re:The Twelve-Factor App by marwis on Thursday October 12, 2023 @11:48PM (#37866393)
AppArmor can restrict /proc, see example from docker: https://github.com/moby/moby/blob/master/contrib/apparmor/te...
Re:The Twelve-Factor App by 89vision on Thursday October 12, 2023 @10:35PM (#37865883)
how does the application pick it up? We use the built in secrets that are injected into the container as env vars and then the application picks it up that way. Not trying to sound combative, just looking for better ways to do things.
Re:The Twelve-Factor App by jameshart on Thursday October 12, 2023 @11:33PM (#37866277)
Read the file on startup.

Bonus: you can watch the file for changes. Which means your app can pick up rotated secrets without a process restart, whereas if you inject secrets via the environment they're fixed for process lifetime.