docker-apparmor-profile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # systemctl-mqtt - MQTT client triggering & reporting shutdown on systemd-based systems
  2. #
  3. # Copyright (C) 2020 Fabian Peter Hammerle <fabian@hammerle.me>
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. #include <tunables/global>
  18. profile systemctl-mqtt flags=(attach_disconnected) {
  19. #include <abstractions/base>
  20. network inet,
  21. # https://jlk.fjfi.cvut.cz/arch/manpages/man/apparmor.d.5#Access_Modes
  22. /systemctl-mqtt/ r,
  23. /systemctl-mqtt/** r,
  24. # https://presentations.nordisch.org/apparmor/#/25
  25. /systemctl-mqtt/.venv/bin/systemctl-mqtt rix,
  26. /etc/** r,
  27. /usr/lib/** rm,
  28. /var/** r,
  29. deny /bin/** rwklx,
  30. deny @{PROC}/** rwklx,
  31. deny /sys/** rwklx,
  32. # https://gitlab.com/apparmor/apparmor/-/wikis/AppArmorDBus
  33. #include <abstractions/dbus-strict>
  34. dbus (send, receive)
  35. bus=system
  36. path=/org/freedesktop/login1
  37. interface=org.freedesktop.DBus.Introspectable
  38. member=Introspect
  39. peer=(label=unconfined),
  40. dbus (send)
  41. bus=system
  42. path=/org/freedesktop/login1
  43. interface=org.freedesktop.login1.Manager
  44. member={Inhibit,ListInhibitors,ScheduleShutdown,LockSessions,Suspend}
  45. peer=(label=unconfined),
  46. dbus (receive)
  47. bus=system
  48. path=/org/freedesktop/login1
  49. interface=org.freedesktop.login1.Manager
  50. member=PrepareForShutdown
  51. peer=(label=unconfined),
  52. dbus (send)
  53. bus=system
  54. path=/org/freedesktop/login1
  55. interface=org.freedesktop.DBus.Properties
  56. member=Get
  57. peer=(label=unconfined),
  58. dbus (send)
  59. bus=system
  60. path=/org/freedesktop/systemd1
  61. interface=org.freedesktop.systemd1.Manager
  62. member=RestartUnit
  63. peer=(label=unconfined),
  64. }