From 2af90fd35ea8a0aafb9156653f5b28cbac4e1677 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 01:59:16 +0000 Subject: enstate: validators and renderers in a sandbox By bubblewrap: everything read-only but OUT (and IN bound again after a fresh /tmp), a new /dev and /proc, namespaces of their own (no network), no capabilities, a new session, gone with the receptor. The setting sandbox is bwrap (found in the receptor's PATH, as the programs' environment is empty), or none; the module sets its bubblewrap. The tests run their programs in it where bubblewrap can make one (not in Nix's build sandbox), and a test checks that a program can't write outside OUT, nor into IN, and has no network nor environment. --- share/bash-completion/completions/enstate | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'share/bash-completion') diff --git a/share/bash-completion/completions/enstate b/share/bash-completion/completions/enstate index 2900ba1..b0f827e 100644 --- a/share/bash-completion/completions/enstate +++ b/share/bash-completion/completions/enstate @@ -7,7 +7,7 @@ _enstate() { local commands="--plan --apply --stage --status --materialize --migrate --pack" # the settings, and those each command uses local general="--config --unset --print-config" - local settings="$general --state-dir --run-dir --schema --unit" + local settings="$general --state-dir --run-dir --schema --sandbox --unit" local store="$general --state-dir --run-dir --schema" local i w cmd= path= used=" " # bash splits --option=VALUE into --option, =, VALUE @@ -21,7 +21,7 @@ _enstate() { case $w in --plan | --apply | --stage | --status | --materialize | --migrate | --pack) cmd=${w#--} ;; - --out | --config | --unset | --state-dir | --run-dir | --schema | --unit) + --out | --config | --unset | --state-dir | --run-dir | --schema | --sandbox | --unit) used="$used$w " # its value, written apart or with = if [ "${COMP_WORDS[i+1]}" = = ]; then i=$((i + 2)); else i=$((i + 1)); fi ;; @@ -31,18 +31,19 @@ _enstate() { esac done case $prev in - --config | --schema) COMPREPLY=($(compgen -f -- "$cur")); return ;; + --config | --schema | --sandbox) COMPREPLY=($(compgen -f -- "$cur")); return ;; --state-dir | --run-dir | --out) COMPREPLY=($(compgen -d -- "$cur")); return ;; - --unset) COMPREPLY=($(compgen -W "state-dir run-dir schema unit" -- "$cur")); return ;; + --unset) COMPREPLY=($(compgen -W "state-dir run-dir schema sandbox unit" -- "$cur")); return ;; --unit) COMPREPLY=(); return ;; esac local options case $cmd in "") options="$commands -h --help $settings" ;; - plan | stage) options="--json $store" ;; - apply) options="--json $store --unit" ;; - status | materialize) options="--json $store" ;; - migrate) options="--json --dry-run $store" ;; + plan | stage) options="--json $store --sandbox" ;; + apply) options="--json $store --sandbox --unit" ;; + status) options="--json $store" ;; + materialize) options="--json $store --sandbox" ;; + migrate) options="--json --dry-run $store --sandbox" ;; pack) options="--out $general --schema" ;; esac local o candidates= -- cgit v1.3.1