We enabled SCL on CentOS 7 and installed Python 2.7, Apache 2.4 and PHP 7.1. It looks like the updated programs are being used. However, we seem to have a problem with PHP hardening.
First, here is the php.ini we can find:
# find /opt/rh -name php.ini
/opt/rh/rh-php71/register.content/etc/opt/rh/rh-php71/php.ini
Next, we added our disable_functions:
# grep disable_functions /opt/rh/rh-php71/register.content/etc/opt/rh/rh-php71/php.ini
disable_functions=apache_note,apache_setenv,chgrp,closelog,debugger_off,debugger
_on,define_sys,define_syslog_variables,diskfreespace,dl,escapeshellarg,escapeshe
llcmd,exec,getmypid,getmyuid,ini_restore,leak,listen,openlog,passthru,pclose,pcn
tl_alarm,pcntl_exec,pcntl_fork,pcntl_getpriority,pcntl_get_last_error,pcntl_setp
riority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,
pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcnt
l_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php
_uname,popen,posix,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_
getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgi
d,posix_getpgrp,posix_getpid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix
_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_se
teuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_tty
name,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,s
hell_exec,show_source,syslog,system,url_exec,_getppid
Finally, when we restart Apache, add a phpinfo.php page, and then inspect the result (this is the real web server result), PHP claims there are no disabled functions:
I think we are using the wrong php.ini, but I can't seem to find the one we are supposed to be using. I can't find it on the filesystem in /opt and search is returning irrelevant results.
My question is, where is php.ini when SCL PHP is in effect?
