mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #801] [enhancement] Document abstract sockets and what to do about them #544
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#544
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chiraag-nataraj on GitHub (Sep 21, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/801
I wonder if it would be a good idea to start documenting all the different abstract sockets and how to disable them. Notably, it might be a good idea because not everyone can create a new network namespace. I'll start the thread off with two major ones:
-nolisten localto the relevant config file (some examples are given at http://tstarling.com/blog/2016/06/x11-security-isolation/ as well as in the thread).<listen>unix:tmpdir=/tmp</listen>and change it to something like<listen>unix:path=/tmp/blah</listen>(obviously replacing "blah" with a more descriptive name). As noted in that same thread, there may be multiple DBus configuration files lying around, since some programs like to control exactly what the configuration is. In order to eliminate these kinds of sockets, you will have to find and edit all of the DBus configuration files.Also note that you can check if you have abstract sockets set up by looking at the output of
sudo netstat -xap | grep '@'.@lheckemann commented on GitHub (Sep 25, 2016):
I don't think documenting specific cases of abstract sockets is really sufficient for secure isolation. Instead, it would make more sense to block DBus completely (by default? Not sure about that) and document very clearly that permitting it will often allow jail escapes.
@lheckemann commented on GitHub (Sep 25, 2016):
"the session bus assumes that all connecting processes have the same privileges" so applications simply should not have access to the session bus. See comment on #796 for details
@chiraag-nataraj commented on GitHub (Sep 26, 2016):
Sure. The problem is that it's super hard to restrict access when DBus is listening over an abstract socket. Forcing DBus to use regular sockets makes it far easier to restrict access (e.g. even if you can't set up a new network namespace).
@lheckemann commented on GitHub (Sep 26, 2016):
It's not super hard, you just need to create a new network namespace. Not creating a new network namespace leaves the possibility that other programs that listen on abstract sockets allow a vulnerability, and requires non-standard config for D-Bus. Do we really want to default to an insecure config, rather than documenting that not isolating the network is usually insecure and the issues that isolating the network can cause?
@chiraag-nataraj commented on GitHub (Sep 26, 2016):
Again, there are many scenarios (in my own case, at least), where it is not possible for me to create a new network namespace. I spend a lot of time at school, and hence use wifi (a new network namespace only works with an ethernet connection). Even at home I usually use wifi, and hence have the same problem. If the program doesn't require the internet, that's great, but I have several (e.g. Firefox), which need access.
That's precisely the point. In the cases when creating a new network namespace is not possible or practical, what am I supposed to do? Just give up? Why not document how to change the configurations for whichever programs (X11, DBus, etc.)? Yes, it's non-standard, but that's much more a reflection of insecure defaults and idiocy than anything else.
@lheckemann commented on GitHub (Oct 15, 2016):
Is there a good reason to bridge interfaces rather than setting the host machine up as a router which will then forward traffic as appropriate, regardless of it being through wifi or ethernet? That also makes it stable over changes in the network configuration, e.g. switching between wifi and ethernet, or multiple interfaces.
@netblue30 commented on GitHub (Oct 16, 2016):
You can definitely set up a bridge, enable ip forwarding, configure NAT in iptables and push all your sandboxes on the bridge. This will also work on wifi.
@lheckemann commented on GitHub (Oct 16, 2016):
Would this perhaps be a sensible default?
@netblue30 commented on GitHub (Oct 17, 2016):
No, because this would require to mess up with the main netfilter configuration the user has running on the system.
@lheckemann commented on GitHub (Oct 17, 2016):
I can't help but feel that the firewall mechanism isn't very well suited for any sort of application that needs to NAT stuff... That was always an issue with Docker too.
@netblue30 commented on GitHub (Oct 18, 2016):
Yes, Docker does it by default. Also LXC installs a bridge device in the system. Somehow it is a mater of packaging, since the bridge is created when docker and lxc are installed. I don't know how they deal with NAT or port forwarding for running servers.
@testbird commented on GitHub (Mar 2, 2017):
Router and nat setup may not have to be a mess.
https://firehol.org
@chiraag-nataraj commented on GitHub (Mar 29, 2018):
Moot for dbus (at least on systemd systems) because they moved to socket activation and regular (file-based) unix sockets.