# /etc/imunify360-php-daemon/peer-exes.conf
#
# DEF-42416: peer-exe whitelist for the proactive socket. The daemon
# accepts an inbound connection only if `readlink /proc/<peer_pid>/exe`
# matches one of the glob patterns in this file.
#
# Format
# ------
# - One pattern per line. Globs use Go's filepath.Match syntax
#   (`*`, `?`, character classes — no `**`).
# - Lines starting with `#` are comments.
# - Blank lines are skipped.
# - Inline comments are supported: `<pattern>   # comment`.
#
# Reload
# ------
# Changes are picked up automatically when this file's mtime
# advances; no daemon restart required.
#
# Extending without editing this file
# -----------------------------------
# Drop-in files at /etc/imunify360-php-daemon/peer-exes.d/*.conf are
# merged with this file's content (same format). Per-panel packages
# should ship their additions there so a future package upgrade of
# imunify360-php-daemon never clobbers their patterns.
#
# Defaults below cover every PHP-runtime path observed in real-world
# production traffic (Redash php_daemon_stats / proactive_queue, 3-day
# window). Adding a new PHP layout? Either add a line here or drop a
# `.conf` file in peer-exes.d/.

# === alt-php (CloudLinux / cPanel customers running custom PHP) ===
/opt/alt/php*/usr/bin/lsphp
/opt/alt/php*/usr/bin/php
/opt/alt/php*/usr/bin/php-cgi
/opt/alt/php*/usr/sbin/php-fpm

# === CloudLinux alt-php (separate /opt/cloudlinux/ install) ===
/opt/cloudlinux/alt-php*/root/usr/bin/php
/opt/cloudlinux/alt-php*/root/usr/bin/php-cgi

# === cPanel EasyApache ===
/opt/cpanel/ea-php*/root/usr/bin/php
/opt/cpanel/ea-php*/root/usr/bin/php-cgi
/opt/cpanel/ea-php*/root/usr/sbin/lsphp
/opt/cpanel/ea-php*/root/usr/sbin/php-fpm

# === Plesk ===
/opt/plesk/php/*/bin/php
/opt/plesk/php/*/bin/php-cgi
/opt/plesk/php/*/sbin/php-fpm

# === DirectAdmin / non-standard /opt/php?-? builds ===
/opt/php?-?/bin/php
/opt/php?-?/bin/php-cgi
/opt/php?-?/sbin/php-fpm

# === System PHP (Debian / Ubuntu / RHEL) ===
/usr/bin/php
/usr/bin/php?               # /usr/bin/php8, /usr/bin/php7 …
/usr/bin/php?.?             # /usr/bin/php8.3, /usr/bin/php7.4 …
/usr/bin/php-cgi
/usr/sbin/php-fpm*

# === Apache (mod_php) ===
/usr/sbin/httpd
/usr/sbin/apache2

# === /usr/local prefix installs (DirectAdmin, custom builds, etc.) ===
/usr/local/bin/php
/usr/local/sbin/php-fpm*
/usr/local/php*/bin/php
/usr/local/php*/bin/php-cgi
/usr/local/php*/sbin/php-fpm
