WIP: base/thermald: systemd hardening

This commit is contained in:
Oystein Kristoffer Tveit 2024-08-22 23:01:08 +02:00
parent ef418bf125
commit 44b8c9d4a3
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
1 changed files with 41 additions and 0 deletions

View File

@ -82,6 +82,47 @@
(!config.boot.isContainer or false) (!config.boot.isContainer or false)
]) true; ]) true;
systemd.services.thermald = lib.mkIf config.services.thermald.enable {
documentation = [ "man:thermald(8)" "man:thermal-conf.xml(5)" ];
unitConfig.ConditionVirtualization = "no";
serviceConfig = {
PrivateUsers = true;
PrivateNetwork = true;
# AmbientCapabilities = [ "" ];
# CapabilityBoundingSet = [ "" ];
LockPersonality = true;
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;
# PrivateDevices = true;
PrivateMounts = true;
PrivateTmp = "yes";
ProcSubset = "pid";
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true; #?
ProtectProc = "invisible"; #?
ProtectSystem = "strict";
RemoveIPC = true;
UMask = "0777";
RestrictNamespaces = true;
# RestrictRealtime = true; #?
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
SocketBindDeny = [ "any" ];
SystemCallFilter = [
"@system-service"
"~@privileged"
"~@resources"
];
};
};
services.openssh = { services.openssh = {
enable = true; enable = true;
extraConfig = '' extraConfig = ''