What Is the Best Web Application Firewall for DirectAdmin?
DirectAdmin already ships the engine for a web application firewall. Whether that is enough depends on your web server, your rule set and how many customers share the box.
The best web application firewall for DirectAdmin is the one that protects every user and domain on the server without making you the person who explains to customers why their checkout returns 403. DirectAdmin gives you a solid starting point, ModSecurity installed through CustomBuild, so the real question is what you add around it and how you roll it out.
What DirectAdmin already gives you
ModSecurity is the engine, and a rule set is the policy that tells it what to look for. On DirectAdmin both come from CustomBuild. Pick a rule set, build the module, and rewrite the web server configuration.
da build set modsecurity yes
da build set modsecurity_ruleset owasp
da build modsecurity
da build rewrite_confs
Swap owasp for comodo to use the Comodo rules instead. If you run nginx rather than Apache, check that your chosen rule set supports the ModSecurity version your build uses before you commit. Community reports have been mixed on Comodo with nginx over the years, and the OWASP Core Rule Set is the more common choice there.
| Where | What it controls |
|---|---|
| Admin: Server Manager > ModSecurity | Turn the engine off server-wide or disable specific rules for everyone |
| User: Advanced Features > Web Application Firewall | Turn the engine off for a domain or disable individual rules for it |
/usr/local/directadmin/data/admin/modsecurity_rules | Global list of disabled rules |
/usr/local/directadmin/data/users/USER/domains/DOMAIN.modsecurity_rules | Per-domain disabled rules |
/var/log/httpd/modsec_audit.log or /var/log/nginx/modsec_audit.log | Audit log, by web server |
Five questions that separate a good DirectAdmin WAF from noise
-
1
Does it understand users and domains?
On a shared DirectAdmin box the first question after any block is which customer it affected. A firewall that reports only an IP and a URL makes you map that to a user by hand every time.
-
2
Can you watch before you block?
Rolling out a rule set in blocking mode on a live server is how you learn which plugins your customers use. You want a mode that records what would happen without changing traffic.
-
3
Can you scope an exception?
When one form trips one rule, the fix should be that rule for that path, not the rule for every site. DirectAdmin's per-domain disable list helps, and a path-scoped exclusion is narrower still.
-
4
Does it see floods, not just payloads?
SQL injection in a parameter is one request. A Layer 7 flood is thousands of harmless-looking requests. Signature rules handle the first well and the second poorly, so check what covers rate and repetition.
-
5
Will you read its logs?
An audit log nobody opens protects nobody. Check how a block is explained: the rule, the matched input, the domain, and what you can do about it.
Roll out rules without breaking customer sites
With raw ModSecurity the safe pattern is to set SecRuleEngine DetectionOnly for a few days, read the audit log for the requests your customers really send, add exclusions for the false positives, and then switch to On. DirectAdmin's documentation suggests putting your own settings in a file CustomBuild does not overwrite, such as /etc/httpd/conf/extra/httpd-includes.conf for Apache, or in the custom copy of the ModSecurity configuration under /usr/local/directadmin/custombuild/custom/.
grep -o '\[id "[0-9]*"\]' /var/log/httpd/modsec_audit.log | sort | uniq -c | sort -rn | head -20
grep -h 'ModSecurity' /var/log/httpd/domains/*.error.log | tail -50
The first command ranks rules by how often they fire, which is usually a short list. The second shows recent hits in the per-domain error logs. When a single rule dominates and the matched data looks like normal content, that rule needs an exception. For the step-by-step version of that fix, see ModSecurity 403 on cPanel? Fix the False Positive Safely. The ModSecurity directives are the same on DirectAdmin, only the menus differ.
Where BashEdge fits on DirectAdmin
ModSecurity with a good rule set is a sound foundation, and many servers should start there. What it does not give you is one view that ties request rules to request rates, firewall policy and login abuse. BashEdge for DirectAdmin protects every reseller, user and domain with a WAF, Layer 7 DDoS protection, firewall controls and login defence. It installs with one command and begins in monitor mode, so you review the effect of each rule on real traffic before enforcing it. Each action is tied to the rule, the reason, the source and the targeted host, and you choose per rule whether to monitor, challenge or block.
If the problem you are actually facing is a flood rather than an exploit, read DirectAdmin Server Under DDoS: Find the Target and Block It and WAF vs Firewall: Which One Stops Layer 7 DDoS Attacks? before choosing a tool.
The practical decision
- A few sites you control. ModSecurity with the OWASP rule set, rolled out in detection mode first, is often enough.
- Many customers on one server. Add tooling that reports by user and domain, and decide your policy on user-level disabling up front.
- Recurring floods or login attacks. Signature rules are not the main defence. Look for rate-aware protection and per-service thresholds.
- Any of the above. Test with real traffic before you block, and keep a written record of every exception.