nixos/upower: lockdown service using upstream settings
This commit is contained in:
parent
b5bac7d8a8
commit
d7e4c49ffc
@ -56,6 +56,32 @@ in
|
|||||||
{ Type = "dbus";
|
{ Type = "dbus";
|
||||||
BusName = "org.freedesktop.UPower";
|
BusName = "org.freedesktop.UPower";
|
||||||
ExecStart = "@${cfg.package}/libexec/upowerd upowerd";
|
ExecStart = "@${cfg.package}/libexec/upowerd upowerd";
|
||||||
|
Restart = "on-failure";
|
||||||
|
# Upstream lockdown:
|
||||||
|
# Filesystem lockdown
|
||||||
|
ProtectSystem = "strict";
|
||||||
|
# Needed by keyboard backlight support
|
||||||
|
ProtectKernelTunables = false;
|
||||||
|
ProtectControlGroups = true;
|
||||||
|
ReadWritePaths = "/var/lib/upower";
|
||||||
|
ProtectHome = true;
|
||||||
|
PrivateTmp = true;
|
||||||
|
|
||||||
|
# Network
|
||||||
|
# PrivateNetwork=true would block udev's netlink socket
|
||||||
|
RestrictAddressFamilies = "AF_UNIX AF_NETLINK";
|
||||||
|
|
||||||
|
# Execute Mappings
|
||||||
|
MemoryDenyWriteExecute = true;
|
||||||
|
|
||||||
|
# Modules
|
||||||
|
ProtectKernelModules = true;
|
||||||
|
|
||||||
|
# Real-time
|
||||||
|
RestrictRealtime = true;
|
||||||
|
|
||||||
|
# Privilege escalation
|
||||||
|
NoNewPrivileges = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user