Application WAF Whitelist
Directory Structure
|-- waf_whitelist/
|-- waf_whitelist.yaml
|-- ...
The YAML files can contain one or more application WAF whitelist configurations.
Configuration Description
Each WAF whitelist configuration is an object containing the following parameters:
Parameter Name | Data Type | Required | Description |
---|---|---|---|
conditions | array | Yes | List of conditions to trigger the whitelist |
rules | array | Yes | List of WAF rules to ignore |
conditions Configuration
Refer to Page Rules - Conditions
rules Configuration
Parameter Name | Data Type | Required | Description |
---|---|---|---|
rule_set_name | string | Yes | Name of the WAF rule set |
rule_names | array | No | List of specific rule names to ignore |
Configuration Example
- conditions:
- var: uri
op: eq
val: /hello
rules:
- rule_set_name: scanner_detection
rule_names:
- '913100'
- '913110'
- rule_set_name: protocol_enforcement
This configuration defines two WAF whitelist rules, using rule set names and rule names to specify which rules to ignore.
The '913100'
and '913110'
are ModSecurity rule IDs used as rule names in OpenResty Edge, so they need to be a string type. When using custom rule sets, you can specify your own rule names.
Usage Example
Update configuration to OpenResty Edge:
edge-config https://192.168.1.1 -s -t 2051e780-1897-4ea0-92b4-2c2f0169aa94 -l waf_whitelist -i /root/oredge-configs -d test.com
Export configuration from OpenResty Edge:
edge-config -u https://192.168.1.1 -s -t 2051e780-1897-4ea0-92b4-2c2f0169aa94 -E -l waf_whitelist -d test.com
Cleanup WAF whitelist from OpenResty Edge:
edge-config -u https://192.168.1.1 -s -t 2051e780-1897-4ea0-92b4-2c2f0169aa94 -c -l waf_whitelist -d test.com
The above examples all use -l waf_whitelist
to specify that the command-line tool will operate only on configurations related to the WAF whitelist.
Notes
Each whitelist rule must include both
conditions
andrules
sections.Each condition in
conditions
must includevar
,op
, andval
(orvals
) fields.Each rule in
rules
must includerule_set_name
,rule_names
is optional.If using
rule_set_name
, ensure the name exists in the global WAF rule sets.If
rule_names
is specified, only listed rules will be ignored; otherwise, the entire rule set will be ignored.When importing configurations, the tool will first delete all existing WAF whitelists and then add new whitelist rules.
Whitelist rules are processed in reverse order of their appearance in the configuration file, i.e., the last defined rule will be processed first.
the tool will convert rule set IDs to corresponding rule set names for better readability when exporting configurations.
the tool will provide a warning message during export if the application doesn’t exist.
WAF whitelists can help reduce false positives, but overuse may compromise security, so configure with caution.
the tool automatically converts rule set names to corresponding IDs when processing configurations.