How to Enable and Disable ModSecurity Rules with DirectAdmin?
ModSecurity, often known as Modsec, is a crucial piece of security software that is required for server security. It’s an online program that makes your server’s firewall operational. With the Modsec toolkit, administrators may do activities like complete traffic logging, real-time web application monitoring, and more. They can also have complete control over rules that safeguard your server. It may be able to prevent frequent code injection attacks, improving server security.
Users can now bypass some ModSecurity Rules using a new capability in DirectAdmin version 1.61.4. When necessary, users can also completely disable ModSecurity.
If you read on, you will learn how to use the DirectAdmin dashboard to set or disable ModSecurity for your domain.
This article is exclusive for the users of version 1.61.4 of DirectAdmin.
To Enable or Disable ModSecurity Rules with DirectAdmin
1. Log in to your DirectAdmin dashboard.
2. Scroll to the Advanced Features section and click on the ModSecurity icon.

You will see the ModSecurity dashboard where you can manage the Status and view the Log.
3. You have to open the Status & Disabled Rules tab.

4. You have to tick the On or Off radio button for SecRuleEngine to enable or disable the ModSecurity tool and click the SAVE button.

The system will generate a message saying ModSecurity Rules Saved.

ModSecurity is very sensitive when it comes to software security, to the point that a rule may trigger a false-positive. Commonly, such issues occur in some Content Management Systems (CMS) like WordPress. You can disable such ModSecurity Rule ID instead of shutting off the entire tool application. The Disabled Rules section will allow you to search and disable a single Rule ID.
To Disable/Enable a ModSecurity Rule ID in DirectAdmin
Enter the Rule ID in the ID field of the Disabled Rules section. Then, click the DISABLE RULE button.

A success message will appear at the bottom of the screen: Skipped rule added and, the system will add the Rule ID in the list under the ModSecurity Disabled Rules section.

To re-enable the disabled ModSecurity Rule, select the checkbox next to the Rule ID and click the Delete button.

The system will flash a message at the bottom of the screen saying selected skipped rules removed. It will also remove the Rule ID from the list of ModSecurity Disabled Rules section.
