Web Application Firewall
os-modsecurity · Protection
A web application firewall in front of the sites published through the firewall: Apache with ModSecurity and the OWASP Core Rule Set.
In the menu
- With os-xgs-npu installed: XGS: Web Application Firewall
- Without os-xgs-npu: Services: Web Application Firewall
Each request for a site is received on the firewall by an Apache of the plugin's own, inspected by ModSecurity with the OWASP Core Rule Set, and passed to the site's backend over HTTP or HTTPS. A new site starts in Detection only, which writes what the rules find and lets the request pass; Blocking refuses a request the Core Rule Set judges an attack. The installer adds OPNsense's packages apache24 and ap24-mod_security when they are not there.
The Core Rule Set is installed from this repository's own releases of it, each checked against the OWASP project's signature and signed again with the project's release key, and followed each day on its line, 4.25 by default. Apply has Apache test the configuration before it is put in force. No site is published until the plugin is on and a Core Rule Set installed.
Features
-
Sites
Each with its host names, its backend, its certificate of System: Trust or none, its mode and its paranoia level, 1 to 4.
-
Exclusions
Rules of the Core Rule Set taken away from one site's requests where they refuse what the site needs.
-
Incidents
What the rules found, newest first, read from the audit log: each request refused, and each one only detected.
-
TLS
A site with a certificate is served over HTTPS, its plain HTTP requests sent there; TLS 1.2 and 1.3.
Install and update
Since os-xgs-npu 0.2.0-alpha.1, XGS: Updates lists it on its Plugins tab, where it is installed and updated from its signed releases, and an update of the project installs it on an appliance that never had it; nothing is updated on its own. By hand, as root, on an XGS appliance or on any other OPNsense: from a checkout of the repository with sh install/install.sh, which puts the page under XGS with os-xgs-npu and under Services without it, and keeps the settings when run again; a copy installed this way is updated by its own self-update.py, and sh install/uninstall.sh takes it away. It is not in the OPNsense plugin repository.
Limits, and what is not tested yet
- The Core Rule Set's releases: none is published yet, so Install says the line has no release; the lab installed one by hand.
- The second part on a plain OPNsense; it ran on the second XGS 3300 and the XGS 136.
- An exclusion by tag, or by a parameter's pattern.
- The page in a browser: not opened yet, in either theme or language; its photographs are to be taken with the other pages'.
- More, each with its reason: the README's Not yet, and why.
Repository
First release: 2026-11-20
The discussion of this page is held in the project's GitHub Discussions. Showing it here loads giscus from giscus.app and GitHub, and writing in it needs a GitHub account - what that means.