Learn Plesk

Managing your websites and servers is simple and efficient with the Plesk Web Hosting Control Panel!

• Last Updated: 01/20/2026
• ( 15 minutes reading )

How to configure and use ModSecurity in Plesk

Introduction

ModSecurity is a powerful web application firewall (WAF) designed to protect your website from various online threats, including SQL injections, cross-site scripting (XSS), brute-force attempts, and other malicious activities.

Plesk includes built-in ModSecurity support, allowing you to enable, configure, and manage firewall rules directly from your control panel. Whether you want to increase security, fine-tune rule sensitivity, or analyze security logs, Plesk makes ModSecurity easy to work with.

In this tutorial, we will guide you through the process of configuring and using ModSecurity in Plesk.

Getting Started

First and foremost, make sure you are logged in to your Plesk control panel. To perform that, please enter your IP address, hostname, or domain name inside your web browser’s search bar and add “:8443” at the end. It should look something like: “https://yourdomain.com:8443”. By doing that, you will be prompted by a login form requesting your username and password.

plesk-login-screen

After logging in with your username and password, Plesk will automatically display the “Websites & Domains” page, which will be your index page from where you can manage everything related to your websites and domains on Plesk. 

 

Accessing ModSecurity Settings in Plesk

To access and configure ModSecurity, please click on the “Tools & Settings” option from the left-hand menu.

tool-and-settings

Under the Security section, click on “Web Application Firewall (ModSecurity)” functionality.

web-app-firewall

Performing the action above will open the main ModSecurity configuration page. From there, you will have complete control over your server’s ModSecurity settings.

 

Enabling or Disabling ModSecurity

After landing on the ModSecurity page, you will initially see the general settings. At the top of the ModSecurity settings page, you will see a radio button that will allow you to enable, disable, or turn on a detection mode only. 

 

  • On - Please use the radio button to select this option and enable mod_security on your server.
  • Off - Please use the radio button to select this option and disable mod_security on your server
  • Detection only - Please use this option to enable the “detection only” mode. Applying this will check incoming HTTP requests and the related responses against a set of rules. If these check succeeds, the HTTP request is passed to the website content. If the check fails, the event is logged, and ModSecurity performs no other actions. Other services (for example, Fail2ban) can still perform their own actions on HTTP requests that failed the check.

general-settings

Recommendation: We strongly recommend enabling “On” for active protection unless you are testing rules.

Switch off security Rules

After changing the mod_security behaviour, scrolling down on the same page will provide a brief explanation of the mod_security audit log. Underneath the explanation, you will find two links:

 

ModSecurity Log File - Please click on this link to open a new tab showing the content of the mod_security audit log itself.

Logs Archive - Please click on this link to download an archive containing the mod_secuty audit logs for either this month or the previous months.

mod-security-log-file

Scrolling further down will allow you to switch off certain security rules enforced by ModSecurity. You can do that using one of three criteria:

 

 

  • mod_security rule ID - Please use the content box to add the IDs for the mod_security rules you would like to disable.
  • Tag - Please use the search box and look for tags associated with the mod_security rule you want to block. For example, if you have a WordPress website and a specific plugin that is being prevented from working correctly, you can look for a tag containing that plugin’s name and exclude it from here. 
  • Regular expressions in rule messages - Please use this content box to add a regular expression that will match a rule message. This is a bit more technical, and you need to be intimately familiar with mod_security to use it. 

mod-sec-settings

After entering the details about the ruleset you would like to block, please click on the “OK” button at the bottom of the page to save them and be redirected back to the “Tools & Settings” page, or click on the “Apply” button to save the settings and remain on the same page. 

Choosing a Rule Set

ModSecurity relies on rule sets that define what actions are considered suspicious. Plesk typically includes the following choices when it comes to rule sets. These rule sets can be selected from the “Settings” tab on the “Web Application Firewall” page. To access them, please click the “Settings” tab.

web-app-firewall-settings

Performing the action above will unveil all the mod_security rule sets, along with other settings, which we will review further down the tutorial. Let’s go over the default rule sets typically available with Plesk. At the top, you will find a drop-down menu that allows you to select the version of the rule sets. Generally, it will depend on the web server you use (Apache, NGINX, LiteSpeed), thus, please select the one you are currently using. 

  • Atomic Basic ModSecurity - Please use the radio button to enable the Atomic Basic rule set. This is a starter version of ModSecurity Rules by Atomicorp. They provide basic protection and are updated monthly. The Advanced version can be upgraded by purchasing the ruleset from Atomic.
  • OWASP ModSecurity Core Rule Set (CRS) - Please use the radio button to enable the OWASP ModSecurity Core Rule Set. The OWASP ModSecurity Core Rule Set is very restrictive and may block certain functions (such as file sharing and webmail) and features of web applications (like WordPress plugins).
  • Comodo - Please use the radio button to enable the Comodo free ModSecurity rule set, which provides fundamental protection.
  • Custom - Please use the radio button to select the Custom option, allowing you to upload your own custom rules or add mod_security rules from a third-party vendor you prefer to use.

apache-version-option

Recommendations: The OWASP CRS is widely used and recommended for general protection, unless you have your own ruleset or use the services of a third-party security vendor.

Additional ModSecurity Configuration

After selecting your rule set, scrolling down will allow you to perform additional configurations for your mod_security service. You can configure your WAF using either a predefined set of parameters or your custom ModSecurity directives.

 

  • Predefined Values 
  • Fast - Please use the radio button to select the “Fast” analysis value. This analysis value will check the HTTP request URI and parts of the headers.
  • Tradeoff - Please use the radio button to select the “Tradeoff” analysis value. This analysis value will check the HTTP request URI, headers, and the request POST data.
  • Thorough - Please use the radio button to select “Thorough” analysis value. This analysis value will check the full HTTP request headers, the request POST data, and the HTTP response body content.
  • Custom Directives - Please use the content box to enter custom mod_security directives. Performing this will override the previously specified directives.

confirm-configurations

Please select the level that best suits your security needs, and afterward, please click on the “OK” button at the bottom of the page to save your settings and be redirected back to the “Tools & Settings” page, or click on the “Apply” button to save the settings and remain on the same page. 

Enabling ModSecurity Per Domain

You can also control ModSecurity at the domain level. You can do that by returning to the “Websites & Domains” index page, which we covered at the beginning of our tutorial. 

expand-domain-tools

From there, please expand the settings for the domain you want to disable the mod_security feature for. Then, from the expanded settings, locate and click on the “Web Application Firewall” functionality.

web-application-functionality

After performing the action above, you will be redirected to a familiar page, from which you will have the option to disable or enable mod_security for this particular domain. 

Additionally, you will be able to disable specific security rules if only some of them are a nuisance for your website! 

turn-on-or-off

This is useful when one website requires stricter or more relaxed settings. Finally, to apply your settings, please click on the “Ok” button located at the bottom of the page and be redirected back to the “Websites & Domains” page, or click on the “Apply” button to save the settings and remain on the same page. 

Conclusion

As you can see, ModSecurity in Plesk provides a powerful and flexible way to protect your website from a wide range of threats. With easy configuration options, adjustable rule sets, domain-level controls, and detailed logging, you can maintain strong security while ensuring compatibility with your applications.

We hope this tutorial was helpful, and we kindly encourage you to review your ModSecurity settings regularly to keep your website secure.

...
Nikola Zgurev
Technical Support Captain

Nikola is an accomplished tech-savvy extraordinaire with over six years of experience in the web hosting field. He started as a customer care representative and quickly rose the ranks to become a support supervisor and, eventually - the head of the technical department in HostArmada. His deep understanding of the client's needs, combined with his technical knowledge, makes him the perfect man to create the ideal harmony between client satisfaction and professional problem-solving. You will often find him creating helpful tutorials, articles, and blog posts that help existing customers get around.