How to Blacklist/Whitelist IP Addresses in Imunify360?

Note: There are two methods to Blacklist/Whitelist IPs in Imunify and both of them require root access. If you’re a Shared Hosting user with user-level access, you should contact your hosting provider to perform this task. Additionally, you can forward this tutorial so that they can easily perform your task.

Imunify360 is security software that comes by default in every Shared Hosting Plan at Redserverhost. The six-layer security of imunify360 provides every cPanel user with an extreme level of security from all kinds of malicious attacks.

Imunify360 is almost an automated software that automatically blocks all the malicious IPs, files, and users. However, there are two methods to blacklist and whitelist IP addresses in Imunify360 manually. The first one is from the WHM interface, whereas the second one could be done by using some basic Linux commands in SSH.

1: Blacklist/Whitelist IPs in Imunify360 from WHM

Whitelist/Blacklist an IP Address

It’s fairly easy to ban/unban any IPs in Imunify360 from the WHM interface. You can follow the below steps for a step-by-step guide to Blacklist/Whitelist IPs in Imunify.

  1. First of all, log into your WHM control panel.
  2. Type ‘Imunify’ in the search bar and hit the Imunify360 option from the result.

    Search For Imunify in WHM
    Search For Imunify in WHM
  3. You’ll land on the Imunify page. Click on the Firewall tab.

    Firewall Tab in Imunify
    Firewall Tab in Imunify
  4. To whitelist IP or a list of IPs, click on the WHITE LIST tab, and hit the ADD button.
    Whitelist IP in WHM
    Whitelist IP in WHM

    Again, there are two methods to whitelist/blacklist IPs.

    • Blacklist/Whitelist by IP or a range of IPs (using CIDR).
    • Blacklist/Whitelist country-wise.

  5. Once clicked on the ADD button, you’ll see two methods to ban/unban IPs.
    Also See: Use of Imunify360 - A Comprehensive Guide
  6. Type the IP address or a range of IPs (using CIDR) in the Enter IP box.

    Blacklist or whitelist by IPs
    Blacklist or whitelist by IPs
  7. Hit The ADD IP button once done.

    Add IP Button
    Add IP Button
  8. A pop-up will display with the Success message.

    IP Whitelist Successful
    IP Whitelist Successful
  9. You’ve successfully whitelisted an IP address in Imunify360.

Whitelist/Blacklist a Range of IPs using CIDR in Imunify

You can easily blacklist/whitelist a range of IPs in Imunify360 using the CIDR method. Follow the below step-by-step guide to perform this task effortlessly.

  1. Navigate to the Imunify360 in WHM, and click over the ADD button.
  2. Type the IP address with the help of CIDR, and hit the ADD IP button.
    Blacklist or whitelist a range of IPs
    Blacklist or whitelist a range of IPs

    The CIDR Command /24 will whitelist or blacklist all IPs starting from 156.143.150. You can learn more about the CIDR Commands by clicking over the link.

  3. You can use various CIDR formats to increase or decrease the IP range.
  4. That’s it.

Blacklist IPs of a Specific Country in Imunify

You can easily block IP addresses in Imunify360 country-wise. Follow the below steps to perform this task.

  1. Navigate to the Imunify360 from your WHM dashboard, and click over the ADD button.
  2. Type and select the country you want to Blacklist or Whitelist by accessing your server.

    Ban Unban IPs country-wise
    Ban IPs country-wise
  3. Hit ADD COUNTRY button to add an entire country to the blacklist. Now, no one from the selected country will be able to access your server and the websites associated with your server.

    Add Country to Blacklist
    Add Country to Blacklist
  4. That’s it.

This is how you can easily Blacklist an entire country in Imunify360. 

2:  Blacklist/Whitelist IPs in Imunify from SSH

  • Quick Guide:

    • To whitelist IPs, create a whitelist directory, a file inside the directory, and type all the IPs (one per line) you want to whitelist. 

    • To blacklist IPs, create a directory named blacklist and repeat the above process.

      • It requires root access to perform this task.

      • Write one IP per line.

      • Do not create a directory with any other name instead of blacklist or whitelist.

Use the following steps to Blacklist/Whitelist IP Addresses in Imunify using some simple SSH Commands.

  • First of all, log in to SSH as a root.
  • Once logged in, navigate yourself to the imunify360 directory using the cd /etc/imunify360/ command.
Navigate to imunify directory
Navigate to imunify directory
  • Create a new directory name whitelist using the mkdir command.

Create a new directory in imunify360 command:

mkdir whitelist
  • Use the ls command to view the newly created directory.

Output:

[root@test imunify360]# ls
unified-access-logger.conf user_config whitelist
  • Navigate inside the whitelist directory and create a new file using the below command.

Navigate inside the directory:

cd whitelist

Create a new blank file:

touch filename.extension

Output:

[root@test whitelist]# touch IPs.php
[root@test whitelist]# ls
IPs.php
  • Edit the newly created file using the vi or nano command and type all the IPs you want to whitelist.
Vi command
Vi command
  • To save & exit, type Esc from your keyboard and then type :wq! command.
  • Hit the Enter button to save the file and close the window.
Save and close file in LInux
Save and close a file in Linux
  • That’s it. All the IPs present inside the file in the whitelist directory will be whitelisted automatically.
  • You can use the same method to blacklist IPs. Just create a directory with the blacklist name and rest all the process is same.

That’s it.

This is how you can easily Blacklist/Whitelist IPs in WHM as well as SSH. I hope this article helps you. If not, simply visit redserverhost.com and open a free support ticket. Our experienced Technical Support Team will be happy to assist you. Other than this, you can follow us on Facebook or Twitter for any further inquiries or suggestions. We always appreciate it.

Scroll to Top