-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DBus filtering enhancements #3406
Conversation
The SEE policy of xdg-dbus-proxy allows clients to see objects and bus names, but not interact with them. The --call and --broadcast can allow interactions with objects that have the SEE policy set. Profile support for these proxy options will be added in a future commit.
This allows setting per-member and per-object path policies for xdg-dbus-proxy.
--dbus-user.log and --dbus-system.log instruct xdg-dbus-proxy to log interactions with the session and system buses, respectively. --dbus-log= can specify the location of the log file. If no location is specified, log output is written to stdout.
D-Bus audit is now more in line with D-Bus filtering settings: * Checks both the DBUS_SESSION_BUS_ADDRESS and DBUS_SYSTEM_BUS_ADDRESS environment variables. * Also checks common paths for fallback sockets in /run. * Will report GOOD when D-Bus filtering is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Becoming complex 🤯.
dbus-{user,system}.see
will be mostly to unbreak apps while still restricting those addresses. Right?dbus-{user,system}-log
🥇dbus-{user,system}.{call,broadcast}
doesdbus-user.call org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications
implydbus-user.talk org.freedesktop.Notifications
(with restirction)? If so, we could provide ainclude dbus.inc
(with a better name) that is included and restricts common addresses. Like
include dbus.inc
dbus-user filter
dbus-user.talk org.freedesktop.Notifications
which would allow o.f.N, but only as o.f.N.
and then
in any profile that needs access to the notification daemon. |
Sorry for not checking back earlier, I was unfortunately very busy with projects at uni. Does this look good to merge? |
From the (low-level) profile interface standpoint, yes. |
@kris7t xdg-dbus-proxy is started with arg0=3 which looks really strength in system-monitoing tools. |
Confirming @rusty-snake's observation. E.g. when running dconf-editor the xdg-dbus-proxy process shows up with process names |
@rusty-snake @glitsj16 That might be a side effect of using At least for me, the correct |
@kris7t Thanks for explaining, very informative. Using htop does indeed show the correct name. Personally I don't think it's a high-priority issue, but I'll try to file a bug report somewhere nonetheless. Take care! |
@kris7t 👍 Just a question for my understanding, why we can not simply execute |
@rusty-snake That's exactly what we are doing: Line 233 in d1dd363
Here |
Hmm, |
Sort commands and sections in firejail.1.in and sync the result with firejail-profile.5.in. * Commands: `--dbus-system.*`, `--dbus-user.*`, `--icmptrace`, `--ip=none`, `memory-deny-write-execute`, `--noinput` * Sections: "LANDLOCK", "NAME VALIDATION" Relates to netblue30#3190 netblue30#3406 netblue30#4209 netblue30#5856 netblue30#6078.
Sort commands in firejail.1.in and sync the result with firejail-profile.5.in. * Commands: `--dbus-system.*`, `--dbus-user.*`, `--icmptrace`, `--ip=none`, `memory-deny-write-execute`, `--noinput` Relates to netblue30#3190 netblue30#3406 netblue30#4209.
This PR exposes additional functionalities from
xdg-dbus-proxy
:--dbus-user.see
and--dbus-system.see
allow setting the SEE policy for DBus names.--dbus-{user,system}.{call,broadcast}
allows setting per interface and per object path policies. For example, we can setto safely allow notifications without exposing additional objects (e.g.
/org/gnome/Shell
).--dbus-{user,system}.log
to turn on DBus proxy logging (implement xdg-dbus-proxy --log / log denied D-Bus access tries #3402). Unfortunately, this is not as useful as it may seem, because without--filer
,xdg-dbus-proxy --log
will not actually log anything. So we can use the options for debugging applications that fail due to DBus filters, but not for building DBus profiles from scratch.In addition, this PR updates
faudit
so it won't report MAYBE when DBus filters are in effect (#3326 (comment)).A next step would be to either find a better DBus logging option (maybe with
dbus-monitor
), or stay with this one, and create some contrib scripts to generate filter rules from (rejected) DBus communications.