From 259a75fb1fffd1ce6213ae32c2cfdf586ca405eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Mon, 2 Jun 2025 01:20:23 +0200 Subject: [PATCH] nixos/pocket-id: harden after backend-frontend merge --- nixos/modules/services/security/pocket-id.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/security/pocket-id.nix b/nixos/modules/services/security/pocket-id.nix index 62259a7959a4..c3a93869dd1e 100644 --- a/nixos/modules/services/security/pocket-id.nix +++ b/nixos/modules/services/security/pocket-id.nix @@ -174,12 +174,12 @@ in CapabilityBoundingSet = ""; DeviceAllow = ""; DevicePolicy = "closed"; - #IPAddressDeny = "any"; # communicates with the frontend + #IPAddressDeny = "any"; # provides the service through network LockPersonality = true; MemoryDenyWriteExecute = true; NoNewPrivileges = true; PrivateDevices = true; - PrivateNetwork = false; # communicates with the frontend + PrivateNetwork = false; # provides the service through network PrivateTmp = true; PrivateUsers = true; ProcSubset = "pid"; @@ -191,7 +191,8 @@ in ProtectKernelModules = true; ProtectKernelTunables = true; ProtectProc = "invisible"; - ProtectSystem = "full"; # needs to write in cfg.dataDir + ProtectSystem = "strict"; + ReadWritePaths = [ cfg.dataDir ]; RemoveIPC = true; RestrictAddressFamilies = [ "AF_INET" @@ -212,7 +213,7 @@ in "@privileged" "@raw-io" "@reboot" - #"@resources" # vm test segfaults + "@resources" "@swap" ]; UMask = "0077";