How to disable or remove a Specific WAF Rule

This guide outline the available methods to remove specific WAF Rules, either via the Web Gui or by creating a Custom WAF Rule.

Available method of removing a Specific WAF Rule using the GUI:


You just have to remove the rule according to the Rule ID


This will the an alternative method of removing a specific Rule by ID:

A WAF rule can be disabled or “whitelisted” by creating a custom rule and assigning that rule to the appropriate WAF enabled Virtual Service.

In order to disable a rule we need to know the rule ID and the associated rule file. This information will be found in the WAF Audit Logs under System Configuration > Logging Options > Extended Log Files. The WAF Audit Log snippet below indicates that a rule has been triggered. The parts of the log message we are concerned with for the purpose of this article have been highlighted.

 [16/Jul/2015:08:09:57 --0700] [][rid#14ac570][/Login.aspx][1] Access denied with connection close (phase 1). String match "GET" at REQUEST_METHOD. [file "/tmp/waf/6/modsecurity_slr_45_iis_attacks.conf"] [line "9"] [id "2100097"] [msg "SLR: Microsoft IIS Auth Bypass / Canonicalization"] [data "GET"] [severity "CRITICAL"] [tag ""]

Access denied with connection close – indicates the action taken by the LoadMaster.

iis_attacks.conf – the rule file corresponding to the entry in the Assigned Rules under WAF Options.

2100097 – the rule ID.


Rule Format:

SecRuleRemoveById ID ID RANGE

The parts have the following meanings:

  1. ID specifies the specific rule that will be disabled
  2. ID RANGE specifies a range of rules that will be disabled, for example “9000-9010”


The steps below illustrate the rule creation and implementation using the rule ID of 2100097 and the iis_attacks rule file for example purposes:

  1. Create a file in your text editor, for example z_rule(s).conf, and add the line SecRuleRemoveById 2100097 to it.
  2. Import this file z_rule(s).conf to the LoadMaster as a Custom Rule.
  3. The z_rule(s).conf file is now available for selection under WAF Options > Available Rules in the Virtual Service settings.
  4. Select the iis_attacks file and move it back to the Available Rules section and hit the Assign Rules button.
  5. Select the z_rules rule and move it to the Assigned Rules section and hit the Assign Rules button.
  6. Select the iis_attacks configuration file and move it to the Assigned Rules section and hit the Assign Rules button.

The SecRuleRemoveById rule is now installed and the corresponding rule ID removed from the WAF rules processing engine.

The WAF engine will no longer trigger for this rule id.


Was this article helpful?

0 out of 0 found this helpful