berth

Security

Web application firewall (WAF)

One WAF policy for every site, app and container, based on ModSecurity and OWASP Coraza with the OWASP Core Rule Set, with five strictness levels (Strict by default), per-rule hits, one-click exclusions and virtual patches.

Updated 5 min readwaf · modsecurity · coraza · owasp crs · firewall · virtual patchView as Markdown

On this page
  1. Two engines, one policy
  2. Modes and strictness levels
  3. Server, package, domain
  4. See what the WAF blocks
  5. Fix a false alarm with an exclusion
  6. Virtual patches
  7. Upload scanning
  8. Check the configuration

A web application firewall inspects each HTTP request before it reaches the application and blocks the ones that look like an attack: SQL injection, cross-site scripting, path traversal, remote code execution attempts, scanners. It does not replace updates, but it buys time and stops a large part of the automated attacks every public site receives.

In Berth every website has a WAF by default, and you manage it with one policy, whatever runs behind it.

Two engines, one policy

What runsEngine
PHP websites (served by Apache behind nginx)ModSecurity with the OWASP Core Rule Set (CRS)
Node.js and Python apps, containersberth-waf: OWASP Coraza with CRS 4, a separate service with no access to the webspaces

Both engines follow the same mode, strictness, exclusions and virtual patches. You never have to think about which engine a site uses. When you change the strictness of a domain, it applies to its PHP site and to the apps and containers published on it alike.

Modes and strictness levels

Each domain has a mode:

  • on: attacks are blocked;
  • detect: attacks are logged but let through, which is useful for a new or sensitive site while you check for false alarms;
  • off.

And a strictness level (Strictness):

LevelCLI nameWhen to use it
RelaxedrelaxedSites that legitimately receive a lot of unusual input
StandardstandardThe common OWASP baseline
Strict, Berth's defaultstrictRecommended: rather slightly too strict than too lenient
Very strictstricterSensitive sites; expect to add a few exclusions
MaximummaximumEverything on; only with care and testing

Each level is a combination of a CRS paranoia level and an anomaly score threshold. berth waf levels shows exactly how each level is set.

Server, package, domain

The policy is set at three levels. The more specific one wins:

LevelWhereWhat you set
ServerSecurity → WAF, section Server defaultMode, strictness, rules that are off everywhere
PackagePackagesMode and strictness for all domains on the package, extra rules off
DomainThe domain's page, section WAFIts own mode and strictness, extra rules off

Mode and strictness: the domain overrides the package, the package overrides the server, and an empty value means "inherit". Disabled rules add up across the levels. Customers, and restricted logins with the security permission, can adjust their own domains.

berth waf server --mode on --level strict
berth waf set --domain example.nl --level standard
berth waf set --domain shop.example.com --mode detect
berth waf set --domain example.nl --level default        # inherit again
berth plan set --name Business --waf-level stricter

Also checking responses

By default the WAF inspects requests. For a sensitive domain you can switch on Also check responses in its WAF section: the WAF then also inspects the pages the site sends back, so a leaked error message or a piece of source code is stopped. It costs some processing time on every page, and the visitor only gets a page once it is complete, so it is off by default. It applies to PHP sites, which are served through ModSecurity.

berth waf set --domain example.nl --response
berth waf set --domain example.nl --response=false

See what the WAF blocks

Under What the WAF encounters, on the domain page and on Security → WAF for the whole server, Berth shows per rule how often it fired and how often it actually refused a request, with example paths. A chart shows the trend over time, and Latest events lists individual requests.

A visitor of an app who is refused gets a reference code, which you can look up in the events. Refused requests are also written to the system journal, so they reach your SIEM along with everything else. See Audit trail and approvals.

berth waf events --domain example.nl     # without --domain: the whole server

Fix a false alarm with an exclusion

When a rule fires on legitimate traffic, such as a contact form, a CMS editor or an API, switch that rule off for exactly the scope that needs it:

  1. Open What the WAF encounters on the domain page and find the rule that blocks the request.
  2. Click Switch off for that domain, or for the whole server if every site is affected.
  3. Test the form or page again.

Or on the server, with the rule ID from the events:

berth waf exclude --domain example.nl --rule 942100
berth waf exclude --plan Business --rule 942100       # every domain on a package
berth waf exclude --server --rule 942100              # the whole server
berth waf include --domain example.nl --rule 942100   # switch it back on

Prefer a narrow exclusion on one domain over lowering the strictness of the whole site. A single excluded rule leaves the rest of the protection in place. Berth also ships a few narrow, built-in exceptions for known false alarms in popular applications, so a standard install of those works at the default level.

Virtual patches

When a vulnerability is published for software you run and there is no fixed version yet, a virtual patch can block the specific attack in the WAF until the real fix arrives. Virtual patches come as typed rules in a signed bundle. Berth only loads a bundle with a trusted signature. You apply them per CVE, as one of the mitigations on the vulnerability's page, and remove them with one click once the update is installed.

berth mitigation patches                                   # patches in the loaded bundle
berth mitigation options --cve CVE-2026-12345              # what can be done for this CVE
berth mitigation apply --cve CVE-2026-12345 --kind waf_patch --patch <id>
berth mitigation list
berth mitigation revert --id 7

See Vulnerability management for the full flow.

Upload scanning

For PHP sites with the WAF on, uploaded files can also be passed to ClamAV before the application sees them, and an upload containing malware is refused. This needs the virus scanner to be running; without it uploads go through unscanned, and the panel shows that. See Malware scanning.

Check the configuration

berth waf check runs the configuration test of berth-waf. As with every other service, a WAF change is validated before it goes live, so a bad rule never takes sites down. See How changes go live.