mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[PR #3265] [MERGED] Fine-grained DBus sandboxing #4701
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#4701
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?
📋 Pull Request Information
Original PR: https://github.com/netblue30/firejail/pull/3265
Author: @kris7t
Created: 3/2/2020
Status: ✅ Merged
Merged: 4/7/2020
Merged by: @kris7t
Base:
master← Head:dbus-proxy📝 Commits (9)
6fc8a55Add --dbus-user and --dbus-system options2345cc4Add sbox_exec_v and SBOX_KEEP_FDS0afb43aAdd xdg-dbus-proxy support31df60fAdd dbus filter options5fa90d0Add documentation for DBus filteringdb4c5b0xdg-dbus-proxy hardening90facc1xdg-dbus-proxy socket finding and mount hardening870c8c8Turn DBus profile errors into warningse91b9ffDeprecate --nodbus option📊 Changes
12 files changed (+951 additions, -218 deletions)
View changed files
📝
src/firejail/dbus.c(+417 -22)📝
src/firejail/firejail.h(+16 -2)📝
src/firejail/fs.c(+1 -0)📝
src/firejail/main.c(+77 -3)📝
src/firejail/preproc.c(+14 -0)📝
src/firejail/profile.c(+64 -3)📝
src/firejail/sandbox.c(+1 -2)📝
src/firejail/sbox.c(+195 -174)📝
src/firejail/usage.c(+6 -0)📝
src/include/rundefs.h(+4 -0)📝
src/man/firejail-profile.txt(+48 -6)📝
src/man/firejail.txt(+108 -6)📄 Description
This PR adds the
dbus-useranddbus-systemoptions to individually control access to the session and system DBus buses, as per #3184. Access policies to the buses can beallow, which completely allows the bus,filter, which runsxdg-dbus-proxy, andnone, which disables access. Thenodbusoptions, which is equivalent todbus-user nonedbus-system noneis kept for compatibility.Filter rules for
xdg-dbus-proxycan be specified with thedbus-user.talk,dbus-user.own,dbus-system.talk, anddbus-system.ownoptions. Whilexdg-dbus-proxyimplements finer-grained rules, these four should hopefully be enough to convert filter rules from Flatpak manifests.On the implementation side:
blacklistandwhitelistcommands.xdg-dbus-proxyruns outside the sandbox namespace (to maintain access to the original DBus sockets), but contained by a modified version ofsbox_run. It is linked to the parent firejail process by a pipe fd, closing which triggers its exit, so it (hopefully) quits when the parent firejail process exits for any reason./run/firejail/dbusand are bind-mounted to their usual locations inside the sandbox. Even the system DBus socket is owned the user running the sandbox, not root, because if wechownit to root, xdg-dbus-proxy cannot clean them up when it exits (an the parent firejail process might not be around to clean the up instead). So inside the sandbox, the system DBus socket is owned by a normal user. This does not cause any problems when connecting to the bus, but might be used to detect the sandbox.This PR does not contain any profile changes, so all profiles remain to constrain DBus access in a coarse-grained way. Hopefully, in the future, profiles can be updated to take advantage of DBus filtering, but that might require a hard dependency on xdg-dbus-proxy, or some auto-detection mechanism.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.