mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3349] Wiki: Restrict D-Bus #2101
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#2101
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 @rusty-snake on GitHub (Apr 12, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3349
https://github.com/netblue30/firejail/wiki/Restrict-D-Bus
@matu3ba commented on GitHub (Apr 12, 2020):
Looks very nice. :)
Mentioning how to retrieve lists of dbus services on the local system.
A short intro what is blocked per default (everything aside what is allowed?) would be great.
@kris7t commented on GitHub (Apr 13, 2020):
Regarding
org.freedesktop.Notifications: I think the main problem is that Gnome Shell implements the notification service over the same D-Bus connection as the rest of its interfaces. Therefore all Gnome Shell D-Bus objects are exposed via theorg.freedesktop.Notificationsname. According to its man page,xdg-dbus-proxycan filter D-Bus messages per interface. I think something like--see=org.freedesktop.Notifications --call=org.freedesktop.Notifications.*@/org/freedesktop/Notifications --broadcast=org.freedesktop.Notifications.*@/org/freedesktop/Notificationswould be sufficient. Making firejail pass such options toxdg-dbus-proxyis trivial to implement, although may significantly increase profile complexity (again).Of course, this vulnerability is not exclusive to Notifications. It seems filtering by name is not sufficient for services which expose objects with different level of sensitivity over multiple bus names. This may be something to consider when extracting D-Bus filter rules from flatpak manifests. In theory, any
--talkrule can be vulnerable, except maybeorg.freedesktop.portal.*, which were explicitly designed for sandboxing (and even those probably need additional configuration).Regarding
ca.desrt.dconf, according to this post on the Gnome blog, blocking in should be fine for most applications -- GSetting has a keyfile backend. However, at least on my Arch system, there is no~/.vardirectory, which would supposedly store the keyfiles. We might need to whitelist it in the filesystem. There is also a portal for dconf access for some system level settings (I guess window button order and such), but that would be restricted to applications explicitly supporting sandboxing.@rusty-snake commented on GitHub (Apr 13, 2020):
The most names/interfaces have the same name only
.replaces with/. What aboutdbus-user.talk org.freedesktop.Notificationsimplies interface/org/freedesktop/Notifications,org.gnome.Shell.Screenshotsimplies/org//gnome/Shell/Screenshots?@kris7t commented on GitHub (Apr 13, 2020):
I don't think there is a one-to-one(-to-one) mapping between names, interfaces and object paths. For example,
org.kde.StatusNotifierWatcherexposes the object/StatusNotifierWatcherwith the interfaceorg.kde.StatusNotifierWatcher, i.e., the/org/kdeprefix is missing from the object path. It can be even more chaotic: bothorg.mpris.MediaPlayer.firefox.instance41andorg.mpris.MediaPlayer2.spotifyexpose/org/mpris/MediaPlayer2with the interfacesorg.mpris.MediaPlayer2andorg.mpris.MediaPlayer2.Player.It is just a mess: bus names correspond to applications, not services, and an application can expose both privileged and non-privileged services (which is probably in itself a bad idea, but that's what we got). The closest we get to specifying a particular service is the interface, but you still get cookie-cutters like
org.freedesktop.DBus.Properties, which allows reading and writing all properties regardless of the interface that defines them.Object paths a weird, too. You would think
/org/freedesktop/portal/desktop(exposed byorg.freedesktop.portal.Desktop) implementsorg.feedesktop.portal.Desktop, but there is no such interface. Instead, it implements a bunch of interfaces likeorg.freedesktop.portal.Screenshotandorg.freedesktop.portal.FileChooser.The case you mention might be reasonably common, although looking through the session bus with QDBusViewer, more applications don't follow it than those which do. So I am unsure whether even something like
dbus-user.talk-strict bus-nameas an alias of--talk=bus-name --call=bus-name.*@bus-name-with-.-replaced-by-/* --broadcast=bus-name.*@bus-name-with-.-replaced-by-/*would be useful, and having that as a default behavior fordbus-user.talkis probably useless.@rusty-snake commented on GitHub (Apr 19, 2020):
@kris7t what about an own option for specifying allowed interfaces on a name, that is ignored if there is no
dbus-user.talk NAMEand otherwise applied. It would us allow to create a common.inc file for this.@rusty-snake commented on GitHub (Aug 4, 2021):
https://github.com/netblue30/firejail/discussions/4447