Guest User

Untitled

a guest
Jul 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. # Do not load this file. Rather, load /etc/apparmor.d/lxc-containers, which
  2. # will source all profiles under /etc/apparmor.d/lxc
  3.  
  4. profile lxc-container-default flags=(mediate_deleted) {
  5. network,
  6. capability,
  7. file,
  8. umount,
  9.  
  10. # ignore DENIED message on / remount
  11. deny mount options=(ro, remount) -> /,
  12.  
  13. # allow tmpfs mounts everywhere
  14. mount fstype=tmpfs,
  15.  
  16. # allow mqueue mounts everywhere
  17. mount fstype=mqueue,
  18.  
  19. # the container may never be allowed to mount devpts. If it does, it
  20. # will remount the host's devpts. We could allow it to do it with
  21. # the newinstance option (but, right now, we don't).
  22. deny mount fstype=devpts,
  23.  
  24. # allow bind mount of /lib/init/fstab for lxcguest
  25. mount options=(rw, bind) /lib/init/fstab.lxc/ -> /lib/init/fstab/,
  26.  
  27. # deny writes in /proc/sys/fs but allow fusectl to be mounted
  28. mount fstype=binfmt_misc -> /proc/sys/fs/binfmt_misc/,
  29. deny @{PROC}/sys/fs/** wklx,
  30.  
  31. # block some other dangerous paths
  32. deny @{PROC}/sysrq-trigger rwklx,
  33. deny @{PROC}/mem rwklx,
  34. deny @{PROC}/kmem rwklx,
  35. deny @{PROC}/sys/kernel/** wklx,
  36.  
  37. # deny writes in /sys except for /sys/fs/cgroup, also allow
  38. # fusectl, securityfs and debugfs to be mounted there (read-only)
  39. mount fstype=fusectl -> /sys/fs/fuse/connections/,
  40. mount fstype=securityfs -> /sys/kernel/security/,
  41. mount fstype=debugfs -> /sys/kernel/debug/,
  42. deny mount fstype=debugfs -> /var/lib/ureadahead/debugfs/,
  43. mount fstype=proc -> /proc/,
  44. mount fstype=sysfs -> /sys/,
  45. deny /sys/[^f]*/** wklx,
  46. deny /sys/f[^s]*/** wklx,
  47. deny /sys/fs/[^c]*/** wklx,
  48. deny /sys/fs/c[^g]*/** wklx,
  49. deny /sys/fs/cg[^r]*/** wklx,
  50. }
Add Comment
Please, Sign In to add comment