aboutsummaryrefslogtreecommitdiff
path: root/tests/nixos/no-new-privileges/no-sandbox.nix
diff options
context:
space:
mode:
authoralois31 <alois1@gmx-topmail.de>2024-05-25 04:21:53 +0000
committerGerrit Code Review <gerrit@lix-systems>2024-05-25 04:21:53 +0000
commitddfe379a6b93c678a9a0845e5c5a85f7e77b1b7d (patch)
treebc99ab3f691eeef509943bdcc83feae60bc39d0e /tests/nixos/no-new-privileges/no-sandbox.nix
parent5b4b216facfb8af2f08c25a4b50fba1e197ca06e (diff)
parentf047e4357b4f7ad66c2e476506bf35cab82e441e (diff)
Merge "libstore/build: always enable seccomp filtering and no-new-privileges" into main
Diffstat (limited to 'tests/nixos/no-new-privileges/no-sandbox.nix')
-rw-r--r--tests/nixos/no-new-privileges/no-sandbox.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/nixos/no-new-privileges/no-sandbox.nix b/tests/nixos/no-new-privileges/no-sandbox.nix
new file mode 100644
index 000000000..d952a6862
--- /dev/null
+++ b/tests/nixos/no-new-privileges/no-sandbox.nix
@@ -0,0 +1,21 @@
+let
+ inherit (import ../util.nix) mkNixBuildTest;
+in
+mkNixBuildTest {
+ name = "no-new-privileges-outside-sandbox";
+ extraMachineConfig =
+ { pkgs, ... }:
+ {
+ security.wrappers.ohno = {
+ owner = "root";
+ group = "root";
+ capabilities = "cap_sys_nice=eip";
+ source = "${pkgs.libcap}/bin/getpcaps";
+ };
+ nix.settings = {
+ extra-sandbox-paths = [ "/run/wrappers/bin/ohno" ];
+ sandbox = false;
+ };
+ };
+ expressionFile = ./package.nix;
+}