| 1 | <!-- SPDX-License-Identifier: CC-BY-SA-4.0 --> |
| 2 | <!-- SPDX-FileCopyrightText: 2022-2024 Bartosz Golaszewski <[email protected]> --> |
| 3 | |
| 4 | <!-- This configuration file specifies the required security policies |
| 5 | for the gpio-dbus daemon to work. --> |
| 6 | |
| 7 | <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" |
| 8 | "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> |
| 9 | |
| 10 | <busconfig> |
| 11 | |
| 12 | <!-- Everyone can list GPIO devices and see their properties. --> |
| 13 | <policy context="default"> |
| 14 | <allow send_destination="io.gpiod1" |
| 15 | send_interface="org.freedesktop.DBus.Peer" |
| 16 | send_member="Ping"/> |
| 17 | <allow send_destination="io.gpiod1" |
| 18 | send_interface="org.freedesktop.DBus.Introspectable"/> |
| 19 | <allow send_destination="io.gpiod1" |
| 20 | send_interface="org.freedesktop.DBus.Properties"/> |
| 21 | <allow send_destination="io.gpiod1" |
| 22 | send_interface="org.freedesktop.DBus.ObjectManager"/> |
| 23 | </policy> |
| 24 | |
| 25 | <!-- Daemon must run as the `gpio-manager` user. --> |
| 26 | <policy user="gpio-manager"> |
| 27 | <allow own="io.gpiod1"/> |
| 28 | </policy> |
| 29 | |
| 30 | <!-- Members of the `gpio` group can request and manipulate GPIO lines. --> |
| 31 | <policy group="gpio"> |
| 32 | <allow send_destination="io.gpiod1"/> |
| 33 | </policy> |
| 34 | |
| 35 | <!-- Root can do anything. --> |
| 36 | <policy user="root"> |
| 37 | <allow own="io.gpiod1"/> |
| 38 | <allow send_destination="io.gpiod1"/> |
| 39 | </policy> |
| 40 | |
| 41 | </busconfig> |