nixos/taskserver: Set up service namespaces
The Taskserver doesn't need access to the full /dev nor does it need a shared /tmp. In addition, the initialisation services don't need network access, so let's constrain them to the loopback device. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
dd0d64afea
commit
bb7a819735
@ -417,6 +417,9 @@ in {
|
||||
serviceConfig.User = cfg.user;
|
||||
serviceConfig.Group = cfg.group;
|
||||
serviceConfig.PermissionsStartOnly = true;
|
||||
serviceConfig.PrivateNetwork = true;
|
||||
serviceConfig.PrivateDevices = true;
|
||||
serviceConfig.PrivateTmp = true;
|
||||
};
|
||||
|
||||
systemd.services.taskserver = {
|
||||
@ -437,6 +440,8 @@ in {
|
||||
ExecStart = "@${taskd} taskd server";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -USR1 $MAINPID";
|
||||
PermissionsStartOnly = true;
|
||||
PrivateTmp = true;
|
||||
PrivateDevices = true;
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
};
|
||||
@ -450,6 +455,8 @@ in {
|
||||
description = "Initialize CA for TaskServer";
|
||||
serviceConfig.Type = "oneshot";
|
||||
serviceConfig.UMask = "0077";
|
||||
serviceConfig.PrivateNetwork = true;
|
||||
serviceConfig.PrivateTmp = true;
|
||||
|
||||
script = ''
|
||||
silent_certtool() {
|
||||
|
Loading…
Reference in New Issue
Block a user