Advertisement
Guest User

Untitled

a guest
Jan 10th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. # vim:syntax=apparmor
  2. # ------------------------------------------------------------------
  3. #
  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.  
  12. #include <tunables/global>
  13.  
  14. # We want to confine the binaries that match:
  15. # /usr/lib/firefox-4.0b8/firefox
  16. # /usr/lib/firefox-4.0b8/firefox
  17. # but not:
  18. # /usr/lib/firefox-4.0b8/firefox.sh
  19. /usr/lib/firefox{,-[0-9]*}/firefox{,*[^s][^h]} {
  20. #include <abstractions/audio>
  21. #include <abstractions/cups-client>
  22. #include <abstractions/dbus-session>
  23. #include <abstractions/gnome>
  24. #include <abstractions/ibus>
  25. #include <abstractions/kde>
  26. #include <abstractions/nameservice>
  27.  
  28. # for networking
  29. network inet stream,
  30. network inet6 stream,
  31. @{PROC}/@{pid}/net/if_inet6 r,
  32. @{PROC}/@{pid}/net/ipv6_route r,
  33.  
  34. # should maybe be in abstractions
  35. /usr/share/xubuntu/applications/defaults.list r,
  36. owner /tmp/** m,
  37. owner /var/tmp/** m,
  38. /tmp/.X[0-9]*-lock r,
  39.  
  40. /etc/timezone r,
  41. /etc/wildmidi/wildmidi.cfg r,
  42.  
  43. # firefox specific
  44. /etc/firefox*/** r,
  45. /etc/xul-ext/** r,
  46. /etc/xulrunner{,-[0-9]*}/** r,
  47. /etc/gre.d/* r,
  48. /etc/mailcap r,
  49. /etc/mime.types r,
  50.  
  51. # noisy
  52. deny /usr/lib/firefox{,-[0-9]*}/** w,
  53. deny /usr/lib/{firefox,xulrunner}-addons/** w,
  54. deny /usr/lib/xulrunner-*/components/*.tmp w,
  55. deny /.suspended r,
  56. deny /boot/initrd.img* r,
  57. deny /boot/vmlinuz* r,
  58. deny /var/cache/fontconfig/ w,
  59.  
  60. deny /usr/bin/gconftool-2 x,
  61.  
  62. # These are needed when a new user starts firefox and firefox.sh is used
  63. /usr/lib/firefox{,-[0-9]*}/** ixr,
  64. deny /usr/lib/firefox/firefox.sh x,
  65. /usr/bin/basename ixr,
  66. /usr/bin/dirname ixr,
  67. /usr/bin/pwd ixr,
  68. /sbin/killall5 ixr,
  69. /bin/which ixr,
  70. /usr/bin/tr ixr,
  71. @{PROC}/@{pid}/cmdline r,
  72. @{PROC}/@{pid}/mountinfo r,
  73. @{PROC}/@{pid}/stat r,
  74. @{PROC}/@{pid}/status r,
  75.  
  76. /etc/mtab r,
  77. /etc/fstab r,
  78.  
  79. # Needed for the crash reporter
  80. owner @{PROC}/@{pid}/environ r,
  81. owner @{PROC}/@{pid}/auxv r,
  82. /etc/lsb-release r,
  83. /usr/bin/expr ix,
  84.  
  85. # Needed for container to work in xul builds
  86. /usr/lib/xulrunner-*/plugin-container ixr,
  87.  
  88. # Make browsing directories work
  89. / r,
  90. /**/ r,
  91.  
  92. # allow access to documentation and other files the user may want to look
  93. # at in /usr
  94. /usr/{include,share,src}/** r,
  95.  
  96. # Default profile allows downloads to ~/Downloads and uploads from ~/Public
  97. owner @{HOME}/ r,
  98. owner @{HOME}/Public/ r,
  99. owner @{HOME}/Public/** r,
  100. owner @{HOME}/Downloads/ r,
  101. owner @{HOME}/Downloads/** rw,
  102. owner @{HOME}/.thumbnails/*/*.png r,
  103.  
  104. # per-user firefox configuration
  105. owner @{HOME}/.{firefox,mozilla}/ rw,
  106. owner @{HOME}/.{firefox,mozilla}/** rw,
  107. owner @{HOME}/.{firefox,mozilla}/**/*.{db,parentlock,sqlite}* k,
  108. owner @{HOME}/.{firefox,mozilla}/plugins/** rm,
  109. owner @{HOME}/.{firefox,mozilla}/**/plugins/** rm,
  110. owner @{HOME}/.gnome2/firefox*-bin-* rw,
  111.  
  112. #
  113. # Extensions
  114. # /usr/share/.../extensions/... is already covered by '/usr/.../** r', above.
  115. # Allow 'x' for downloaded extensions, but inherit policy for safety
  116. owner @{HOME}/.mozilla/**/extensions/** mixr,
  117.  
  118. deny /usr/lib/firefox{,-[0-9]*}/update.test w,
  119. deny /usr/lib/mozilla/extensions/**/ w,
  120. deny /usr/lib/xulrunner-addons/extensions/**/ w,
  121. deny /usr/share/mozilla/extensions/**/ w,
  122. deny /usr/share/mozilla/ w,
  123.  
  124. # Site-specific additions and overrides. See local/README for details.
  125. # Local path is disabled, we only enable them for profiles we promote
  126. # out of extras.
  127. ## include <local/usr.bin.firefox>
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement