mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1822] Recalibration of D-Bus access #1239
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#1239
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 @smitsohu on GitHub (Mar 18, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1822
We have three different options that govern whether an app is allowed access to D-Bus or not....
apparmor: reliably shuts down all D-Bus access in Ubuntu and its derivativesnet none: denies access to the session bus in Ubuntu 16.04 (Mint!), Debian Jessie.... in general distributions that were released some time ago. Also kills connection to the accessibility bus.blacklist /run/user/*/bus: denies access to the session bus in newer distribution releases.Now that we are adding
apparmorto many profiles (184ecb305e,38ffc3f025,971c62aa56,d8b4a63320), I thought it might be a good timepoint to take a step back and reconsider how we want to address the D-Bus issue.In a number profiles right now only one or two or these three options are enabled, which seems to be, at first glance at least, an inconsistent state. The rigorous approach would be to go through these profiles and either enable them all or comment them all (
net noneobviously can't go to some profiles).... that's IMHO the only way to ensure a smooth and consistent user experience everywhere.But then, as many Ubuntu (and Mint) users are expected to switch to upcoming Ubuntu 18.04 LTS, the number of people who may run into problems with
net noneshould decrease considerably. Also the KDE file chooser works without D-Bus since recently. And finally, given how big a security hole D-Bus is, the ability to change application settings could also be considered minor in comparison (thinking of apps like eog or gedit).Personally I have a lot of sympathies for a stricter approach to D-Bus. The question is if we are willing to move ahead even if it will cause problems for users with older software. Also I think we should try to combine
apparmorwithblacklist /run/user/*/bus(andnet nonewhere possible) to ensure consistently working profiles.@Vincent43 commented on GitHub (Mar 18, 2018):
Some thoughts:
net noneaffecting dbus is coincidental. It can't be used when application need network access.apparmorisn't available in all distributions so we can't rely on it alone.@smitsohu commented on GitHub (Mar 18, 2018):
@Vincent43
That's right, I've updated my original post to make my point clearer.
@Fred-Barclay commented on GitHub (Mar 20, 2018):
@smitsohu and @Vincent43 Do you know why net none doesn't stop dbus access on newer distros?
@smitsohu commented on GitHub (Mar 20, 2018):
Replying to myself @smitsohu
Turns out this is a cipher for Kubuntu 16.04.... problems with
apparmorare basically limited to this release (file chooser in KDE apps, Chromium, VLC).A compromise could be that we keep
apparmoras it is now and not enableblacklist /run/user/*/busandnet nonein KDE apps or Chromium or VLC profiles, so that this problem effectively is contained to Kubuntu 16.04.(actually
blacklist /run/user/*/buswould be a possible addition to chromium-common.profile, withenv NO_CHROME_KDE_FILE_DIALOG=1as a workaround)Which still leaves us with:
If not being able to change settings is considered an acceptable price for D-Bus isolation, we should uncomment
blacklist /run/user/*/busandnet nonein a number of profiles, in addition toapparmor. Indeed we seem to have entered a similar trade-off already with whitelisting, see #1793.@smitsohu commented on GitHub (Mar 20, 2018):
Maybe it is easier to discuss with a pull request, I will try to compile something.
@Fred-Barclay D-Bus daemon and applications use a socket for communication, and the default location of this socket changed at some point.
Previously it was an abstract socket, which means it did not exist in the filesystem but only as a network resource. Nowadays the socket is bound to a file path (i.e. /run/user/$UID/bus), it does not exist as a network resource anymore (so that
netis without effect).I just found this discussion that apparently started it all: https://lists.freedesktop.org/archives/dbus/2014-December/016473.html
@Fred-Barclay commented on GitHub (Mar 20, 2018):
@smitsohu Thanks!
I'm doing some testing with virtual machines and it looks like
apparmordoesn't stop dbus access on at least Mint 18.3 and earlier (Ubuntu 16.04 base) since apparmor isn't provided by default.If so then we probably can't count on
apparmorstopping dbus for these distros since a majority of users may not have installed apparmor on their systems.@smitsohu commented on GitHub (Mar 20, 2018):
@Fred-Barclay
Then it is really only Kubuntu 16.04, other Ubuntu 16.04 flavors don't have these big problems.
I didn't yet travel back in time so far 😄
@Fred-Barclay commented on GitHub (Mar 20, 2018):
😄 I did have a typo in that quote - Mint 18.3 is actually a Ubuntu 16.04 derivative. Oops!
@Vincent43 commented on GitHub (Mar 20, 2018):
Mint disables apparmor on Ubuntu kernels? Weird.
@Fred-Barclay commented on GitHub (Mar 20, 2018):
@Vincent43 Clearly I need to do a bit more investigation! Apparmor is present on Mint 18.3:
However,
and when compiling with
./configure --prefix=/usr --enable-apparmor, the necesary headers and etc aren't present by default,This is for firejail built from git. I don't know if the firejail in the repos (0.9.38) or 0.9.52 provided on sourceforge have apparmor enabled; probably @reinerh would know.
UPDATE: firejail 0.9.50 in artful's (Ubuntu 17.10) repos does come with apparmor support. Same as above, though, the headers aren't present on the system so we can't necessarily assume that just because someone is using Ubuntu or Mint that apparmor is enabled for them. If they built from git there's a good chance it isn't.
@Vincent43 commented on GitHub (Mar 20, 2018):
I guess you need this for building against apparmor https://packages.ubuntu.com/xenial/libapparmor-dev
There should be a lot more apparmor packages: https://packages.ubuntu.com/search?keywords=apparmor&searchon=names&suite=xenial§ion=all
@Fred-Barclay commented on GitHub (Mar 20, 2018):
@Vincent43
dpkg -lshows installed packages only. It doesn't search the repos. 😉@netblue30 commented on GitHub (Mar 21, 2018):
Guys, just disregard apparmor for now! It is there in case Canonical decides to upstream their apparmor modifications and bring in proper support to control D-Bus into the kernel. They were supposed to do it two years ago.
@smitsohu:
Let's go with this proposal. If apparmor breaks, we ask the user to disable it until we find a fix. Disabling apparmor in firejail is very easy - just disable the apparmor profile in the kernel:
The difficult part is to enable it. You would need to build firejail with apparmor support:
There is a package you need to install (libapparmor-dev on Debian, apparmor-libapparmor on Arch). The full instructions are here: https://wiki.debian.org/AppArmor/HowToUse (Debian), https://wiki.archlinux.org/index.php/AppArmor (Arch)
@Vincent43 commented on GitHub (Mar 21, 2018):
@netblue30 they want to upstream it. Dbus control was supposed to land in linux 4.15 but it was blocked by Linus himself (it would break all existing profiles outside ubuntu/suse which don't handle dbus access). As a workaround they had to bring policy versioning to userspace first (which is ready and was deployed to debian). Linux 4.17 is current target to upstream more things from apparmor.
@smitsohu commented on GitHub (Mar 29, 2018):
Sorry for this commit mess here!