Very interesting. I just started researching this topic yesterday to build something for adjacent use cases (sandboxing LLM authored programs). My initial prototype is using a wasm based sandbox, but I want something more robust and flexible. Some of my use cases are very latency sensitive. What sort of overhead are you seeing?
Show HN: Zerobox – Sandbox any command with file, network, credential controls
51–60 of 108 posts
Re: Show HN: Zerobox – Sandbox any command with file, network, credential controls
#52This is really useful! How well does it compare though to Docker etc. Because I am worried about sandbox escapes. This is what we currently use to sandbox JS inside Browsers and Node (without anything extra) : https://github.com/Qbix/Platform/blob/main/platform/plugins/... I like tools like this, but they all seem to share the same underlying shape: take an arbitrary process and try to restrict it with OS primitives…
Docker gives you full filesystem isolation and resource limits. Zerobox gives you granular file/network/credential controls with near zero overhead. You can in fact use Zerobox _inside_ Docker (e.g. for secret management)
Re: Show HN: Zerobox – Sandbox any command with file, network, credential controls
#53there's been so many of these -- which of these sandboxing tools is best?
Not a single one. All of them are solving the obvious (and wrong) problem.
Re: Show HN: Zerobox – Sandbox any command with file, network, credential controls
#54Re: Show HN: Zerobox – Sandbox any command with file, network, credential controls
#55Re: Show HN: Zerobox – Sandbox any command with file, network, credential controls
#56Earlier quoted context omitted.
What if the program doesn’t respect those env vars? Can Zerobox still block network calls in that case?
Great question! On Linux, yes, network namespaces enforce that and all net traffic goes through the proxy. Direct connections are blocked at the kernel level even if the program ignores proxy env vars, but I will test this case a bit more (unsure how to though, most network calls would respect HTTPS_PROXY and other similar env vars). That being said, the default behaviour is no network, so nothing will be routed if i…
Re: Show HN: Zerobox – Sandbox any command with file, network, credential controls
#57Compare with and steal any ideas you like from mine if you like. I've got a semi-decent curl|bash pattern covered, and also add network filtering via pasta (which may be more robust than rolling your own). https://github.com/reubenfirmin/bubblewrap-tui
Re: Show HN: Zerobox – Sandbox any command with file, network, credential controls
#58Earlier quoted context omitted.
Do you know if there's a widely shared name for this pattern? I've been collecting examples of it recently - it's a really good idea - but I'm not sure if there's good terminology. "Credential injection" is one option I've seen floating around.
simonw, I have been seeing "credential injection" and "credential tokenizing" (a la tokenizer: https://github.com/superfly/tokenizer ). I'm also seeing credential "surrogates" mentioned. I am currently working on a mitm proxy for use with devcontainers to try to implement this pattern, but I'm certainly not the only one!
Re: Show HN: Zerobox – Sandbox any command with file, network, credential controls
#59Earlier quoted context omitted.
Great question! On Linux, yes, network namespaces enforce that and all net traffic goes through the proxy. Direct connections are blocked at the kernel level even if the program ignores proxy env vars, but I will test this case a bit more (unsure how to though, most network calls would respect HTTPS_PROXY and other similar env vars). That being said, the default behaviour is no network, so nothing will be routed if i…
How about on macOS?
BUT, the default behaviour (no net) is fully enforced at the kernel level. Domain filtering relies on the program respecting proxy env vars.
Re: Show HN: Zerobox – Sandbox any command with file, network, credential controls
#60This is more a criticism of codex's linux-sandboxing, which you're just wrapping, but it's the first I've ever looked at it. I don't see how it makes sense to invoke bwrap as a forked subprocess. Bubblewrap can't do anything beyond what you can do with unshare directly, which you can simply invoke as a system call without needing to spawn a subprocess or requiring the user to have bwrap installed. It kinds of reeks o…
I'd much rather a system call bwrap than re-implement bwrap, because bwrap has already been extensively tested.