AppSecNews
RASP Open source Established

ModSecurity

by OWASP

An open source web application firewall engine that embeds in a web server or proxy and evaluates requests and responses against a rule language, most often the OWASP Core Rule Set.

Visit modsecurity.org (leaves AppSecNews, opens in a new tab) Leaves AppSecNews for the vendor's own site.

No endorsements yet

Run ModSecurity in production? A named recommendation helps the next team shortlisting it.

Recommend this tool

Endorsers verify their identity through LinkedIn. Titles and companies are self declared, shown as they were when each person signed, and reviewed by an editor before anything is published. Endorsements are never paid for.

What we still need to verify : 2 points in this profile are not yet confirmed against vendor documentation.
  • Connector maturity varies by platform and changes over time: confirm the current state for your web server
  • Project stewardship moved between sponsors; confirm current maintenance status before adopting

Treat these points as unconfirmed. They are open items in the catalog's verification queue, and this note stays until each is checked against the vendor's documentation.

What it does

ModSecurity is a rule engine that sits in the request path. In its original form it was an Apache module; the current engine, libmodsecurity, is a standalone library that web servers and proxies talk to through connectors. It processes a transaction in phases: request headers, request body, response headers, response body, and logging. At each phase your rules can inspect variables, apply transformations to normalize input, and act.

The rule language is the substance of the tool. A rule names variables to examine, a transformation chain to apply, an operator to run, and actions to take. Transformations matter more than they first appear: they strip the encoding layers hiding a payload before the operator ever runs. Most deployments load the OWASP Core Set rather than writing rules from scratch. It covers injection, traversal, protocol violation and scanner detection, and uses anomaly scoring so several weak signals combine into a block decision instead of one regex deciding alone. You then spend your time writing exclusions for the places your application legitimately looks like an attack.

Where it fits

This is infrastructure, operated by whoever runs the web tier, with rule tuning shared between that team and security. It runs in production at the edge or in front of individual services, and in Kubernetes it commonly arrives through the NGINX ingress controller. The prerequisite is a team willing to run it in detection mode first and work through the exclusions, because enabling the Core Set at a strict paranoia level without that work will break the application.

Strengths

  • Runs inside infrastructure you already operate, with no traffic leaving your environment and no external dependency in the request path.
  • The rule language is expressive enough to encode application-specific logic, not just generic attack patterns.
  • Anomaly scoring in the Core Set gives a tunable sensitivity dial rather than a binary per-rule block.
  • Detailed audit logging makes post-incident request reconstruction genuinely possible.

Limitations

  • Tuning is ongoing labor. False positives on legitimate traffic are the norm at the start, and exclusions have to be maintained as the application changes.
  • It sees requests and responses, not application state, so authorization flaws and business logic abuse are structurally outside its reach.
  • Project sponsorship has changed hands, connector quality varies by platform, and rule evaluation adds latency worth measuring under load.

Who it suits

A strong fit for teams that run their own web tier, have someone willing to own rule tuning, and want a firewall layer with no managed service in their traffic path. Less suitable for small teams with no tuning capacity, who usually do better with a managed WAF.

Used ModSecurity? Recommend it under your own name and title.

Recommend this tool