core: hide /run/credentials whenever namespacing is requested
authorLennart Poettering <lennart@poettering.net>
Fri, 14 Aug 2020 13:54:48 +0000 (15:54 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 25 Aug 2020 17:45:38 +0000 (19:45 +0200)
commitbbb4e7f39f2c68c719c26c2c65f8b7b91b009e92
treecca94eac03c0d14ad3d75516483aadacd2df5f4b
parentbb0c0d6f29236645c8beb7ba662b2c4e7b241407
core: hide /run/credentials whenever namespacing is requested

Ideally we would like to hide all other service's credentials for all
services. That would imply for us to enable mount namespacing for all
services, which is something we cannot do, both due to compatibility
with the status quo ante, and because a number of services legitimately
should be able to install mounts in the host hierarchy.

Hence we do the second best thing, we hide the credentials automatically
for all services that opt into mount namespacing otherwise. This is
quite different from other mount sandboxing options: usually you have to
explicitly opt into each. However, given that the credentials logic is a
brand new concept we invented right here and now, and particularly
security sensitive it's OK to reverse this, and by default hide
credentials whenever we can (i.e. whenever mount namespacing is
otherwise opt-ed in to).

Long story short: if you want to hide other service's credentials, the
most basic options is to just turn on PrivateMounts= and there you go,
they should all be gone.
src/core/execute.c
src/core/mount-setup.c
src/core/namespace.c
src/core/namespace.h
src/test/test-namespace.c
src/test/test-ns.c