nixos/hardened: restrict access to nix daemon
This commit is contained in:
parent
62623b60d5
commit
6a7f02d89d
|
@ -12,6 +12,8 @@ with lib;
|
||||||
|
|
||||||
boot.kernelPackages = mkDefault pkgs.linuxPackages_hardened;
|
boot.kernelPackages = mkDefault pkgs.linuxPackages_hardened;
|
||||||
|
|
||||||
|
nix.allowedUsers = mkDefault [ "@users" ];
|
||||||
|
|
||||||
security.hideProcessInformation = mkDefault true;
|
security.hideProcessInformation = mkDefault true;
|
||||||
|
|
||||||
security.lockKernelModules = mkDefault true;
|
security.lockKernelModules = mkDefault true;
|
||||||
|
|
|
@ -64,5 +64,11 @@ import ./make-test.nix ({ pkgs, ...} : {
|
||||||
$machine->succeed("mount /dev/disk/by-label/EFISYS /efi");
|
$machine->succeed("mount /dev/disk/by-label/EFISYS /efi");
|
||||||
$machine->succeed("mountpoint -q /efi"); # now mounted
|
$machine->succeed("mountpoint -q /efi"); # now mounted
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Test Nix dæmon usage
|
||||||
|
subtest "nix-daemon", sub {
|
||||||
|
$machine->fail("su -l nobody -s /bin/sh -c 'nix ping-store'");
|
||||||
|
$machine->succeed("su -l alice -c 'nix ping-store'") =~ "OK";
|
||||||
|
};
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue