Recently, my brother suggested me to use mod_security. I did a research what it truly is and what it does, but I feel very uneasy to decide whether should I use it or not. Here is what in my mind that keep me from not using it.
- Slightly affect my website performance. The more rules, the slower it will get.
- It does not completely filter all the attacks (it is understandable, because it is not possible for any software to truly protect everything).
- Sometimes, it can block innocent users.
- Add another software means add another responsibility to maintain it.
Now the real question is:
If mod_security cannot filter everything, and you still need to make sure your web application is secure, why not properly write a secure web application without running any Web Application Firewall?
Since it is our web application, we know better than any 3rd-party software what expected input from users. Having 3rd-party software to detect the attack and then write a input validation in our web application is like a double-check (while it is good, but the performance cost would be double as well).