Cloudflare Rule Linter
Catch mistakes and simplify your expressions before they become firewall rules.
Rule editor
Select a phase and enter an expression to check it.
Analysis
Examples
Select an expression to load it into the editor and see the results.
- deprecated_field Check for usage of old field names and suggest the correct new values.
- duplicate_list_entries Detect duplicate values in lists.
- empty_list Check for comparisons against empty lists, which are always false.
- header_case Checks for header names that are not all lowercase.
- illogical_condition Detect illogical conditions, such as comparing the same field for equality multiple times in an AND expression, or for inequality multiple times in an OR expression.
- invalid_list_name Check for invalid managed list names and optionally invalid custom list names.
- lower_wildcard Detect unnecessary lower() calls before case-insensitive wildcard comparisons.
- negated_comparison Detect comparisons that are negated and suggest using the opposite comparison operator instead.
- operator_style Enforce a consistent operator notation (english vs C-like).
- overly_permissive_pattern Check for regex and wildcard patterns that are overly permissive.
- regex_limit Detect rules containing more than 64 regular expressions.
- regex_raw_strings Ensure regex matches use raw string literals (r"...") instead of normal quoted strings.
- regex_string_literal Detect regex syntax in strings compared with operators that do not interpret it as a regular expression.
- replace_functions_limit regex_ and wildcard_replace functions are only allowed once and not nested.
- reserved_ip_space Check for usage of reserved IP ranges that are unlikely to be useful in rules.
- substring_index_order Detect substring() calls with an end index smaller than the start index, which return an empty string.
- suspicious_regex Detect regexes that look like they should be wildcard matches or contain unescaped literal special characters.
- timestamp_comparisons Detect comparisons against http.request.timestamp.sec that use values outside of reasonable bounds.
- unnecessary_patterns Detect regex and wildcard patterns that can be simplified to eq or contains expressions.
- value_domain Check for values that are outside of the valid domain for certain fields, such as invalid HTTP methods or invalid continents.