Commit Graph

9 Commits

Author SHA1 Message Date
mrtoth 1165aea9aa Stop overriding the sandbox hostname
Setting --hostname sandbox inside the UTS namespace was purely cosmetic
(a label for interactive shells) and provided no isolation beyond what
--unshare-uts already gives. It also caused codex to hang for ~5s on
startup: glibc resolved the unknown "sandbox" name via systemd-resolved
and waited through two DNS retry timeouts before giving up.

Dropping the override lets the sandbox inherit the host's hostname,
which already resolves locally, eliminating the stall.
2026-04-27 21:08:05 +02:00
mrtoth 862feada05 Document hardening, network default, and profile merge rules 2026-04-22 23:14:51 +02:00
mrtoth 6933deb441 Document config-example.toml as the canonical deployed config
Makes it clear that the example config is meant to be symlinked into
$XDG_CONFIG_HOME/agent-sandbox/ so it stays in sync with the repo.
2026-04-22 22:43:46 +02:00
mrtoth 327c2933e7 Add README note about ubuntu apparmor woes with bubblewrap 2026-04-08 09:27:40 +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 8958f79ece Document and expand test coverage of config file feature 2026-04-04 08:51:08 +02:00
mrtoth b200be9490 Add README with security model documentation 2026-03-25 23:13:16 +01:00