build_bubblewrap_arguments#
Run commands and agent-written programs inside an operating-system boundary. See the guide.
- zett_agent.sandbox.bubblewrap.build_bubblewrap_arguments(resolved, argv, cwd, env, *, bwrap='bwrap')[源代码]#
Render a resolved policy and a command as a
bwrapargument vector.The root filesystem is mounted read-only, so the process can read the machine; each writable path is bound read-write over it; the unwritable paths are bound read-only again on top, and the denied-read paths are masked last. The mounts are applied in that order, which is what makes a denial beat a permission.
The process gets new user, PID, IPC, UTS and cgroup namespaces, its own session (so it cannot inject input into the terminal), and dies with its parent. The network namespace is new unless the policy opens the network.
- 返回:
The argument vector, and warnings for entries bubblewrap cannot enforce.
- 参数:
resolved (ResolvedPolicy)
argv (tuple[str, ...])
cwd (Path)
env (dict[str, str])
bwrap (str)
- 返回类型:
tuple[list[str], list[str]]