Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. How Meta's Muse works, revealed by the 6.8 GB filesystem it sent me(mouse.dev)
    40comments
  2. OpenAI GPT–6 Astra breaks Enigma message that has resisted solution since 2005(cryptocellar.org)
    231comments
  3. Apple has added persistent 'ads' to iOS, and it's driving users crazy(techradar.com)
    148comments
  4. Show HN: Drop – a rootless Linux sandbox with gVisor support(droprun.sh)
    20comments
  5. Jev – a curation of Jev demos on X, tools, skills, and integrations(github.com/amal-david)
    11comments
  6. Can gzip be a language model?(nathan.rs)
    119comments
  7. Solitaire Alone Together(solitairealonetogether.com)
    3comments
  8. MiMo v2.6(xiaomi.com)
    456comments
  9. OpenAI is about to eat Jev's lunch – Arcturus Labs(arcturus-labs.com)
    69comments
  10. Spymarks, Not Watermarks(brand.io)
    149comments
  11. Writing Rust code that's fast by asking agents to make the code faster(minimaxir.com)
    discuss
  12. Muse, Meta's extraordinarily privileged AI assistant, has a serious 0-day(arstechnica.com)
    17comments
  13. Line Scan Photos from MUNI Heritage Weekend in San Francisco(lawrence.lu)
    15comments
  14. Teleoperated Humans(jefftk.com)
    13comments
  15. Attention is all you have(alicegg.tech)
    296comments
  16. Transformers Explained Visually(poloclub.github.io)
    81comments
  17. The Economics of Open-Weight Inference(ornn.com)
    2comments
  18. What Sun got wrong(dtrace.org)
    375comments
  19. I said no and Apple said yes(dbushell.com)
    482comments
  20. Vacate a Drone Restriction That Criminalized Recording Immigration Agents(eff.org)
    5comments
  21. A font that reads what you wrote(rohanadwankar.github.io)
    36comments
  22. I don't want to read what you didn't write(colinbreck.com)
    383comments
  23. MiMo-v2.6-Pro: Intelligence, Performance and Price Analysis(artificialanalysis.ai)
    54comments
  24. AMD's random number generator can't generate a 0?(flatassembler.net)
    142comments
  25. AI coding has made CI a bottleneck, so we reworked ours to keep up(linear.app)
    359comments
  26. Engineering Memory: On learning to memorize first 100 digits of pi (2024)(gregorygundersen.com)
    30comments
  27. 9 Ads per Minute: FIFA Cup 26 – "the price of the beautiful game"(bristol.ac.uk)
    194comments
  28. AI Has No Wisdom and Neither Will You(alexn.org)
    437comments
  29. Divide by depth for instant 3D(gabrieloc.com)
    35comments
  30. What It's Like to Work in One of America's Data Centers(wsj.com)
    43comments

Show HN: Drop – a rootless Linux sandbox with gVisor support

73 pointsby 2h agodroprun.sh
20 comments
I created Drop because I always felt uneasy installing and running third-party programs using my main user account. A single compromised dependency means a full compromise of the system. What is even worse, because I ship software from my computer, a single compromised dependency can lead to compromise of all the users of my software.

Containers and VMs are one solution, but for local work, they are often detrimental to productivity. It takes effort to configure a machine with all the tools and configs needed for productive work, but a container or a VM will be stripped of all these tools. This is great for production deployments, where the aim is a reproducible system with minimal dependencies, but can get in the way of productive local work.

Drop is language independent, but the workflow is inspired by Python's virtualenv. With virtualenv the environment isolation is only a convention that relies on installed dependencies being good citizens. With Drop the isolation is enforced.

Each Drop environment gets its own writable and easily disposable home dir, with only selected config files and dirs from the original home mounted, mostly read-only.

Drop uses Linux namespaces for isolation (user, mount, network, PID, IPC, cgroup), doesn't require root and, as an option, uses gVisor user-space kernel, which adds protection against exploiting host kernel vulnerabilities to escape the sandbox.

I don't want to make the introductory post too lengthy, but I'm here to answer any questions and give any additional technical details.

Note: This is my 3rd submission of the project, the first two did not draw attention. Since then I have added support for gVisor and created a project website to better explain the concept and organize documentation.

1h agoHN ↗

So, the primary advantage of this over bubblewrap is the insulation layer between the program and kernel syscalls?

1h agoHN ↗

Bubblewrap is a low level tool, it describes itself as a sandbox building block, rather than a high-level sandbox intended to be used directly (for example, Flatpak uses bubblewrap as its building block). Drop in contrast is high-level, designed to be used directly in day-to-day work without the need to assemble the low-level details of the sandbox.

1h agoHN ↗

Have you ever tried to use proot?

It does not use process namespaces, and can run on Android (on Termux with proot-distro).

1h agoHN ↗

Hi OP, funny enough I’m working on something very similar. Lots of us are I guess! Take that as validation of your thinking.

I like that your readme has a couple paragraphs comparing to popular tools in this space. Personally I feel it is a bit light on the security differentiators (if any). For example you are using the same fundamental primitives that are used in nsjail, runc, etc. Thus it seems you have recreated those libraries in some aspects, so would be curious to hear your rationale for approaching this way vs building explicitly on those primitives.

33m agoHN ↗

Thanks! My initial approach and the first prototype was for Drop to be a Python script that generates config.json file for runc Docker runtime (I also tried crun). I ran into issues that prevented the sandbox from being set up with all the Drop-required properties. These issues were certainly technically fixable, but it could be difficult for a new project with no usage to advocate for features in mature and widely adopted tools. Especially that runc and crun are OCI-compatible Container Runtimes, and Drop is not an OCI-compatible container, so it could be justifiably out of scope for these projects not to support Drop usage.

Anyway, my decision, for which I also evaluated the use of bubblewrap as a building block, was to err on the side of flexibility that calling fine-grained Linux APIs directly give. For a project like Drop, runc could be seen as very coarse-grained JSON-based API to Linux sandboxing calls (basically a single call: setup a sandbox, here is a json config that describes it), similarly bubblewrap is a coarse grained command-line API to Linux sandboxing calls. Reusing such tried and proved layers of course also has significant advantages, so as in case of many engineering decision, it wasn't super obvious which path is better.

Drop eventually integrated gVisor's runsc (as an option), which is also OCI-compatible Container Runtime, but this is to add a user-space kernel isolation layer.

1h agoHN ↗

This is super interesting to me. I've slowly been working on something similar (https://gitlab.com/saghm/tartarus) because my ideal sandboxing is "prevent writing to anything outside this dir but still allow reading to most things so that I don't have to manually copy things into a container/VM". I approached it by trying to figure out how to build up a bubblewrap based on a config that gave the properties I wanted, with the hope that I could eventually expand it to support other platforms via stuff like `sandbox-exec` on MacOS, but I haven't had time to work on it more for a while.

At a glance, this seems to be providing most of what I was originally looking for when I ended up deciding I'd have to write it myself, but focusing specifically on Linux and providing a more full-fledged sandbox rather than only caring about a small set of permissions that I personally had a need for. Probably the biggest (and least hardened) feature that I spent time on in mine was trying to figure out how to allow arbitrary GUI apps so that I could run agents in it via Zed.

I'm definitely going to try this out and see how well it works for me. It's insane to me that this is something none of the big AI companies have bothered solving this yet other than via opaque rules built into their harnesses or absolutely awful manual rules that expect me to hard-code shapes of shell commands that I want to allow or not allow.

1h agoHN ↗

my ideal sandboxing is "prevent writing to anything outside this dir but still allow reading to most things so that I don't have to manually copy things into a container/VM"

That's what Codex does out of the box, and it's not good against malware - i.e. a rogue npm packet (or even just codex after prompt injection) can read your ssh key and send it to the attacker.

13m agoHN ↗

Small world, we’re all working on the same thing!

I went with Docker because history has taught me that new isolation strategies _will_ have escape bugs at some point, and I’m distrustful that the LLM can’t find one if it wants to.

Probably the biggest (and least hardened) feature that I spent time on in mine was trying to figure out how to allow arbitrary GUI apps so that I could run agents in it via Zed.

I actually have code for this if you want to use/fork/borrow it. TLDR, mine pretends to be an ACP agent so you run Zed on the host, but under the hood that binary is just creating a Docker container with your image and agent, copying files, etc, and then proxying ACP messages via web socket back and forth. Except for the built-in ACP read/write file and shell endpoints. Those get executed inside the container by the proxy by default, though there’s a config option to pass either or both through to the host.

Repo is https://github.com/SethCurry/abyss and the code you’d want would be in ‘internal/websockets/wsacp’.

It does wrap them in protobuf and there’s some router-like stuff so you can add your own non-ACP messages between the two ends of the proxy.

main also has experimental wasm plugin support in the proxies so you can block prompts/tool calls/whatever in an agent-independent way, or add RAG that works for every agent in the world, or whatever.

52m agoHN ↗

This is exactly what I was looking for - the website and docs are easy on the brain. I have some apps hosted on distrobox containers that I'd rather not have write access to my home dir.

51m agoHN ↗

How is this different than bwrap or srt and others? Im using bwrap to achieve read only everywhere and and write on pwd. Also pi and other coding agents all have sandboxing that work in similar way

9m agoHN ↗

read-only everywhere and write only to the current directory is good if you want to prevent accidental damage, such as a coding agent could make if it hallucinated an invalid command, like `rm -rf ~`.

If you want to prevent a damage from a malicious dependency or a prompt injection, you need more robust protection (for example read-only everywhere exposes your ssh keys). You can build this on top of bwrap, but because it is a low level sandbox building block, you would likely end up creating some higher level abstraction on top of bwrap (for example srt and Flatpak are build on top of bwrap).

Drop is an attempt to create such a generic, high level sandboxing tool. I personally prefer to run agents already within a sandbox than to rely on a coding agent runtime to sandbox itself. Especially that by doing so, I can use the same sandboxing tool and config for installing other programs that need isolation, not just for running agents.

30m agoHN ↗

What do you see as the main advantages of gvisor instead of working within a lightweight VM with full native performance?

As the container escapes with K8s shows, it is super tricky to get isolation right. E.g. what happens if a file you think is safe to write to is suddenly is replaced by one that isn’t.

28m agoHN ↗

Thank you for building it! I started using Drop a few weeks ago, and I've been very happy with it so far (thanks again for quickly fixing a few issues I've reported :)!).

For me, it nails the convenience vs isolation aspect quite well, and I would like to get to a point where I can use it for all my development by default.

The main challenges that I still have, which none of the solutions I've found so far resolve, are:

- development of containerized applications, where e.g., docker/podman compose is used to bring up services

- development of GUI applications with hardware acceleration, like games (maybe security contexts for pipewire and wayland, like what's done in flatpak would be a good path?)

When I did my research in this space last time, https://litterbox.work/ was another option I've considered, and it is very nice too, but the friction is a bit higher than drop: it's slower to rebuild envs, lacks a "base" config, etc. Drop was much easier to adopt for me so far.

26m agoHN ↗

I've been using gVisor with Docker (or Docker-compatible runtimes) via runsc for years.

It isn't obvious to me what this does that we haven't been able to do for some time now.

15m agoHN ↗

I've been able to use cgroups and net namespaces for years.

It's isn't obvious to me what Docker does that we haven't been able to do for some time now.

4m agoHN ↗

So this seems to be useful to me, when you run drop run it starts a child process and places it into a Linux namespace...it gives the process a separate identity and limited privileges so itt can appear to be root inside the sandbox without being root on the host. It also gives it a separate view of the filesystem and all processes inside see their own process tree rather than all host processes. same for network connections.

BUT IT DOESNT WORK ON MAC OS :( bummer (it's Linux-specific)

Guess i'll test it on a VPS

1m agoHN ↗

Hello, cool project!

Can you explain to me what the benefit of using this is versus something like an LXC container? It is currently my preferred "temp dev env" that behaves like a full system. It can also be customized with cloud-init to load up my preferred settings.