ViMbAdmin CRS plugin
The ViMbAdmin CRS plugin makes the OWASP Core Rule Set (CRS 4) work with ViMbAdmin, the web panel for managing Postfix and Dovecot domains, mailboxes and aliases. It is for mail admins who already run ModSecurity or Coraza with CRS in front of the panel, on Angie, NGINX or Apache.
Without it, CRS blocks normal admin work: a password full of symbols, a long CSRF token or a comma-separated alias list looks like an injection attempt. The plugin removes those false positives on the panel’s own routes. It also adds an allowlist that only lets through the argument names and paths ViMbAdmin really uses.
→ GitHub · ViMbAdmin write-up · All CRS plugins
Do you need this?
Probably not on its own. ViMbAdmin’s request surface is small and fully known. The positive-security Angie and NGINX vhost in the ViMbAdmin repository (contrib/angie/vimbadmin.conf) already allowlists routes, methods and arguments at the edge. It needs no ModSecurity and adds no per-request CRS cost. It is the recommended first line of defence.
The CRS plugin is a second layer. Run it as well only if you already operate ModSecurity with CRS and want CRS to scan the values the app accepts for SQL injection and cross-site scripting, on top of the vhost’s name and route checks. If you do not run ModSecurity yet, the vhost alone is enough.
What the ViMbAdmin CRS plugin does
- False-positive exclusions (
vimbadmin-before.conf): narrowctl:ruleRemoveTargetByTagexclusions per route, so CRS stops flagging passwords with symbols, the CSRF token, aliasgotolists, free-text descriptions,10GB-style quotas, typeahead search terms and the DataTablesvm_prefscookie. CRS keeps checking every other field. - Positive security (
vimbadmin-after.conf): allow what ViMbAdmin uses and block the rest. Rule 9529220 denies any argument whose name the app does not use, with a 403. Rule 9529230 answers any path outside ViMbAdmin’s route map with a 404. That stops parameter smuggling, mass-assignment probes and scanner requests for/.envor/wp-login.php, whatever the payload. The allowlist was built from ViMbAdmin’s controllers, forms and templates, and it accepts the DataTables 2 table parameters. The bearer-authenticated/mcpJSON API is exempt from the argument-name check but not from the path check.
Both parts sit behind one switch, tx.vimbadmin-plugin_enabled, which is off by default. Once you enable the plugin, the allowlist is on too: vimbadmin-config.conf sets tx.vimbadmin-plugin_positive_security=1 unless you set it yourself. The project README still calls the allowlist opt-in, which is out of date.
Install and enable
Our modsecurity-crs package already ships the plugin in /etc/modsecurity/crs/plugins-available/vimbadmin-crs-plugin/, the same files as the GitHub repository. Link it into plugins-enabled/:
ln -s ../plugins-available/vimbadmin-crs-plugin /etc/modsecurity/crs/plugins-enabled/vimbadmin-crs-plugin
The modsecurity.conf-recommended file from the package already includes every enabled plugin’s config, before and after files in the right order. Linking the plugin does not switch it on. Enable it only where ViMbAdmin is served, never globally, because it relaxes CRS on ViMbAdmin’s routes. On Angie or NGINX with libmodsecurity3:
location /vimbadmin/ {
modsecurity on;
modsecurity_rules '
SecAction "id:9529001,phase:1,nolog,pass,setvar:tx.vimbadmin-plugin_enabled=1"
';
}
Add your usual proxy_pass or PHP handler to that block. The ModSecurity connector runs a block’s own rules before the rules it inherits from http, so the flag is set before the plugin checks it. A server block works the same way if ViMbAdmin has its own host name. We tested this location block on Angie 1.12.5 with libmodsecurity3 3.0.17 and the CRS from modsecurity-crs. Under /vimbadmin/, a probe for wp-login.php got a 404 from rule 9529230 and an unknown argument got a 403 from rule 9529220. The login page still loaded, and another location on the same server was not touched.
On Apache with mod_security2, a SecAction inside <VirtualHost> or <Location> runs after the inherited CRS rules and does not enable the plugin; we saw this with mod_security2 2.9.7 on Debian 12. Put a rule that matches the panel’s host name in the main configuration, before the CRS Include line, for example SecRule REQUEST_HEADERS:Host "@streq mail.example.com" "id:9529002,phase:1,nolog,pass,setvar:tx.vimbadmin-plugin_enabled=1".
Roll it out in three steps:
- Enable the plugin only for the ViMbAdmin vhost or location. The exclusions are immediately safe and will never affect other vhosts using the same CRS engine.
- Set CRS to DetectionOnly mode and monitor the audit log for rules
9529220and9529230. Every hit is a missing argument or path in the allowlist. Add the legitimate ones (e.g. from your own ViMbAdmin modifications) to the inline regexes of these two rules invimbadmin-after.conf. To continue value scanning without the allowlist, addsetvar:tx.vimbadmin-plugin_positive_security=0to the enable rule. - Re-enable blocking mode in CRS.
Tested engines and supported systems
The plugin needs CRS 4 or newer and uses rule IDs 9,529,000 to 9,529,999. Its CI runs the same go-ftw regression and security suites on three engines: Apache httpd with Debian 12’s mod_security2, Angie with libmodsecurity3 and the connector from our APT repository, and NGINX with the Coraza connector from our repository on Debian 13. All three load the CRS from our modsecurity-crs package. A separate job replays the adversarial security corpus against the Apache build, and a lint job checks rule IDs and test references. CI switches the plugin on globally, so the per-location scoping above comes from our own test, not from CI.
The engine, connectors and rule set install with APT once the repository is set up. modsecurity-crs, libmodsecurity3, angie-module-http-modsecurity and libnginx-mod-http-modsecurity are built for Debian 13 trixie, 12 bookworm and 11 bullseye, and for Ubuntu 26.04 resolute, 24.04 noble and 22.04 jammy, on amd64 and arm64. On Debian 11 arm64 only the engine and the rule set are available, without the connector modules. The Coraza connector, libnginx-mod-http-coraza, is built for trixie and resolute only.
