TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Bubblewrap: Unprivileged sandboxing tool for Linux

189 pointsby varbhatabout 3 years ago

13 comments

rsa25519about 3 years ago
Note that a sandbox escape is often possible via TIOCSTI (CVE-2017-5226) [0] unless a special flag (--new-session) is used.<p>Bubblewrap is aware of this, yet their documentation gives no indication that this flag is necessary to produce a secure sandbox. In --help, the documentation of --new-session is simply &quot;Create a new terminal session,&quot; which severely understates its importance.<p>It&#x27;s frustrating to have such a useful tool be knowingly easy to misuse.<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;containers&#x2F;bubblewrap&#x2F;issues&#x2F;142" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;containers&#x2F;bubblewrap&#x2F;issues&#x2F;142</a>
评论 #30825641 未加载
评论 #30830498 未加载
anderspitmanabout 3 years ago
Still requires SUID. It makes no sense to have to increase privileges in order to be able to decrease privileges. Any process should be able to spawn a child process with strictly lesser privileges, including granular cpu, memory, network, and filesystem (including path and size restrictions) access. It&#x27;s sad there isn&#x27;t a simple, standard cross-platform API for doing this.<p>I would be fine having to rewrite my apps to take advantage of some fancy capabilities-based security paradigm, but give me realistic APIs to do so.<p>I&#x27;m currently experimenting with shipping apps as QEMU VMs, packaging QEMU and a minimal kernel with the app. It works surprisingly well, even on Windows with full x86 emulation. And with their newish WHPX API (basically kvm for Windows) the future might be really exciting.<p>EDIT: Someone on the Firejail thread says bubblewrap can be compiled non-SUID and that&#x27;s the common usage these days. I need to look into this more.
评论 #30828754 未加载
评论 #30826893 未加载
评论 #30824956 未加载
评论 #30827299 未加载
jamesdutcabout 3 years ago
Bubblewrap is a surprisingly useful tool for general system administration tasks.<p>Even though the documentation claims that &quot;[y]ou are unlikely to use it directly from the commandline, although that is possible,&quot; I use it as a helper tool in this mode very frequently.<p>This can be very useful for debugging since, for example, you can `bwrap --ro-bind &#x2F; &#x2F; --tmpfs ~ $SHELL` to get a &quot;clean&quot; shell in which you can isolate yourself from the effect of configuration dotfiles and can even `--ro-bind my-hosts &#x2F;etc&#x2F;hosts` to simulate certain system-level state (without requiring a full VM, heavier container, or root access.)<p>Of course, I&#x27;ve also written some simple shell scripts around `bwrap` to make this all a bit simpler (since this quickly reaches `qemu`-levels of argv proliferation.)
评论 #30849285 未加载
skywal_labout 3 years ago
&quot;How does it compare to firejail?&quot; you were going to ask: <a href="https:&#x2F;&#x2F;github.com&#x2F;containers&#x2F;bubblewrap#related-project-comparison-firejail" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;containers&#x2F;bubblewrap#related-project-com...</a>.<p>You&#x27;re welcome.
dangabout 3 years ago
Related:<p><i>Bubblewrap: Unprivileged sandboxing tool</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12241971" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12241971</a> - Aug 2016 (8 comments)
LinuxBenderabout 3 years ago
This looks like a very useful tool especially for isolating old unsupported daemons and not having to write really complex selinux rules especially in places where others are tempted to just set selinux permissive. And not just because I like bubblewrap IRL.<p>I see there are a few usage examples [1] out there. Are there any bigger collections of examples that people have run across?<p>[1] - <a href="https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;Bubblewrap" rel="nofollow">https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;Bubblewrap</a>
mstefabout 3 years ago
some time ago i made a comparison between different jailing tools: <a href="https:&#x2F;&#x2F;ctrlc.hu&#x2F;~stef&#x2F;jails.txt" rel="nofollow">https:&#x2F;&#x2F;ctrlc.hu&#x2F;~stef&#x2F;jails.txt</a>
评论 #30947510 未加载
评论 #30828958 未加载
akvadrakoabout 3 years ago
This seems to be the best of breed and it basically the same thing used by flatpak.
评论 #30823927 未加载
rosetremiereabout 3 years ago
Here is something I&#x27;d like to have in fedora (or desktop linux in general): A sort of “workspace manager” using bubblewrap for isolating user-defined groups of applications and file hierarchy.<p>I imagine it as some kind of GUI with “boxes”, each defining a “workspace” with specified permissions (access to that and that folder, network, etc), such that the user could easily drag and drop apps into new workspaces.<p>This way, I could have a “banking” workspace just containing, say, firefox, and a “work” workspace with, say, firefox and thunderbird and whatever, etc. The “workspaces” would by default be as unprivileged as possible, with the possibility to give access to folders, or even maybe to use unionfs or similar to combine the views of different workspaces.<p>For ease of use, I could assign a color or icon to each workspace, and the manager would automatically generate desktop files so that I would easily be able to spot “banking firefox” from “work firefox”.<p>I feel like with bubblewrap, this is only a short python GUI away, and would be super helpful to strengthen security on linux, even more so for non-technically inclined, or lazy people.<p>[Edit:] If someone wants to discuss things further and even maybe try and write a “MVP”, I&#x27;d be happy to try.
评论 #30827627 未加载
评论 #30828149 未加载
lvassabout 3 years ago
&gt;Also, @cgwalters thinks trying to whitelist file paths is a bad idea given the myriad ways users have to manipulate paths, and the myriad ways in which system administrators may configure a system.<p>So you either get the entire filesystem or no file access? Isn&#x27;t this a huge dealbreaker for almost everything?
评论 #30824459 未加载
评论 #30824599 未加载
lapinotabout 3 years ago
Does anyone know if it&#x27;s possible to configure bubblewrap to attach to an existing namespace (network namespace in my case)? I&#x27;m selfhosting stuff and wanted a diy container runtime but i can&#x27;t seem to isolate stuff from the system and still retain some linking between some parts (ie doing stuff like what a docker-compose file specifies).
评论 #30828176 未加载
usr1106about 3 years ago
Who is <a href="https:&#x2F;&#x2F;github.com&#x2F;containers" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;containers</a>? Well, I see the member list and recognize some names as podman developers. But is there any presentation, policy, statutes...?
评论 #30831188 未加载
mobiclickabout 3 years ago
I really wish bubblewrap had a way to mount filesystems as copy-on-write instead of read-only.<p>Having ways to impose limits on memory would be nice too.