git.iko.soy/typeable/nixpkgs
on master help sign in
nixos-containers: Set DevicePolicy=closed

This makes the container a bit more secure, by preventing root creating device nodes to access the host file system, for instance. (Reference: systemd-nspawn@.service in systemd.)

commitfd5bbdb4363cbd2935b0d5a37c4e7355f45e61a4 authorEelco Dolstra <eelco.dolstra@logicblox.com> dateThu 28 Jul 2016, 17:39 (10 years ago) parentbf3edfb
1 file changed+2
nixos/modules/virtualisation/containers.nix+2
nixos/modules/virtualisation/containers.nix+2
@@ -415,6 +415,8 @@ in
415415 # after the timeout). So send an ignored signal.
416416 KillMode = "mixed";
417417 KillSignal = "WINCH";
418+
419+ DevicePolicy = "closed";
418420 };
419421 };
420422 in {