Don't let every user read the environment variables in Systemd units? #38

Closed
opened 2019-04-23 12:57:20 +00:00 by greg · 3 comments
Owner

We started discussing it in #37

I thought making the unit files not world readable is enough, let's find a good solution and use it everywhere

We started discussing it in #37 I thought making the unit files not world readable is enough, let's find a good solution and use it everywhere
Owner

From kosmos-dev@chat.kosmos.org:

Note that environment variables are not suitable for passing secrets (such as passwords, key material, …) to service processes. Environment variables set for a unit are exposed to unprivileged clients via D-Bus IPC, and generally not understood as being data that requires protection. Moreover, environment variables are propagated down the process tree, including across security boundaries (such as setuid/setgid executables), and hence might leak to processes that should not have access to the secret data.

https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Environment=

From `kosmos-dev@chat.kosmos.org`: > Note that environment variables are not suitable for passing secrets (such as passwords, key material, …) to service processes. Environment variables set for a unit are exposed to unprivileged clients via D-Bus IPC, and generally not understood as being data that requires protection. Moreover, environment variables are propagated down the process tree, including across security boundaries (such as setuid/setgid executables), and hence might leak to processes that should not have access to the secret data. https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Environment=
raucao added the
security
question
labels 2020-08-30 12:24:05 +00:00
Owner

Another post on the topic:

https://movingfast.io/articles/environment-variables-considered-harmful/

The gist is to just use local config files that aren't loaded into ENV vars.

Another post on the topic: https://movingfast.io/articles/environment-variables-considered-harmful/ The gist is to just use local config files that aren't loaded into ENV vars.
Owner

Closing in favor of assessing the situation use case by use case.

Closing in favor of assessing the situation use case by use case.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kosmos/chef#38
No description provided.