nixos/systemd/shutdown: stricter sandboxing
Copied the config from archlinux's mkinitcpio:
318ae30f6a/systemd/mkinitcpio-generate-shutdown-ramfs.service
This commit is contained in:
@@ -71,9 +71,21 @@ in
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.makeInitrdNGTool}/bin/make-initrd-ng ${ramfsContents} /run/initramfs";
|
||||
|
||||
# Sandboxing
|
||||
ProtectSystem = "strict";
|
||||
ReadWritePaths = "/run/initramfs";
|
||||
ExecStart = "${pkgs.makeInitrdNGTool}/bin/make-initrd-ng ${ramfsContents} /run/initramfs";
|
||||
ProtectHome = true;
|
||||
ProtectHostname = true;
|
||||
ProtectClock = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectControlGroups = true;
|
||||
PrivateNetwork = true;
|
||||
LockPersonality = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user