logo

apparmor.d

Unnamed repository; edit this file 'description' to name the repository. git clone https://hacktivis.me/git/apparmor.d.git

usr.sbin.dnsmasq (4223B)


  1. # ------------------------------------------------------------------
  2. #
  3. # Copyright (C) 2009 John Dong <jdong@ubuntu.com>
  4. # Copyright (C) 2010 Canonical Ltd.
  5. #
  6. # This program is free software; you can redistribute it and/or
  7. # modify it under the terms of version 2 of the GNU General Public
  8. # License published by the Free Software Foundation.
  9. #
  10. # ------------------------------------------------------------------
  11. abi <abi/3.0>,
  12. @{TFTP_DIR}=/var/tftp /srv/tftp /srv/tftpboot
  13. include <tunables/global>
  14. profile dnsmasq /usr/{bin,sbin}/dnsmasq flags=(attach_disconnected) {
  15. include <abstractions/base>
  16. include <abstractions/dbus>
  17. include <abstractions/nameservice>
  18. capability chown,
  19. capability net_bind_service,
  20. capability setgid,
  21. capability setuid,
  22. capability dac_override,
  23. capability net_admin, # for DHCP server
  24. capability net_raw, # for DHCP server ping checks
  25. network inet raw,
  26. network inet6 raw,
  27. signal (receive) peer=/usr/{bin,sbin}/libvirtd,
  28. signal (receive) peer=libvirtd,
  29. ptrace (readby) peer=/usr/{bin,sbin}/libvirtd,
  30. ptrace (readby) peer=libvirtd,
  31. owner /dev/tty rw,
  32. @{PROC}/@{pid}/fd/ r,
  33. /etc/dnsmasq.conf r,
  34. /etc/dnsmasq.d/ r,
  35. /etc/dnsmasq.d/* r,
  36. /etc/dnsmasq.d-available/ r,
  37. /etc/dnsmasq.d-available/* r,
  38. /etc/ethers r,
  39. /etc/NetworkManager/dnsmasq.d/ r,
  40. /etc/NetworkManager/dnsmasq.d/* r,
  41. /etc/NetworkManager/dnsmasq-shared.d/ r,
  42. /etc/NetworkManager/dnsmasq-shared.d/* r,
  43. /etc/dnsmasq-conf.conf r,
  44. /etc/dnsmasq-resolv.conf r,
  45. /usr/{bin,sbin}/dnsmasq mr,
  46. /var/log/dnsmasq*.log w,
  47. /usr/share/dnsmasq{-base,}/ r,
  48. /usr/share/dnsmasq{-base,}/* r,
  49. @{run}/*dnsmasq*.pid w,
  50. @{run}/dnsmasq-forwarders.conf r,
  51. @{run}/dnsmasq/ r,
  52. @{run}/dnsmasq/* rw,
  53. /var/lib/misc/dnsmasq.leases rw, # Required only for DHCP server usage
  54. /{,usr/}bin/{ba,da,}sh ix, # Required to execute --dhcp-script argument
  55. # access to iface mtu needed for Router Advertisement messages in IPv6
  56. # Neighbor Discovery protocol (RFC 2461)
  57. @{PROC}/sys/net/ipv6/conf/*/mtu r,
  58. # for the read-only TFTP server
  59. @{TFTP_DIR}/ r,
  60. @{TFTP_DIR}/** r,
  61. # libvirt config and hosts file for dnsmasq
  62. /var/lib/libvirt/dnsmasq/ r,
  63. /var/lib/libvirt/dnsmasq/* r,
  64. # libvirt pid files for dnsmasq
  65. @{run}/libvirt/network/ r,
  66. @{run}/libvirt/network/*.pid rw,
  67. # libvirt lease helper
  68. /usr/lib{,64}/libvirt/libvirt_leaseshelper Cx -> libvirt_leaseshelper,
  69. /usr/libexec/libvirt_leaseshelper Cx -> libvirt_leaseshelper,
  70. # lxc-net pid and lease files
  71. @{run}/lxc/dnsmasq.pid rw,
  72. /var/lib/misc/dnsmasq.*.leases rw,
  73. # lxd-bridge pid and lease files
  74. @{run}/lxd-bridge/dnsmasq.pid rw,
  75. /var/lib/lxd-bridge/dnsmasq.*.leases rw,
  76. /var/lib/lxd/networks/*/dnsmasq.* r,
  77. /var/lib/lxd/networks/*/dnsmasq.leases rw,
  78. /var/lib/lxd/networks/*/dnsmasq.pid rw,
  79. # NetworkManager integration
  80. /var/lib/NetworkManager/dnsmasq-*.leases rw,
  81. @{run}/nm-dns-dnsmasq.conf r,
  82. @{run}/nm-dnsmasq-*.pid rw,
  83. @{run}/sendsigs.omit.d/*dnsmasq.pid w,
  84. @{run}/NetworkManager/dnsmasq.conf r,
  85. @{run}/NetworkManager/dnsmasq.pid w,
  86. @{run}/NetworkManager/NetworkManager.pid w,
  87. # dnsname plugin in podman
  88. @{run}/containers/cni/dnsname/*/dnsmasq.conf r,
  89. @{run}/containers/cni/dnsname/*/addnhosts r,
  90. @{run}/containers/cni/dnsname/*/pidfile rw,
  91. owner @{run}/user/*/containers/cni/dnsname/*/dnsmasq.conf r,
  92. owner @{run}/user/*/containers/cni/dnsname/*/addnhosts r,
  93. owner @{run}/user/*/containers/cni/dnsname/*/pidfile rw,
  94. # waydroid lxc-net pid file
  95. @{run}/waydroid-lxc/dnsmasq.pid rw,
  96. profile libvirt_leaseshelper {
  97. include <abstractions/base>
  98. /etc/libnl-3/classid r,
  99. /usr/lib{,64}/libvirt/libvirt_leaseshelper mr,
  100. /usr/libexec/libvirt_leaseshelper mr,
  101. owner @{PROC}/@{pid}/net/psched r,
  102. @{sys}/devices/system/node/ r,
  103. @{sys}/devices/system/node/*/meminfo r,
  104. # libvirt lease and status files for dnsmasq
  105. /var/lib/libvirt/dnsmasq/*.leases rw,
  106. /var/lib/libvirt/dnsmasq/*.status* rw,
  107. @{run}/leaseshelper.pid rwk,
  108. }
  109. # Site-specific additions and overrides. See local/README for details.
  110. include if exists <local/usr.sbin.dnsmasq>
  111. }