Commit Graph
18 Commits
Author SHA1 Message Date
mrtoth 599d86ccbf Kill the child processes at once on a second interrupt during the grace period 2026-11-04 02:50:35 +01:00
mrtoth 04abf264a0 Forward signals to the child processes of agent-sandbox 2026-11-04 01:40:37 +01:00
mrtoth 29851dc5df Terminate leftover child processes of the entrypoint after bwrap exits 2026-10-31 14:25:17 +01:00
mrtoth 1c2f51ed3b Spawn bwrap and mirror its exit status instead of exec'ing into it 2026-10-31 01:55:36 +01:00
mrtoth c8f2d62b64 Expose the bwrap command line at /run/agent-sandbox inside every sandbox 2026-09-02 16:09:46 +02:00
mrtoth 3fb0da0577 Optionally back /tmp and /var/tmp with stable host directories 2026-05-15 01:36:58 +02:00
mrtoth 305ac9d927 Accept SRC:DST remap syntax in --ro/--rw 2026-04-22 21:51:00 +02:00
mrtoth 494da52fc6 Replace setenv with env list supporting host passthrough 2026-04-22 20:47:01 +02:00
mrtoth 25f0037aab Filter environment variables in both sandbox modes
Whitelist mode now clears the parent env and re-adds a small allowlist
(identity, terminal, locale, proxy, non-GUI XDG, vendor prefixes).
Blacklist mode strips cloud credentials, backup passphrases, dangling
socket pointers, and anything matching *_TOKEN, *_SECRET, *_PASSWORD,
*_PASSPHRASE, *_API_KEY, *_PRIVATE_KEY, *_CLIENT_SECRET; vendor prefix
carve-outs keep ANTHROPIC_API_KEY and friends.

Users can override via --setenv KEY=VALUE and --unsetenv KEY (and the
corresponding TOML keys), or opt out of the built-in policy entirely
with --no-env-filter.
2026-04-08 09:22:11 +02:00
mrtoth 12644ae31e Apply a seccomp-BPF syscall allowlist by default
Derived from Podman's default profile, stripped of capability-conditional
rules (we never grant capabilities), argument filters, and the explicit
EPERM block. Dangerous syscalls (mount, unshare, ptrace, bpf,
perf_event_open, io_uring_*, keyctl, kexec_*, ...) fall through to the
default ENOSYS action, which also keeps glibc's clone3 -> clone fallback
working. x86_64 and aarch64 are supported; other archs error out.

Toggle with --seccomp / --no-seccomp or seccomp = <bool> in config.
2026-04-08 08:34:34 +02:00
mrtoth 8010e9102e Allow disabling boolean flags from the CLI
Pair --hardened, --dry-run, and --unshare-net (renamed from --no-net)
with negation counterparts so a CLI invocation can override a truthy
config-file or profile value.
2026-04-08 00:22:50 +02:00
mrtoth 8ecba5d6dc Add option to pass through arguments to brwap, use shlex for dry-run 2026-04-04 08:51:08 +02:00
mrtoth c7c4c673cb Add mask option to hide paths/files from sandbox 2026-04-01 23:19:08 +02:00
mrtoth 0119834d5a Implement config file parsing and precedence with CLI 2026-03-31 01:22:08 +02:00
mrtoth 99f9395c10 Move require_run_user to lib.rs and make blacklist module private 2026-03-25 23:54:35 +01:00
mrtoth 82f84247f1 Rework handling of /run and ${RUNUSER} in blacklist mode 2026-03-25 22:48:39 +01:00
mrtoth ada9da7ae7 Reject empty HOME envvar 2026-03-20 21:43:08 +01:00
mrtoth bf53d92d49 Initial commit 2026-03-20 18:40:08 +01:00