common: harden cups
This commit is contained in:
parent
0a5e8774c7
commit
810311bbc2
|
@ -12,6 +12,7 @@ in {
|
|||
./programs/ssh.nix
|
||||
./programs/usbtop.nix
|
||||
|
||||
./services/cups.nix
|
||||
./services/dbus.nix
|
||||
./services/openssh.nix
|
||||
./services/pcscd.nix
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
systemd.services = lib.mkIf config.services.printing.enable {
|
||||
cups.serviceConfig = {
|
||||
PrivateTmp = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
ProtectClock= true;
|
||||
ProtectControlGroups = true;
|
||||
ProtectHostname = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectProc = "invisible";
|
||||
PrivateDevices = true;
|
||||
NoNewPrivileges = true;
|
||||
# User =
|
||||
AmbientCapabilities = [ "" ];
|
||||
CapabilityBoundingSet = [ "" ];
|
||||
DevicePolicy = "closed";
|
||||
KeyringMode = "private";
|
||||
LockPersonality = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
PrivateUsers = true;
|
||||
RemoveIPC = true;
|
||||
# RestrictAddressFamilies = [ "" ];
|
||||
RestrictNamespaces=true;
|
||||
RestrictRealtime=true;
|
||||
RestrictSUIDSGID=true;
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = [
|
||||
"@system-service"
|
||||
"~@privileged"
|
||||
];
|
||||
UMask = "0077";
|
||||
};
|
||||
cups-browsed.serviceConfig = {
|
||||
PrivateTmp = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
ProtectClock= true;
|
||||
ProtectControlGroups = true;
|
||||
ProtectHostname = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectProc = "invisible";
|
||||
PrivateDevices = true;
|
||||
NoNewPrivileges = true;
|
||||
# User =
|
||||
AmbientCapabilities = [ "" ];
|
||||
CapabilityBoundingSet = [ "" ];
|
||||
DevicePolicy = "closed";
|
||||
KeyringMode = "private";
|
||||
LockPersonality = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
PrivateUsers = true;
|
||||
RemoveIPC = true;
|
||||
# RestrictAddressFamilies = [ "" ];
|
||||
RestrictNamespaces=true;
|
||||
RestrictRealtime=true;
|
||||
RestrictSUIDSGID=true;
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = [
|
||||
"@system-service"
|
||||
"~@privileged"
|
||||
];
|
||||
UMask = "0077";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue