Skip to content
This repository was archived by the owner on Jul 23, 2020. It is now read-only.

Commit e2d81f2

Browse files
smcvhadess
authored andcommitted
security: Make D-Bus policy rules only affect SensorProxy itself
D-Bus policy XML files are generic configuration for the bus daemon: they are conventionally named like a bus name, but there is nothing that inherently limits their application to that bus name. In particular this means that a rule like <policy context="default"> <allow send_interface="org.freedesktop.DBus.Properties"/> allows any process on the system bus to send an org.freedesktop.DBus.Properties.Set() call to any other process on the system bus, even if the destination process expected to be only accessible by root. Closes: #41
1 parent f31e0bb commit e2d81f2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

data/net.hadess.SensorProxy.conf

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212

1313
<!-- Only Geoclue can access the compass -->
1414
<policy user="geoclue">
15-
<allow send_interface="net.hadess.SensorProxy.Compass" send_path="/net/hadess/SensorProxy/Compass"/>
16-
<allow send_interface="org.freedesktop.DBus.Introspectable" send_path="/net/hadess/SensorProxy/Compass"/>
17-
<allow send_interface="org.freedesktop.DBus.Properties" send_path="/net/hadess/SensorProxy/Compass"/>
18-
<allow send_interface="org.freedesktop.DBus.Peer" send_path="/net/hadess/SensorProxy/Compass"/>
15+
<allow send_destination="net.hadess.SensorProxy" send_interface="net.hadess.SensorProxy.Compass" send_path="/net/hadess/SensorProxy/Compass"/>
16+
<allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Introspectable" send_path="/net/hadess/SensorProxy/Compass"/>
17+
<allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Properties" send_path="/net/hadess/SensorProxy/Compass"/>
18+
<allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Peer" send_path="/net/hadess/SensorProxy/Compass"/>
1919
</policy>
2020

2121
<!-- Anyone can talk to the main interface -->
2222
<policy context="default">
23-
<allow send_interface="net.hadess.SensorProxy"/>
24-
<allow send_interface="org.freedesktop.DBus.Introspectable"/>
25-
<allow send_interface="org.freedesktop.DBus.Properties"/>
26-
<allow send_interface="org.freedesktop.DBus.Peer"/>
27-
<deny send_interface="org.freedesktop.DBus.Introspectable" send_path="/net/hadess/SensorProxy/Compass"/>
28-
<deny send_interface="org.freedesktop.DBus.Properties" send_path="/net/hadess/SensorProxy/Compass"/>
29-
<deny send_interface="org.freedesktop.DBus.Peer" send_path="/net/hadess/SensorProxy/Compass"/>
30-
<!-- <deny send_interface="net.hadess.SensorProxy.Compass"/> -->
23+
<allow send_destination="net.hadess.SensorProxy" send_interface="net.hadess.SensorProxy"/>
24+
<allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Introspectable"/>
25+
<allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Properties"/>
26+
<allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Peer"/>
27+
<deny send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Introspectable" send_path="/net/hadess/SensorProxy/Compass"/>
28+
<deny send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Properties" send_path="/net/hadess/SensorProxy/Compass"/>
29+
<deny send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Peer" send_path="/net/hadess/SensorProxy/Compass"/>
30+
<!-- <deny send_destination="net.hadess.SensorProxy" send_interface="net.hadess.SensorProxy.Compass"/> -->
3131
</policy>
3232

3333
</busconfig>

0 commit comments

Comments
 (0)