git.iko.soy/typeable/nixpkgs
on master help sign in
grsecurity test: refactoring
commit64a64c6b14d6556b46266c25fa9acb11c99fc033 authorJoachim Fasting <joachifm@fastmail.fm> dateSat 10 Dec 2016, 13:38 (10 years ago) parentc1d60d8
1 file changed+10−10
nixos/tests/grsecurity.nix+10−10
nixos/tests/grsecurity.nix+10−10
@@ -8,7 +8,9 @@ import ./make-test.nix ({ pkgs, ...} : {
88
99 machine = { config, pkgs, ... }:
1010 { security.grsecurity.enable = true;
11+ boot.kernel.sysctl."kernel.grsecurity.audit_mount" = 0;
1112 boot.kernel.sysctl."kernel.grsecurity.deter_bruteforce" = 0;
13+ networking.useDHCP = false;
1214 };
1315
1416 testScript = ''
@@ -20,16 +22,14 @@ import ./make-test.nix ({ pkgs, ...} : {
2022
2123 subtest "paxtest", sub {
2224 # TODO: running paxtest blackhat hangs the vm
23− $machine->succeed("${pkgs.paxtest}/lib/paxtest/anonmap") =~ /Killed/ or die;
24− $machine->succeed("${pkgs.paxtest}/lib/paxtest/execbss") =~ /Killed/ or die;
25− $machine->succeed("${pkgs.paxtest}/lib/paxtest/execdata") =~ /Killed/ or die;
26− $machine->succeed("${pkgs.paxtest}/lib/paxtest/execheap") =~ /Killed/ or die;
27− $machine->succeed("${pkgs.paxtest}/lib/paxtest/execstack") =~ /Killed/ or die;
28− $machine->succeed("${pkgs.paxtest}/lib/paxtest/mprotanon") =~ /Killed/ or die;
29− $machine->succeed("${pkgs.paxtest}/lib/paxtest/mprotbss") =~ /Killed/ or die;
30− $machine->succeed("${pkgs.paxtest}/lib/paxtest/mprotdata") =~ /Killed/ or die;
31− $machine->succeed("${pkgs.paxtest}/lib/paxtest/mprotheap") =~ /Killed/ or die;
32− $machine->succeed("${pkgs.paxtest}/lib/paxtest/mprotstack") =~ /Killed/ or die;
25+ my @pax_mustkill = (
26+ "anonmap", "execbss", "execdata", "execheap", "execstack",
27+ "mprotanon", "mprotbss", "mprotdata", "mprotheap", "mprotstack",
28+ );
29+ foreach my $name (@pax_mustkill) {
30+ my $paxtest = "${pkgs.paxtest}/lib/paxtest/" . $name;
31+ $machine->succeed($paxtest) =~ /Killed/ or die
32+ }
3333 };
3434
3535 # tcc -run executes run-time generated code and so allows us to test whether