OPNSENSE + MODSECURITY

ModSecurity & OWASP Core Rule Set on OPNsense

ModSecurity with the OWASP Core Rule Set turns OPNsense into a full-fledged Web Application Firewall – free, open source, and precisely tunable to your applications. The decisive success factor is not the installation, but the clean tuning work afterwards, so that attacks are blocked and legitimate traffic gets through.

KEY POINTS
Free OWASP Core Rule Set
Community-maintained industry reference.
Individual paranoia level
Four levels between security and false alarms.
Flexible anomaly scoring
Blocks only above a defined threshold.
Tuning against false alarms
Adapted based on real logs of your application.
Bank-proven WAF configuration
Fine-tuned for weeks instead of factory settings.

What is ModSecurity?

ModSecurity is an open-source web application firewall engine. On OPNsense, we operate it behind HAProxy or Caddy as a reverse proxy: All incoming web traffic to your application first passes through ModSecurity, is checked against a set of rules, and is only forwarded to the actual server if the result is inconspicuous.

As a rule set, we use the OWASP Core Rule Set (CRS) – the industry reference for generic attack detection, maintained by an independent security community rather than a single manufacturer.

How we set up ModSecurity for your application

The installation of ModSecurity + CRS is done in a few minutes. The actual effort – and our actual work – lies in the tuning: two independent adjustment screws decide whether the WAF reliably blocks attacks without paralyzing your own application.

PARANOIA LEVEL

How strictly is it checked?

Four levels (PL1–PL4) determine how many rules are active. PL1 covers the obvious attack patterns, PL4 checks extremely precisely – but generates significantly more false alarms. For most business applications, we configure PL1–PL2 as a starting point.

ANOMALY SCORING

When is it blocked?

Every suspicious anomaly adds points to an anomaly score; only when a threshold (default: 5) is exceeded does the WAF block the request. We adapt this threshold and specific exception rules to your real application instead of working with factory settings.

OPNsense + ModSecurity or Sophos SFOS WAF?

OPNSENSE + MODSECURITY

Community rule set, full control

Free, globally maintained OWASP rule set
Fine-grained tuning per application possible
No dependency on a firewall manufacturer
We handle setup & ongoing tuning
SOPHOS SFOS WAF

Integrated directly into the firewall

No separate reverse proxy server needed
Centralized management via Sophos Central
Automatic signature updates from the manufacturer
Useful if Sophos XGS is already being used
CASE STUDY
MEDIUM-SIZED BANKING HOUSE

Weeks of fine-tuning instead of factory settings – and a passed pentest

For a medium-sized banking house, we gradually hardened a WAF (at that time an older Sophos UTM firewall) over several weeks instead of working with factory settings: The reverse proxy was restricted to the networks allowed within the bank, form hardening was activated, and SQL injection and other filters were fine-tuned to what was actually necessary – instead of being set to the highest level across the board. Result: The external penetration test was passed without critical findings. We still apply this exact philosophy today – preferring iterative and application-specific tuning over a one-time maximum setting – whether with Sophos SFOS or OPNsense + ModSecurity.

Should we check your application for OWASP Top 10 vulnerabilities?
Get in touch
This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.