Products › lamco-dbus-tools › Interfaces
Snap and Firejail D-Bus rules: dbus-user, dbus-system, interfaces
Snap and Firejail D-Bus rules decide what a confined program reaches on the session and system bus, and lamco-dbus-tools reads both kinds of grant.
Snap and Firejail confine programs on Linux, and each has its own way of deciding what a confined program may reach on D-Bus. Snap writes AppArmor rules that the bus enforces message by message. Firejail filters the bus through the same proxy Flatpak uses, or closes it, or leaves it whole. Neither shows its D-Bus grant in one obvious place, and a program refused by either gets an ordinary AccessDenied or finds a service missing. lamco-dbus-tools reads both kinds of grant from their files, beside Flatpak's, so every sandbox on a machine is listed in one inventory.
What it is
Snap. A snap has no proxy. A connection between a snap's plug and a slot, such as the desktop plug or a dbus slot owning a name, becomes rules in the snap's AppArmor profile, written by snapd. The bus daemon asks the kernel's security module about each message, so the rules are AppArmor dbus rules: Access send, receive or bind, with conditions on bus=, path=, interface=, member= and peer=(name=..., label=...). Each app and hook of a snap has its own profile, labelled snap.NAME.APP. Because the decision is the bus's, the program sees an ordinary refusal and the reason is in the audit log.
Firejail. A profile's dbus-user and dbus-system lines decide each bus. The firejail-profile(5) manual gives the forms: dbus-user filter enables filtered access through xdg-dbus-proxy, dbus-user none disables access, and a profile can also leave a bus whole. Filters are given with dbus-user.see, .talk, .own, .call and .broadcast, and the same under dbus-system, which become the proxy's --see, --talk, --own, --call and --broadcast. Profiles include other profiles, so a line that decides a bus can come from an include.
Most shipped Firejail profiles leave the session bus whole, and with it every service on it, the host's service manager among them. Bare bubblewrap and containers that mount a bus socket have no filter at all.
How lamco-dbus-tools reads it
dbussee sandbox list lists Snap profiles with D-Bus rules and counts how many Firejail profiles filter, close or leave whole the session bus. dbussee sandbox show takes a Snap profile's label (snap.NAME.APP) and shows its D-Bus rules as snapd wrote them, or a Firejail profile's name and rebuilds its proxy options from its dbus-user and dbus-system lines and its includes. dbussee sandbox inside, run inside the confinement, shows the bus as the program sees it. dbusdo sandbox probe can test a Firejail grant on the host's proxy, given as proxy options. dbustell sandbox gives the SBX- findings.
dbussee sandbox list --out inventory.json # Snap profiles with D-Bus rules, Firejail profiles counted
dbussee sandbox show snap.example.app # one snap app's D-Bus rules, as snapd wrote them
dbussee sandbox show myapp # one Firejail profile by name, rebuilt as proxy options
dbusdo sandbox probe --filter --talk=org.freedesktop.Notifications # the same options, on the host's proxy
dbustell sandbox inventory.json # SBX- findings, Firejail's whole session buses among them
Where it has been run
The README's run record has one live run of each, on 2026-11-30 on Ubuntu 24.04 with Sway, snapd 2.76.3, Firejail 0.9.72 and xdg-dbus-proxy 0.1.5: A test snap's 54 AppArmor D-Bus rules were read and set beside calls from inside, one delivered and two refused as the rules said, and a Firejail profile's grant was read and its calls answered as read (the measurement). That's one test snap and one Firejail profile. Its other sandbox runs are of Flatpak with xdg-dbus-proxy on Fedora 44 and 45. The policy audit of Debian 13 and Fedora 45 (2026-11-30) read AppArmor's D-Bus rules among the rest.
Findings
SBX-001: A sandbox is granted a way out of it. Firejail profiles that leave the session bus whole are counted in one finding.SBX-004: A grant the application wasn't seen to use.SBX-006: The host's proxy and the evaluator of its filter disagreed.
Related
- AppArmor and SELinux D-Bus rules, which Snap's rules are.
- xdg-dbus-proxy, which Firejail's filter runs.
- List what each sandboxed application may reach on the buses.
- firejail-profile(5), the D-Bus filtering section.