ModSecurity (Web Application Firewall) on LWS Panel: read and resolve a block

Procédure

ModSecurity is the application firewall (WAF, “Web Application Firewall”) for your LWS Panel hosting plan: it blocks dangerous requests before they reach your site. It is enabled by default and we manage its rules. If a legitimate action on your site is denied with a 403 or 406 error, you can find the rule that blocked it, disable that rule alone, or turn off ModSecurity temporarily for testing, from the “Mod security” tool in the “Security” section.

What is a web application firewall?

The ModSecurity Web Application Firewall is used to protect your website from web-based intrusions. It secures the application layer before requests reach the hosted site: detection of inclusion attempts, anti-spam protection, detection of exploits (it allows version numbers used to be hidden on error pages returned by the web server), brute-force login attempts on WordPress, access to sensitive files, etc.

We manage the rules and update them regularly, including in response to new vulnerabilities. We strongly recommend leaving ModSecurity enabled. If it causes problems with your applications, however, you can disable the rule that is causing the issue, or the entire firewall.

Do not confuse it with the other protections in the “Security” section:

  • DDOS Firewall (Anubis) filters traffic sent in large volumes to overwhelm your site. When it blocks, it displays a “Verification in progress” page or a 403 error;
  • Web IP Firewall blocks or allows the IP addresses you choose: see How to configure the IP Firewall;
  • Web IP Blacklist shows IP addresses automatically blocked by our services after too many suspicious events, and allows you to unblock yours: see Error 512 - OL-BLACKLIST-IP.

How do you configure the web application firewall?

  1. Open the Mod security tool

    Log in to your web hosting admin area and, in the Security section, click Mod security. The page shows the firewall status, the Configure button (rules), and, for each domain and subdomain, the View history button.

    ModSecurity (Web Application Firewall) on LWS Panel: read and resolve a block

  2. Leave the switch on On

    The Mod Security status on all domains associated with the plan switch (On / Off) enables or disables the firewall for all domains on your plan, including subdomains. Leave it set to On.

Is a legitimate action on your site being blocked (403 or 406 error)?

This may be the submission of a form, an action in your site’s administration area, or logging in to WordPress. Proceed in order and stop as soon as the action succeeds.

  1. Find the event in the history

    On the line for the relevant domain, click View history. Identify the event at the time of the block (the Search field accepts an IP address or a word from the description) and note its Rule ID and IP address.

    ModSecurity (Web Application Firewall) on LWS Panel: read and resolve a block

  2. If needed, read the details in LWS Log Analyzer

    In the Databases & PHP section, click Apache PHP ModSecurity Logs, then open the Mod Security (WAF) tab. Enter the page address, your IP address or the rule number in the search field: the table shows, for each request, the date, IP address, method, URL, triggered rule and the “Blocked” status. The ✨ button next to a rule number explains the rule in simple language. The tool is presented in the help article How to access Apache / Php Logs.

    ModSecurity (Web Application Firewall) on LWS Panel: read and resolve a block

  3. Disable only the rule that is causing the issue

    Rather than turning off all of ModSecurity, set this rule to Off: either directly in the Status column of the history, or via Configure, by searching for the rule ID. The rule is disabled for your domain and the domains attached to it.

  4. As a last resort, turn off ModSecurity for the duration of a test

    Switch the Mod Security status on all domains associated with the plan to Off, repeat the action, then switch it back to On.

Check that everything works

Repeat the action that was blocked (form submission, saving, login) from the same internet connection.

Common issues

The action is still blocked even though ModSecurity is set to Off

The block comes from another protection. If a “Verification in progress” page appears, adjust the DDOS Firewall (Anubis) in the same “Security” section. If the error indicates 512 OL-BLACKLIST-IP, your IP address is blocked: follow the help article Error 512 - OL-BLACKLIST-IP. The Protection tab of LWS Log Analyzer also lists 509 and 512 blocks.

ModSecurity blocks my WordPress login

Look in the history for a “WordPress Bruteforce” rule and check the event’s IP address. If it is yours, also check in “Web IP Blacklist” that it is not blocked.

How can you get help?

If the block persists, contact our technical support: How to contact technical support by email? Include with your request the exact page address, the action performed (form submission, saving, login, etc.), the exact date and time of the attempt with the time zone, the error code and full message or a screenshot, the rule number if it appears in the history, and your public IP address.

Related articles

help.lws.net/a/98
Was this article helpful?

Yes

No

Read 23 415 times

Thank you! Feel free to ask questions about our documentation if you would like more information, and help us improve it.

Similar articles

A question about this article?

Ask the LWS team and the community. Answers are published after moderation.

Ask the LWS team and its community a question

GDPR: Controller: LWS-Ligne Web Services. Purpose: moderation and public publication of your question, possible notification of an answer. Legal basis: consent (Art. 6(1)(a) GDPR). Email retention: 90 days after notification, 12 months maximum without an answer. To exercise your rights, see the GDPR section of our Terms and Conditions.