logo

apparmor.d

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

base (6886B)


  1. # vim:syntax=apparmor
  2. # ------------------------------------------------------------------
  3. #
  4. # Copyright (C) 2002-2009 Novell/SUSE
  5. # Copyright (C) 2009-2011 Canonical Ltd.
  6. #
  7. # This program is free software; you can redistribute it and/or
  8. # modify it under the terms of version 2 of the GNU General Public
  9. # License published by the Free Software Foundation.
  10. #
  11. # ------------------------------------------------------------------
  12. abi <abi/3.0>,
  13. include <abstractions/crypto>
  14. # (Note that the ldd profile has inlined this file; if you make
  15. # modifications here, please consider including them in the ldd
  16. # profile as well.)
  17. # The __canary_death_handler function writes a time-stamped log
  18. # message to /dev/log for logging by syslogd. So, /dev/log, timezones,
  19. # and localisations of date should be available EVERYWHERE, so
  20. # StackGuard, FormatGuard, etc., alerts can be properly logged.
  21. /dev/log w,
  22. /dev/random r,
  23. /dev/urandom r,
  24. # Allow access to the uuidd daemon (this daemon is a thin wrapper around
  25. # time and getrandom()/{,u}random and, when available, runs under an
  26. # unprivilged, dedicated user).
  27. @{run}/uuidd/request r,
  28. @{etc_ro}/locale/** r,
  29. @{etc_ro}/locale.alias r,
  30. @{etc_ro}/localtime r,
  31. /usr/share/locale-bundle/** r,
  32. /usr/share/locale-langpack/** r,
  33. /usr/share/locale/** r,
  34. /usr/share/**/locale/** r,
  35. /usr/share/zoneinfo{,-icu}/ r,
  36. /usr/share/zoneinfo{,-icu}/** r,
  37. /usr/share/X11/locale/** r,
  38. @{run}/systemd/journal/dev-log w,
  39. # systemd native journal API (see sd_journal_print(4))
  40. @{run}/systemd/journal/socket w,
  41. # Nested containers and anything using systemd-cat need this. 'r' shouldn't
  42. # be required but applications fail without it. journald doesn't leak
  43. # anything when reading so this is ok.
  44. @{run}/systemd/journal/stdout rw,
  45. /usr/lib{,32,64}/locale/** mr,
  46. /usr/lib{,32,64}/gconv/*.so mr,
  47. /usr/lib{,32,64}/gconv/gconv-modules* mr,
  48. /usr/lib/@{multiarch}/gconv/*.so mr,
  49. /usr/lib/@{multiarch}/gconv/gconv-modules* mr,
  50. # used by glibc when binding to ephemeral ports
  51. @{etc_ro}/bindresvport.blacklist r,
  52. # ld.so.cache and ld are used to load shared libraries; they are best
  53. # available everywhere
  54. @{etc_ro}/ld.so.cache mr,
  55. @{etc_ro}/ld.so.conf r,
  56. @{etc_ro}/ld.so.conf.d/{,*.conf} r,
  57. @{etc_ro}/ld.so.preload r,
  58. /{usr/,}lib{,32,64}/ld{,32,64}-*.so mr,
  59. /{usr/,}lib/@{multiarch}/ld{,32,64}-*.so mr,
  60. /{usr/,}lib/tls/i686/{cmov,nosegneg}/ld-*.so mr,
  61. /{usr/,}lib/i386-linux-gnu/tls/i686/{cmov,nosegneg}/ld-*.so mr,
  62. /opt/*-linux-uclibc/lib/ld-uClibc*so* mr,
  63. @{etc_ro}/ld-musl-*.path mr,
  64. # we might as well allow everything to use common libraries
  65. /{usr/,}lib{,32,64}/** r,
  66. /{usr/,}lib{,32,64}/**.so* mr,
  67. /{usr/,}lib/@{multiarch}/** r,
  68. /{usr/,}lib/@{multiarch}/**.so* mr,
  69. /{usr/,}lib/tls/i686/{cmov,nosegneg}/*.so* mr,
  70. /{usr/,}lib/i386-linux-gnu/tls/i686/{cmov,nosegneg}/*.so* mr,
  71. # FIPS-140-2 versions of some crypto libraries need to access their
  72. # associated integrity verification file, or they will abort.
  73. /{usr/,}lib{,32,64}/.lib*.so*.hmac r,
  74. /{usr/,}lib/@{multiarch}/.lib*.so*.hmac r,
  75. # /dev/null is pretty harmless and frequently used
  76. /dev/null rw,
  77. # as is /dev/zero
  78. /dev/zero rw,
  79. # recent glibc uses /dev/full in preference to /dev/null for programs
  80. # that don't have open fds at exec()
  81. /dev/full rw,
  82. # Sometimes used to determine kernel/user interfaces to use
  83. @{PROC}/sys/kernel/version r,
  84. # Depending on which glibc routine uses this file, base may not be the
  85. # best place -- but many profiles require it, and it is quite harmless.
  86. @{PROC}/sys/kernel/ngroups_max r,
  87. # glibc's sysconf(3) routine to determine free memory, etc
  88. @{PROC}/meminfo r,
  89. @{PROC}/stat r,
  90. @{PROC}/cpuinfo r,
  91. @{sys}/devices/system/cpu/ r,
  92. @{sys}/devices/system/cpu/online r,
  93. @{sys}/devices/system/cpu/possible r,
  94. # glibc's *printf protections read the maps file
  95. @{PROC}/@{pid}/{maps,auxv,status} r,
  96. # some applications will display license information
  97. /usr/share/common-licenses/** r,
  98. # glibc statvfs
  99. @{PROC}/filesystems r,
  100. # glibc malloc (man 5 proc)
  101. @{PROC}/sys/vm/overcommit_memory r,
  102. # Allow determining the highest valid capability of the running kernel
  103. @{PROC}/sys/kernel/cap_last_cap r,
  104. # Allow other processes to read our /proc entries, futexes, perf tracing and
  105. # kcmp for now (they will need 'read' in the first place). Administrators can
  106. # override with:
  107. # deny ptrace (readby) ...
  108. ptrace (readby),
  109. # Allow other processes to trace us by default (they will need 'trace' in
  110. # the first place). Administrators can override with:
  111. # deny ptrace (tracedby) ...
  112. ptrace (tracedby),
  113. # Allow us to ptrace read ourselves
  114. ptrace (read) peer=@{profile_name},
  115. # Allow unconfined processes to send us signals by default
  116. signal (receive) peer=unconfined,
  117. # Allow us to signal ourselves
  118. signal peer=@{profile_name},
  119. # Checking for PID existence is quite common so add it by default for now
  120. signal (receive, send) set=("exists"),
  121. # Allow us to create and use abstract and anonymous sockets
  122. unix peer=(label=@{profile_name}),
  123. # Allow unconfined processes to us via unix sockets
  124. unix (receive) peer=(label=unconfined),
  125. # Allow us to create abstract and anonymous sockets
  126. unix (create),
  127. # Allow us to getattr, getopt, setop and shutdown on unix sockets
  128. unix (getattr, getopt, setopt, shutdown),
  129. # Workaround https://launchpad.net/bugs/359338 until upstream handles stacked
  130. # filesystems generally. This does not appreciably decrease security with
  131. # Ubuntu profiles because the user is expected to have access to files owned
  132. # by him/her. Exceptions to this are explicit in the profiles. While this rule
  133. # grants access to those exceptions, the intended privacy is maintained due to
  134. # the encrypted contents of the files in this directory. Files in this
  135. # directory will also use filename encryption by default, so the files are
  136. # further protected. Also, with the use of 'owner', this rule properly
  137. # prevents access to the files from processes running under a different uid.
  138. # encrypted ~/.Private and old-style encrypted $HOME
  139. owner @{HOME}/.Private/ r,
  140. owner @{HOME}/.Private/** mrixwlk,
  141. # new-style encrypted $HOME
  142. owner @{HOMEDIRS}/.ecryptfs/*/.Private/ r,
  143. owner @{HOMEDIRS}/.ecryptfs/*/.Private/** mrixwlk,
  144. # Include additions to the abstraction
  145. include if exists <abstractions/base.d>