2020-07-05 08:40:30 -06:00
|
|
|
# vim: ft=apparmor
|
|
|
|
|
2023-06-30 23:36:12 -07:00
|
|
|
abi <abi/4.0>,
|
2020-07-05 08:40:30 -06:00
|
|
|
|
|
|
|
include <tunables/global>
|
|
|
|
|
2024-08-14 10:52:53 -03:00
|
|
|
profile php-fpm /usr/{bin,sbin}/php-fpm* flags=(attach_disconnected) {
|
2020-07-05 08:40:30 -06:00
|
|
|
# load common libraries and their support files
|
|
|
|
include <abstractions/base>
|
|
|
|
# resolve hostnames/usernames
|
|
|
|
include <abstractions/nameservice>
|
|
|
|
# common php files and support files that php needs
|
|
|
|
include <abstractions/php>
|
|
|
|
# read the system certificates
|
|
|
|
include <abstractions/ssl_certs>
|
|
|
|
|
|
|
|
capability net_admin,
|
|
|
|
# change user/group of a pool
|
|
|
|
capability setuid,
|
|
|
|
capability setgid,
|
|
|
|
# change ownership of the socket so that we can launch with a different user/group as the socket will be owned by
|
|
|
|
capability chown,
|
|
|
|
# we want to be able to kill our child processes
|
|
|
|
capability kill,
|
|
|
|
# to provide sockets with acls different than root
|
|
|
|
capability dac_override,
|
|
|
|
|
|
|
|
# we need write access here to move it into a different apparmor sub profile
|
2020-09-18 04:03:55 -07:00
|
|
|
@{PROC}/@{pid}/attr/{apparmor/,}current rw,
|
2020-07-05 08:40:30 -06:00
|
|
|
|
|
|
|
# the main log file
|
|
|
|
/var/log/php*-fpm.log rw,
|
|
|
|
|
|
|
|
# we need to be able to create all sockets
|
2020-09-05 11:45:04 -07:00
|
|
|
@{run}/php{,-fpm}/php*-fpm.pid rw,
|
2022-08-25 23:44:16 +02:00
|
|
|
@{run}/php*-fpm.pid rw,
|
2020-08-28 22:23:13 +02:00
|
|
|
@{run}/php{,-fpm}/php*-fpm.sock rwlk,
|
2020-07-05 08:40:30 -06:00
|
|
|
|
2024-06-05 09:43:05 -03:00
|
|
|
# LP: #2061113
|
|
|
|
owner @{run}/systemd/notify w,
|
|
|
|
|
2020-07-05 08:40:30 -06:00
|
|
|
# to reload
|
2024-08-14 10:52:53 -03:00
|
|
|
/usr/{bin,sbin}/php-fpm* rix,
|
2020-07-05 08:40:30 -06:00
|
|
|
|
|
|
|
# no idea why php tries to open / read/write
|
|
|
|
deny / rw,
|
|
|
|
|
|
|
|
# allow sending signals to our subprocesses
|
2020-08-28 22:40:21 +02:00
|
|
|
signal (send) peer=php-fpm//*,
|
2020-07-05 08:40:30 -06:00
|
|
|
|
|
|
|
# allow switching processes to those subprofiles
|
2020-08-28 22:40:21 +02:00
|
|
|
change_profile -> php-fpm//*,
|
2020-07-05 08:40:30 -06:00
|
|
|
|
|
|
|
# load all files from this directory
|
|
|
|
# store your configurations per pool in this dir
|
|
|
|
include if exists <php-fpm.d>
|
|
|
|
|
|
|
|
# Site-specific additions and overrides. See local/README for details.
|
2020-09-08 20:39:04 +02:00
|
|
|
include if exists <local/php-fpm>
|
2020-07-05 08:40:30 -06:00
|
|
|
}
|