Moved back to TemporaryFileSystem for system hardening.

I misunderstood bind mounts...
This commit is contained in:
Gabe Venberg 2025-04-24 16:33:03 +02:00
parent c8382c2126
commit a90293626d

View file

@ -301,8 +301,12 @@ in {
)
++ [externalStateDir]
++ (mapAttrsToList (k: v: v.path) cfg.volumes);
ProtectSystem = "strict";
ProtectHome = "tmpfs";
# ProtectSystem = "strict";
# Note that unlike what 'ro' implies,
# this actually makes it impossible to read anything in the root FS,
# except for things explicitly mounted via `RuntimeDirectory`, `StateDirectory`, `CacheDirectory`, and `BindReadOnlyPaths`.
# This is because TemporaryFileSystem creates a *new* *empty* filesystem for the process, so only bindmounts are visible.
TemporaryFileSystem = "/:ro";
PrivateTmp = true;
PrivateDevices = true;
ProtectKernelTunables = true;