From 5dc60051fa7f6e79781c146ae61c0dd8f92e7e10 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Thu, 1 Sep 2016 18:53:06 +0200 Subject: [PATCH] unbound service: some pre-chroot isolation While entering the chroot should provide the same amount of isolation, the preStart script will run with full root privileges and so would benefit from some isolation as well (in particular due to unbound-anchor, which can perform network I/O). --- nixos/modules/services/networking/unbound.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/services/networking/unbound.nix b/nixos/modules/services/networking/unbound.nix index c7a4eb6060c..828b8e17556 100644 --- a/nixos/modules/services/networking/unbound.nix +++ b/nixos/modules/services/networking/unbound.nix @@ -122,6 +122,10 @@ in serviceConfig = { ExecStart = "${pkgs.unbound}/bin/unbound -d -c ${stateDir}/unbound.conf"; ExecStopPost="${pkgs.utillinux}/bin/umount ${stateDir}/dev/random"; + + ProtectSystem = true; + ProtectHome = true; + PrivateDevices = true; }; };