User Tools

Site Tools


whmcscsf

WHMCS-CSF Firewall Customer Unblocking Module

Overview

This module will make life easier for your customers. Whenever your customer gets blocked on the firewall, he/she may simply log into WHMCS and check if their IP is blocked. If so the IP is listed, then he/she will have the option to get it unlisted without ever contacting your company's support.

Features

  • Remote calls without needing SSH access (root access is needed initially to setup the permission and ownership for the files and the cronjobs)
  • No special PHP extension is needed
  • External access safe (Hash is checked before anything is executed)
  • Check for both deny list (csf.deny) and temp ban list (csf.tempban)
  • Email notification to the admin when a CSF rule is being taken off the list
  • Regular hosting user and reseller hosting user mode (the mod will automatically get the regular hosting user, while reseller hosting user will the option to search for a client's IP address in the block list)
  • Customizable messages
  • Template integration
  • Remote server files auto updater
  • Multi-language support
  • Remote server connectivity checker
  • Remote server configuration checker
  • Full deny/tempdeny list viewing inside Admin Area
  • Deny unblocking of admin added IPs (comment the rule list with #adminadded to get this option in affect)

Requirements

  • working installation of WHMCS
  • root access (need for remote server setups, not needed for module operations)
  • two or more servers with CSF installed (the WHMCS installation should not reside on the same server as your clients)
  • remote servers must be HTTP accessible
  • cronjobs must be working on remote servers
  • mail() must be enabled for admin notification

Installation

Installation tutorial video - http://youtu.be/BlbdD5pM4WY

WHMCS Admin Installation

  1. Upload the csf_firewall/ directory into yourwhmcsinstall/modules/admin/
  2. Login into your WHMCS → Utilities → Addon Modules → Csf Firewall. The mod will then prompt you to install the new table into your database if this is the first time running
  3. Once the table is ready, reload the page. Now you should see a table with column names such as: IP Address, Server Name, Hash and Web Address. To enter your remote server's information, simply scroll down to the bottom and you should be able to see a form prompting you for the information.
  4. The WHMCS admin side setup is complete, next is the WHMCS Customer Product template file.
  • IP Address - The IP Address for the remote server, this should match the IP address of the hosting package
  • Server Name - The name of the server you want your customer to see when the module is doing the checking
  • Hash - The MD5 hash from the remote server's password
  • Web Address - The URL to reach your remote server's php file (Enter the address without http:/// and without trailing /)

You can use www.miraclesalad.com/webtools/md5.php to generate a md5 hash of your password.

Make sure the servers you are adding have the same IP address as the ones listed in your WHMCS server listing.

WHMCS Customer Product Details Template

  1. Open the clientareaproductdetails.tpl for the theme you are currently using
  2. Find the place you want to place the buttons. (For the default template, we place it between <p align=“center”>{$serverclientarea}</p> and {if $username}) Paste the codes included with the zip package into the page. You can find the codes in template_extra_whmcsv*.txt
  3. Save the and this part is done.
  4. Upload the edited clientareaproductdetails.tpl, csf_checkban.tpl and csf_unban.tpl to your working template directory

(If you are using the default template, you can just replace the clientareaproductdetails.tpl supplied)

Text Definitions

Display Message Customization, License key and Other Settings

  1. Open csf_settings.php
  2. Fill in the $csf_license with the license you have obtained from our client area
  3. Save it once you are done
  4. Once you have set everything, it is time to upload the rest of the files needed on the WHMCS side. Upload the files csf_checkban.php, csf_settings.php and csf_unban.php to the root installation base of WHMCS.
  5. Once uploaded the WHMCS side is done.

Remote Server Configuration

We have downsized the supported installation method to only one due to the complexity of the remote server installation.

Official Installation Method: Server cron based

  • This method is designed to be used on system which is more stricter on security.
  • You do not need to create a separate account for this.
  • The path to the remote CSF PHP files must be web accessible.

Automatic Install

Refer to the WHMCS-CSF Auto Unblocking Module One Step Install to run the one step installer.

You may also refer to autoinstall_cpanel.txt or autoinstall_directadmin.txt if you don't want to run the automatic bash installer.

NOTE: DO NOT RUN csf_compare_m2.php or setup the cron that run it UNTIL you have all the variables setup correctly.

Before attempting to run the Config Tester within WHMCS, make sure you have run the csf_compare_m2.php at least once so the csf rule lists are copied to the local directory. You can run the file manually by using the following command in your shell. php /usr/local/apache/csf_compare_m2.php

Manual Install

- Open csf_settings_remote.php and edit the following settings. (See Variable Explanation section)  
- Upload the csf_check_remote.php, csf_settings_remote.php, csf_update.php and csf_unban_remote.php to the web accessible directory
- Upload the csf_compare_m2.php into the **web inaccessible** directory
- Open and edit the csf_compare_m2.php. (See Variable Explanation section)

The web accessible directory is the Web Address listed for this server listed in the WHMCS side.

DO NOT RUN csf_compare_m2.php or setup the cron that run it UNTIL you have all the variables setup correctly

Refer to remoteserver_setup.txt included in the package for the rest of the installation steps.

Variables Explaination

Variables Explaination for csf_compare_m2.php

  • $localcsf - where your local CSF rule list had been saved to. This variable reflect the $file_location in the csf_settings_remote.php
  • $user - the user the system uses when the csf mod files are being hit via http
  • $csf - Your CSF installation path

Variables Explaination for csf_settings_remote.php

 
* $hash -  The matching PLAINTEXT (pre-MD5) pass code you used to enter on the WHMCS side. This is NOT your root password. This can be any password you want.
* $csf - The path to your CSF installation. Leave as default if you did not change the installation folder. (Default = /etc/csf/)
* $files_location - The path which the rule list will be saved to. This setting is relative to where the remote files are saved to. The default is set to the web inaccessible of the account. You can leave it as is. This is also know as the Local CSF path or $localcsf variable inside the csf_compare_m2.php file.
* $method - This is the installation method you are using for this remote server. (Do not change)

Lastly, if you are stuck at any part of the installation process. Please feel free to contact us at http://supportwire.net

Change Logs


2.0 - May, 12, 2010

  • Remote server configuration checker
  • Admin blocker blocking
  • Full listing view inside admin area

1.31 - Mar, 03, 2010

  • new feature: successful unblock attempt logging
  • unblock button now updated to use multi-language feature

1.3 - Feb, 05, 2010

  • new feature: multi-language support
  • new feature: remote server connectivity checker

1.2 - Jan, 15, 2010

  • new custom error explanation feature

1.11 r4 - Jan, 13, 2010

  • bug fix to csf_compare_m2.php
  • auto remote server installation instructions

1.11 - Jan, 09, 2010

  • added csf_compare_m2.php for Method two install
  • added streamline information

1.1 - Jan, 08, 2010

  • added mass hash update
  • added remote server update
  • IP adding bug fix
  • server list syncing with WHMCS server list

1.0 - Jan, 06, 2010

  • script released
whmcscsf.txt · Last modified: 2015/04/30 17:30 (external edit)