apparmor-adjust-cupsd-profile.diff 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. --- a/etc/apparmor.d/usr.sbin.cupsd 2015-11-20 09:41:01.408000000 +0000
  2. +++ b/etc/apparmor.d/usr.sbin.cupsd 2015-11-20 09:47:01.728000000 +0000
  3. @@ -4,7 +4,9 @@
  4. #include <tunables/global>
  5. -/usr/sbin/cupsd {
  6. +@{etccups}=/{etc/cups,live/persistence/TailsData_unlocked/cups-configuration}
  7. +
  8. +/usr/sbin/cupsd flags=(attach_disconnected) {
  9. #include <abstractions/base>
  10. #include <abstractions/bash>
  11. #include <abstractions/authentication>
  12. @@ -53,9 +55,10 @@
  13. /dev/bus/usb/ r,
  14. /dev/bus/usb/** rw,
  15. /dev/parport* rw,
  16. - /etc/cups/ rw,
  17. - /etc/cups/** rw,
  18. - /etc/cups/interfaces/* ixrw,
  19. + @{etccups}/ rw,
  20. + /etc/.wh..wh.cups.*/ rw,
  21. + @{etccups}/** rw,
  22. + @{etccups}/interfaces/* ixrw,
  23. /etc/foomatic/* r,
  24. /etc/gai.conf r,
  25. /etc/papersize r,
  26. @@ -70,7 +73,7 @@
  27. @{PROC}/*/auxv r,
  28. @{PROC}/sys/crypto/** r,
  29. /sys/** r,
  30. - /usr/bin/* ixr,
  31. + /usr/bin/{[^h],h[^p],hp[^i],hpi[^j],hpij[^s]}* ixr,
  32. /usr/sbin/* ixr,
  33. /bin/* ixr,
  34. /sbin/* ixr,
  35. @@ -80,7 +83,10 @@
  36. /usr/lib/cups/backend/bluetooth ixr,
  37. /usr/lib/cups/backend/dnssd ixr,
  38. /usr/lib/cups/backend/http ixr,
  39. + /usr/lib/cups/backend/https ixr,
  40. /usr/lib/cups/backend/ipp ixr,
  41. + /usr/lib/cups/backend/ipp[0-9][0-9] ixr,
  42. + /usr/lib/cups/backend/ipps ixr,
  43. /usr/lib/cups/backend/lpd ixr,
  44. /usr/lib/cups/backend/parallel ixr,
  45. /usr/lib/cups/backend/serial ixr,
  46. @@ -92,7 +98,12 @@
  47. /usr/lib/cups/backend/cups-pdf Px,
  48. # third party backends get no restrictions as they often need high
  49. # privileges and this is beyond our control
  50. - /usr/lib/cups/backend/* Cx -> third_party,
  51. + # Due to Tails#9963 we hard-code the third-party backends we ship:
  52. + # /usr/lib/cups/backend/* Cx -> third_party,
  53. + /usr/lib/cups/backend/gutenprint52+usb Cx -> third_party,
  54. + /usr/lib/cups/backend/hp Cx -> third_party,
  55. + /usr/lib/cups/backend/hpfax Cx -> third_party,
  56. + /usr/lib/cups/backend/mdns Cx -> third_party,
  57. /usr/lib/cups/cgi-bin/* ixr,
  58. /usr/lib/cups/daemon/* ixr,
  59. @@ -119,6 +130,9 @@
  60. /var/log/cups/* rw,
  61. /var/spool/cups/ rw,
  62. /var/spool/cups/** rw,
  63. + /var/cache/.wh..wh.cups.*/ rw,
  64. + /var/log/.wh..wh.cups.*/ rw,
  65. + /var/spool/.wh..wh.cups.*/ rw,
  66. # third-party printer drivers; no known structure here
  67. /opt/** rix,
  68. @@ -131,7 +145,7 @@
  69. /etc/krb5.conf r,
  70. deny /etc/krb5.conf w,
  71. /etc/krb5.keytab rk,
  72. - /etc/cups/krb5.keytab rwk,
  73. + @{etccups}/krb5.keytab rwk,
  74. /tmp/krb5cc* k,
  75. # likewise authentication
  76. @@ -141,7 +155,7 @@
  77. # silence noise
  78. deny /etc/udev/udev.conf r,
  79. - profile third_party {
  80. + profile third_party flags=(attach_disconnected) {
  81. # third party backends, filters, and drivers get relatively no restrictions
  82. # as they often need high privileges, are unpredictable or otherwise beyond
  83. # our control
  84. @@ -178,7 +192,7 @@
  85. /bin/bash ixr,
  86. /bin/cp ixr,
  87. /etc/papersize r,
  88. - /etc/cups/cups-pdf.conf r,
  89. + @{etccups}/cups-pdf.conf r,
  90. @{HOME}/PDF/ rw,
  91. @{HOME}/PDF/* rw,
  92. /usr/bin/gs ixr,