logo

apparmor.d

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

nameservice (3762B)


  1. # ------------------------------------------------------------------
  2. #
  3. # Copyright (C) 2002-2009 Novell/SUSE
  4. # Copyright (C) 2009-2011 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. # Many programs wish to perform nameservice-like operations, such as
  13. # looking up users by name or id, groups by name or id, hosts by name
  14. # or IP, etc. These operations may be performed through files, dns,
  15. # NIS, NIS+, LDAP, hesiod, wins, etc. Allow them all here.
  16. @{etc_ro}/group r,
  17. @{etc_ro}/host.conf r,
  18. @{etc_ro}/hosts r,
  19. @{etc_ro}/nsswitch.conf r,
  20. @{etc_ro}/gai.conf r,
  21. @{etc_ro}/passwd r,
  22. @{etc_ro}/protocols r,
  23. # libtirpc (used for NIS/YP login) needs this
  24. @{etc_ro}/netconfig r,
  25. # When using libnss-extrausers, the passwd and group files are merged from
  26. # an alternate path
  27. /var/lib/extrausers/group r,
  28. /var/lib/extrausers/passwd r,
  29. # When using sssd, the passwd and group files are stored in an alternate path
  30. # and the nss plugin also needs to talk to a pipe
  31. /var/lib/sss/mc/group r,
  32. /var/lib/sss/mc/initgroups r,
  33. /var/lib/sss/mc/passwd r,
  34. /var/lib/sss/pipes/nss rw,
  35. @{etc_ro}/resolv.conf r,
  36. # On systems where /etc/resolv.conf is managed programmatically, it is
  37. # a symlink to @{run}/(whatever program is managing it)/resolv.conf.
  38. @{run}/{resolvconf,NetworkManager,systemd/resolve,connman,netconfig}/resolv.conf r,
  39. @{etc_ro}/resolvconf/run/resolv.conf r,
  40. @{run}/systemd/resolve/stub-resolv.conf r,
  41. @{etc_ro}/samba/lmhosts r,
  42. @{etc_ro}/services r,
  43. # db backend
  44. /var/lib/misc/*.db r,
  45. # The Name Service Cache Daemon can cache lookups, sometimes leading
  46. # to vast speed increases when working with network-based lookups.
  47. @{run}/.nscd_socket rw,
  48. @{run}/nscd/socket rw,
  49. /{var/db,var/cache,var/lib,var/run,run}/nscd/{passwd,group,services,hosts} r,
  50. # nscd renames and unlinks files in it's operation that clients will
  51. # have open
  52. #@{run}/nscd/db* rmix,
  53. # The nss libraries are sometimes used in addition to PAM; make sure
  54. # they are available
  55. /{usr/,}lib{,32,64}/libnss_*.so* mr,
  56. /{usr/,}lib/@{multiarch}/libnss_*.so* mr,
  57. @{etc_ro}/default/nss r,
  58. # avahi-daemon is used for mdns4 resolution
  59. @{run}/avahi-daemon/socket rw,
  60. # libnl-3-200 via libnss-gw-name
  61. @{PROC}/@{pid}/net/psched r,
  62. @{etc_ro}/libnl-*/classid r,
  63. # nis
  64. include <abstractions/nis>
  65. # ldap
  66. include <abstractions/ldapclient>
  67. # winbind
  68. include <abstractions/winbind>
  69. # likewise
  70. include <abstractions/likewise>
  71. # mdnsd
  72. include <abstractions/mdns>
  73. # kerberos
  74. include <abstractions/kerberosclient>
  75. #libnss-systemd
  76. include <abstractions/nss-systemd>
  77. # Also allow lookups for systemd-exec's DynamicUsers via D-Bus
  78. # https://www.freedesktop.org/software/systemd/man/systemd.exec.html
  79. dbus send
  80. bus=system
  81. path="/org/freedesktop/systemd1"
  82. interface="org.freedesktop.systemd1.Manager"
  83. member="{GetDynamicUsers,LookupDynamicUserByName,LookupDynamicUserByUID}"
  84. peer=(name="org.freedesktop.systemd1"),
  85. # TCP/UDP network access
  86. network inet stream,
  87. network inet6 stream,
  88. network inet dgram,
  89. network inet6 dgram,
  90. # TODO: adjust when support finer-grained netlink rules
  91. # Netlink raw needed for nscd
  92. network netlink raw,
  93. # interface details
  94. @{PROC}/@{pid}/net/route r,
  95. # Include additions to the abstraction
  96. include if exists <abstractions/nameservice.d>