ModSecurity is a Web Application Firewall (WAF) that checks incoming requests to your website for known attack patterns, such as SQL injections and cross-site scripting. In Plesk, you enable this protection via your domain’s security settings, after which you choose a rule set and decide whether suspicious traffic is denied or only logged. Below you’ll find step-by-step instructions on how to configure this correctly without blocking legitimate traffic.
Activating ModSecurity in Plesk
ModSecurity acts as a filtering layer between visitor and web server, whether you use Apache or LiteSpeed. Enabling it is done per domain, so you can determine how strict the protection is for each website.
Log in to Plesk
Go to Websites & Domains and select the domain for which you want to enable ModSecurity.
Open Security Settings
Click on the domain and locate the section with security options for this domain.
Enable ModSecurity
Check the Enable ModSecurity option and save the changes. The web server applies the new setting immediately.
Configuring security rules
After activation, you set up a rule set. In Plesk, the most commonly used choice is the OWASP ModSecurity Core Rule Set (CRS), a widely supported collection of rules that recognizes known attack patterns and is regularly updated.
Go to your domain’s security settings and choose the option for ModSecurity rule sets. Select the OWASP CRS and then determine the mode:
- Log β suspicious traffic is only logged, nothing is blocked. Useful for testing.
- Block β suspicious traffic is actively denied. Only use this once you’re certain that legitimate visitors won’t be affected.
For a new website, always start in logging mode, check the logs for a while, and only switch to blocking mode afterward.
Checking log files and adjusting rules
ModSecurity logs every request that triggers a rule. You can find these log files in Plesk under your domain’s log files. Check them regularly, especially after enabling blocking mode.
If you notice that a legitimate action is being blocked, such as a form or a plugin function in a CMS, you can exclude the specific rule causing this for that domain. This way, the rest of the protection remains active without losing functionality.
If you get stuck interpreting a log entry or excluding a rule, you’ll find detailed examples in the knowledge base, or you can consult your hosting provider’s support team.
Avoiding common mistakes
Most problems with ModSecurity don’t arise because the firewall is too strict, but because it’s configured incorrectly. Watch out for the following:
- Switching directly to blocking mode without first testing in logging mode.
- Disabling rules entirely instead of only the specific rule causing issues.
- Never checking log files, so you don’t notice that customers or forms are being blocked.
- Using outdated CMS plugins that generate patterns resembling an attack.
If you run multiple websites, it’s wise to assess per domain which mode and rule set are appropriate. For example, an online store requires different exclusions than a simple brochure website. If you’re still unsure about the right web hosting environment for these kinds of settings, check whether Plesk and its associated security modules are available by default.
Frequently Asked Questions
Does ModSecurity slow down my website?
The overhead is limited, especially on fast storage such as NVMe. A properly configured rule set has barely any noticeable effect on load time.
What’s the difference between logging and blocking?
In logging mode, suspicious requests are only recorded. In blocking mode, they are actively denied. Always start with logging to detect false positives.
Do I need to update the rule set myself?
Plesk usually updates the included rule sets automatically. After an update, briefly check the log files for new blocks.
Can I add my own rules?
Yes, through the advanced settings in Plesk you can add custom rules or exclusions to resolve specific false positives.
Does ModSecurity also affect my email?
No, ModSecurity filters web traffic to your website. For the security of business email, different settings apply, such as SPF, DKIM, and DMARC.
Conclusion
ModSecurity in Plesk provides targeted protection against common web attacks, provided you set it up step by step: activate it, choose a rule set, first test in logging mode and only then switch to blocking, and regularly check the log files. This way, you prevent legitimate visitors from being blocked while attacks are still stopped.