Author Topic: PHP Defender nowhere to be found  (Read 12060 times)

0 Members and 1 Guest are viewing this topic.

Offline
***
PHP Defender nowhere to be found
« on: December 16, 2021, 08:24:41 PM »
Hello

I'm in the process of figuring out this panel and its features. One of the most important features for me is Snuffleupagus. I have installed mod_security, though i don't like it as I know it will conflict with some wordpress plugins, I do prefer the aforementioned plugin which is named PHP Defender in CWP.

Snuffleupagus is only mentioned once through the entire panel, here:
https://i.gyazo.com/464479513ca25e09610216acbea39b92.png

I can't find how to get it installed through CWP. I don't want to manually install it.

I currently don't have the CWP pro
I'm running Centos 8 Stream with the delayed repos.

Offline
***
Re: PHP Defender nowhere to be found
« Reply #1 on: December 16, 2021, 11:33:46 PM »
Yes, it is installed in panel, "Security" >> "Security Center".
It is simply installed choosing "Basic", "Intermediate" or "Advanced" levels.
Simply by clicking on "install" and that's it.

You must have login on the panel to see that.

(While reading your post, I installed in two servers, it is just very simple)

Regards,
Netino

Offline
***
Re: PHP Defender nowhere to be found
« Reply #2 on: December 17, 2021, 10:53:47 AM »
Where is it?


Offline
***
Re: PHP Defender nowhere to be found
« Reply #3 on: December 17, 2021, 12:32:38 PM »
I'd like to add, that I've already installed php 7.4.26 through the main version switcher.

Offline
***
Re: PHP Defender nowhere to be found
« Reply #4 on: December 18, 2021, 03:12:38 PM »
I just found out that it doesnt work with the free version of CWP

Offline
*
Re: PHP Defender nowhere to be found
« Reply #5 on: January 04, 2022, 11:53:25 AM »
it does not work in the paid one either !! Unfortunately, it is common with CWP (Pro) that so "often" things suddenly stop working. The aim is to boost pay support.

Je li to sada toliko uobičajeno u ZAGREBU?

Offline
***
Re: PHP Defender nowhere to be found
« Reply #6 on: January 04, 2022, 12:19:54 PM »
the PHP Defender is only available for PHP CGI and PHP-FPM. These two PHP types are only available with the pro version.
If you got the pro version, install one of these types of PHP >v7.0 and it will appear.

Offline
*
Re: PHP Defender nowhere to be found
« Reply #7 on: January 05, 2022, 11:41:26 AM »
Sorry we have 20x Pro installed and Php v 7.4. It was there before the update and has now disappeared, can no longer be installed! However thank you for your help.

Offline
***
Re: PHP Defender nowhere to be found
« Reply #8 on: January 05, 2022, 04:27:31 PM »
care to run this command on the php7 fpm with broken PHP Defender and post the result here?
Code: [Select]
sudo /opt/alt//php-fpm74/usr/sbin/php-fpm -m

Offline
*
Re: PHP Defender nowhere to be found
« Reply #9 on: January 06, 2022, 02:12:07 AM »
[PHP Modules]
apcu
bcmath
bz2
calendar
cgi-fcgi
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
imap
intl
ionCube Loader
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
pspell
Reflection
session
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache
the ionCube PHP Loader + ionCube24

open_basedir: /home:/tmp:/var/tmp:
memcache
redis

are installed
« Last Edit: January 06, 2022, 02:14:45 AM by Com-QuadTech »

Offline
***
Re: PHP Defender nowhere to be found
« Reply #10 on: January 06, 2022, 07:52:31 PM »
On a unrelated note or maybe it is... The Open_basedir should be
Code: [Select]
/home/USERNAME:/tmp if you did use exactly my command which is PHP-FPM 7.4.

Also, the Snuffleupagus module seems to be missing from the list. As a comparison, it's on my module list for PHP-FPM 7.4 modules.

Double check this to see if it's enabled, if it was enabled before:
Code: [Select]
/opt/alt/php-fpm74/usr/php/php.d/snuffleupagus.iniCheck here if the module actually exist:
Code: [Select]
/opt/alt/php-fpm74/usr/lib/php/extensions/no-debug-non-zts-20210902/If the .so file is there but the ini file not there then just add the ini file and paste this and see if it works (after restarting php-fpm):
Code: [Select]
;Snuffleupagus LIB
;defender_mode=custom
extension=snuffleupagus.so
sp.configuration_file=/opt/alt/php-fpm74/usr/php/snuffleupagus.rules

If the .so file is not there then read on...

You can try this, but at your own risk that there is a chance you may end up reinstalling php fpm if this breaks it.

Code: [Select]
cp -rp /usr/local/cwp/.conf/phpdefender/snuffleupagus-master /usr/local/cwp/.conf/phpdefender/snuffleupagus-master_BACKUP
cd /usr/local/cwp/.conf/phpdefender/snuffleupagus-master/src
/opt/alt/php-fpm74/usr/bin/phpize
chmod +x configure
./configure --with-php-config=/opt/alt/php-fpm74/usr/bin/php-config
make && make install
vi /opt/alt/php-fpm74/usr/php/php.d/snuffleupagus.ini
add the code mentioned above, restart php-fpm and check the security center to see if it appears there. Or at least in the module list.
If you get permission error with the phpize file, then it probably means that your php-fpm is disabled. This was the case with my test server because it doesnt have the pro version. I just had to "chmod +x" it to continue.

I have used the above commands to install suhosin on php-fpm56 as there wasnt an option to add it through CWP panel. I have just now tested to manually install snuffleupagus on a PHP-FPM version that is still installed on the test server (but disabled) and now it appears on the security center.
« Last Edit: January 06, 2022, 08:19:16 PM by iraqiboy90 »

Offline
***
Re: PHP Defender nowhere to be found
« Reply #11 on: January 06, 2022, 09:21:12 PM »
(..)
Code: [Select]
cp -rp /usr/local/cwp/.conf/phpdefender/snuffleupagus-master /usr/local/cwp/.conf/phpdefender/snuffleupagus-master_BACKUP
cd /usr/local/cwp/.conf/phpdefender/snuffleupagus-master/src
/opt/alt/php-fpm74/usr/bin/phpize
chmod +x configure
./configure --with-php-config=/opt/alt/php-fpm74/usr/bin/php-config
make && make install
vi /opt/alt/php-fpm74/usr/php/php.d/snuffleupagus.ini
add the code mentioned above, restart php-fpm and check the security center to see if it appears there. Or at least in the module list.
If you get permission error with the phpize file, then it probably means that your php-fpm is disabled. This was the case with my test server because it doesnt have the pro version. I just had to "chmod +x" it to continue.

I have used the above commands to install suhosin on php-fpm56 as there wasnt an option to add it through CWP panel. I have just now tested to manually install snuffleupagus on a PHP-FPM version that is still installed on the test server (but disabled) and now it appears on the security center.

These steps are almost correct, I think, except one, that is used by CWP team to compile it:
Instead:
Code: [Select]
./configure --with-php-config=/opt/alt/php-fpm74/usr/bin/php-config

...use:
Code: [Select]
./configure --with-php-config=/opt/alt/php-fpm74/usr/bin/php-config --enable-snuffleupagus

They have an additional problem, at least in my installation: The logs cannot be viewed in CWP panel anymore, and CWP cannot anymore change any configuration in snuffleupagus, nor compile again snuffleupagus.
But I just didn't try to reinstall PHP-FPM to check if solves.

Offline
***
Re: PHP Defender nowhere to be found
« Reply #12 on: January 06, 2022, 09:25:10 PM »
But I just didn't try to reinstall PHP-FPM to check if solves.

If you reinstall PHP, it will wipe everything, so it would not "solve" anything other than getting back a php-fpm without snuffleupagus

Offline
*
Re: PHP Defender nowhere to be found
« Reply #13 on: January 07, 2022, 07:16:32 AM »
thanks for the help

The latter was only partially a success


Error: Defender logs entries
None entry was found in logs.


It is not possible to configure or, better, to select Basic, Intermediate, Extreme, not even to change it.

Modifying Defender mode does not work either.

I've now installed a fresh one on a VPS and a dedicated server as well as on a new host machine. It is the same for all three. So very simple standard installation.

As I write in other forum posts, we are more busy tinkering with CWP than with other panels. Even those that have already been installed are repeatedly changed and destroyed after updates. Can't that make sense of it all?

It quickly takes a rethink in the way CWP processes updates, i.e. testing beforehand and the repos must be reconsidered.

Offline
*
Re: PHP Defender nowhere to be found
« Reply #14 on: January 07, 2022, 07:22:26 AM »

we make it easy for us.


Before publication, internal tests are carried out on a VPS and a dedicated server. If everything runs, it is loaded onto "a" repo, from this a real installation is carried out. Only if this goes smoothly will it actually be published! And not before. Everyone in our team tests each script independently and conscientiously before it goes online. This is how it should be at CWP. Because if I earn money with it, I have a responsibility to the customers !!!!!!!