WAF in Roxy-WI 9.2

Last updated: · Applies to Roxy-WI 9.2 and later.

Manage HAProxy and NGINX WAF rules, distinguish saved changes from confirmed application, and synchronize rules across linked servers.

Web Application Firewall (WAF)

A WAF inspects HTTP requests and applies rules to detect or block unwanted traffic. Roxy-WI manages a separate WAF agent for HAProxy and the ModSecurity module for NGINX. Select the correct service and server before changing rules.

The overview uses server cards with search, status filters and cluster information. Open the status details for diagnostics; use Manage rules for the rule catalog and Logs for events and audit transactions.

ModSecurity and OWASP CRS

Roxy-WI installs ModSecurity with OWASP Core Rule Set (CRS) rules. Review the rules against your application's traffic before enabling blocking. The Configured WAF mode selector saves On, Off or DetectionOnly in the selected server's modsecurity.conf.

Changing the mode saves it on that server only and does not restart or reload the service. Set the intended mode on each node, then use the apply workflow. Rule synchronization does not copy this mode setting.

Rule paths use the current group's haproxy_dir or nginx_dir, followed by waf/rules. The default directories are /etc/haproxy/waf/rules/ and /etc/nginx/waf/rules/; custom service directories are supported.

Configuring WAF for HAProxy

The HAProxy WAF agent requires a restart rather than a reload. Installation also checks the complete active HAProxy configuration. For Docker, verify persistent WAF mounts and the configured startup paths when diagnostics report a preparation error.

Roxy-WI 9.1: HAProxy WAF overview
Roxy-WI 9.1 reference: HAProxy WAF overview. The 9.2 controls are described in this guide.

HAProxy rule catalog and manual editing

Open Manage rules. The Enabled checkbox changes the saved Include state. Under Actions, use View/Edit for a manual rule, WAF Config Wizard for a generated rule, or Delete to remove a rule. These changes require confirmed application.

To create a text rule, choose Add → Manual rule editor, supply a name, description and a filename such as custom-rule.conf, then edit its content. Use a filename without directory separators. Creation, toggling and deletion also affect the Master's linked Slaves; see synchronization and recovery.

Roxy-WI 9.1: HAProxy WAF rule list
Roxy-WI 9.1 reference: HAProxy WAF rule list. The 9.2 controls are described in this guide.

Configuring WAF for NGINX

NGINX WAF runs inside NGINX, so applying rules reloads NGINX rather than restarting a separate WAF agent. Failed validation restores the previous edited file; failed reload triggers a recovery attempt. Read any recovery error before trying another change.

For virtual-host scoping and paths, see the NGINX WAF reference.

Roxy-WI 9.1: NGINX WAF overview
Roxy-WI 9.1 reference: NGINX WAF overview. The 9.2 controls are described in this guide.

NGINX rule catalog

Use Manage rules on the NGINX card. Manual rules, generated rules, the Enabled checkbox and deletion follow the same catalog workflow as HAProxy, with Reload NGINX as the apply action. Includes are managed through nginx_dir/waf/waf.conf.

Do not create duplicate rules manually on Slaves. Roxy-WI creates the matching catalog entries during synchronization. Review the target named in a conflict or failure message.

Roxy-WI 9.1: NGINX WAF rule list
Roxy-WI 9.1 reference: NGINX WAF rule list. The 9.2 controls are described in this guide.

WAF Config Wizard

WAF Config Wizard requires an active Enterprise plan or higher. See plans and availability. It creates rules and CRS exclusions for both HAProxy and NGINX.

Generated files contain wizard metadata and must be edited through the wizard. Manual rules retain the text editor. If a generated file's metadata was changed or lost, restore the generated file before editing it. An existing generated rule's name, filename and description identify it and remain read-only.

Save and confirm application

Saving a file, changing its Enabled state or choosing a mode does not by itself confirm that the running service uses it. Apply the saved configuration with Restart WAF for HAProxy or Reload NGINX for NGINX. These are the service-specific labels shown by the 9.2 interface.

StateMeaning
Apply status unknownNo confirmed apply is recorded, or a linked target cannot be evaluated. Inspect configuration and diagnostics before applying.
Changes awaiting confirmed applySaved changes or an incomplete operation still need a successful apply. A failed or unconfirmed action keeps this state.
Apply confirmedRoxy-WI confirmed application of its tracked changes. On a Master, the indicator also includes its linked Slaves.

The indicator tracks WAF actions made through Roxy-WI. It does not detect manual SSH edits or service actions performed elsewhere. A confirmed state is not an independent test of your application's protection rules.

Master–Slave synchronization and recovery

Rule operations on a Master synchronize to its directly linked Slaves in the same group. The requested service must be enabled and accessible on each target. Roxy-WI synchronizes rule files, matching catalog entries and Include state for creation, edits, enable/disable actions and deletion. It does not recursively traverse another level of Slaves.

Matching entries are created automatically; an unrelated rule or ambiguous Include with the same identity causes a conflict. Do not overwrite such a file to bypass the error. Inspect its ownership and the configuration on the named target first.

A multi-server operation can fail after some servers have changed. Roxy-WI reports the failed target and leaves changes pending; it does not promise an all-server rollback. Restore connectivity or resolve the conflict, then repeat the original operation. The apply action reconciles the saved rule catalog before applying, which also retries incomplete synchronization. Retry a failed deletion as a deletion.

When an editor apply fails, the local file/service recovery attempt can also fail. Inspect the WAF or NGINX status and the Roxy-WI logs, including any reported backup location. Confirm every target before considering recovery complete.

Diagnostics and logs

Open a server card's status details for the detected process/module state, explanation and recovery guidance. Check SSH credentials, noninteractive sudo, service/container paths and mounts when status is unavailable. For an invalid saved mode, check that modsecurity.conf has exactly one active global SecRuleEngine directive.

Use Logs and choose WAF events or WAF audit. Events show service errors and WAF messages; Audit shows complete ModSecurity transactions. See the WAF log guide for search, Live mode, rotation and reader limits.