Products › lamco-dbus-tools › Docs

Audit a machine's D-Bus policy and exposure

Audit a machine's D-Bus policy and exposure: Who may call and own each system bus name, its unit's hardening score and polkit actions, with findings in SARIF.

Describes version 0.4.1.

Needs dbussee and dbustell, and the files, readable as yourself. Layer 0, and layer 1 for who owns each name on the live bus. Nothing is called: The audit reads files and asks the bus only who owns what.

Collect

$ dbussee audit collect --out audit.json
The system bus under /: 56 names, 28 service files, 30 units scored by systemd 257 (257.13-1~deb13u1), 286 polkit actions, 22 AppArmor profiles with D-Bus rules.

NAME                                         RUNS AS   UNIT                           SCORE EVERY USER MAY           ACTIONS
...
org.freedesktop.UDisks2                      root      udisks2.service                  9.4 call all                 52
org.freedesktop.hostname1                    root      systemd-hostnamed.service        1.7 call all                 6
org.freedesktop.login1                       root      systemd-logind.service           2.8 call 7 ifaces            37
...

That's Debian 13. For each name: As whom it runs, its unit and that unit's score from systemd-analyze security --offline=yes, what every user may do with it, by the policy as dbus-daemon reads it, and how many permission actions are named for it. (dbus-broker differs) marks a name the two implementations give every user differently.

--session audits the session bus. --no-score skips scoring, which is most of the time a collection takes. --root DIR reads a copy of a machine instead of this one.

The findings

dbustell audit audit.json

On Debian 13, among others:

POL-001 An allow with no destination opens an interface to every service: /usr/share/dbus-1/system.d/org.kde.kf6auth.conf:8: <allow send_interface="org.kde.kf6auth"/> names no destination, so it opens that to every service on the bus. Lintian calls it dbus-policy-without-send-destination.
POL-003 Every user may own a name on the system bus: /etc/dbus-1/system.d/com.redhat.NewPrinterNotification.conf:11: <allow own="com.redhat.NewPrinterNotification"/> lets every user take the name, and so stand in for the service to whoever calls it by name.
AUD-001 A root service every user may call, with little hardening: org.freedesktop.UDisks2: Every user may call every method, it runs as root, and its unit udisks2.service scores 9.4 UNSAFE.

The findings reference has every POL- and AUD- finding. A finding is a reading of the files: An open policy doesn't mean a service authorizes nothing, since many check with polkit inside.

SARIF, for a viewer or CI

dbustell audit audit.json --sarif audit.sarif

What it can't know

  • /etc/polkit-1/rules.d is readable only by root on Debian and Fedora; AUD-005 says so. Local rules there tend to loosen the defaults.
  • Which permission action a method checks: Nothing declares it.
  • Whether a user has a seat, for an at_console block.
  • What a running service actually does with a call.