diff --git a/nix/module.nix b/nix/module.nix index dee7d70d..85cf910b 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -123,6 +123,28 @@ in { StandardError = "journal"; SyslogIdentifier = "${name}"; + # Hardening + CapabilityBoundingSet = [""]; + LockPersonality = true; + PrivateMounts = true; + PrivateTmp = true; + ProcSubset = "pid"; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHome = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + ProtectSystem = "strict"; + RestrictNamespaces = true; + RestrictRealtime = true; + RestrictSUIDSGID = true; + SystemCallArchitectures = "native"; + RemoveIPC = true; + NoNewPrivileges = true; + Environment = [ "CONFIG_LOCATION=${configFile}" ];