logo

apparmor.d

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

php-fpm (1704B)


  1. # vim: ft=apparmor
  2. abi <abi/3.0>,
  3. include <tunables/global>
  4. profile php-fpm /usr/sbin/php-fpm* flags=(attach_disconnected) {
  5. # load common libraries and their support files
  6. include <abstractions/base>
  7. # resolve hostnames/usernames
  8. include <abstractions/nameservice>
  9. # common php files and support files that php needs
  10. include <abstractions/php>
  11. # read openssl configuration
  12. include <abstractions/openssl>
  13. # read the system certificates
  14. include <abstractions/ssl_certs>
  15. capability net_admin,
  16. # change user/group of a pool
  17. capability setuid,
  18. capability setgid,
  19. # change ownership of the socket so that we can launch with a different user/group as the socket will be owned by
  20. capability chown,
  21. # we want to be able to kill our child processes
  22. capability kill,
  23. # to provide sockets with acls different than root
  24. capability dac_override,
  25. # we need write access here to move it into a different apparmor sub profile
  26. @{PROC}/@{pid}/attr/{apparmor/,}current rw,
  27. # the main log file
  28. /var/log/php*-fpm.log rw,
  29. # we need to be able to create all sockets
  30. @{run}/php{,-fpm}/php*-fpm.pid rw,
  31. @{run}/php*-fpm.pid rw,
  32. @{run}/php{,-fpm}/php*-fpm.sock rwlk,
  33. # to reload
  34. /usr/sbin/php-fpm* rix,
  35. # no idea why php tries to open / read/write
  36. deny / rw,
  37. # allow sending signals to our subprocesses
  38. signal (send) peer=php-fpm//*,
  39. # allow switching processes to those subprofiles
  40. change_profile -> php-fpm//*,
  41. # load all files from this directory
  42. # store your configurations per pool in this dir
  43. include if exists <php-fpm.d>
  44. # Site-specific additions and overrides. See local/README for details.
  45. include if exists <local/php-fpm>
  46. }