nixos/restic-rest-server: Add additional service hardening

This commit is contained in:
MinerSebas 2024-03-16 07:32:20 +01:00
parent c197e4a1e0
commit 7762c2233c
1 changed files with 18 additions and 1 deletions

View File

@ -80,13 +80,30 @@ in
Group = "restic";
# Security hardening
ReadWritePaths = [ cfg.dataDir ];
CapabilityBoundingSet = "";
LockPersonality = true;
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;
PrivateTmp = true;
PrivateUsers = true;
ProtectClock = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectProc = "invisible";
ProtectSystem = "strict";
ProtectKernelTunables = true;
ProtectKernelModules = true;
ProtectControlGroups = true;
PrivateDevices = true;
ReadWritePaths = [ cfg.dataDir ];
RemoveIPC = true;
RestrictNamespaces = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
SystemCallFilter = "@system-service";
UMask = 027;
};
};