Block Rules
The Block Rules file is a JSON object. Its keys name Block Rules, and each value is a non-empty array of non-empty terms:
With the example above, a request is blocked when it contains both password and secret, or when it contains private-key, anywhere in its Searchable Content.
Matching semantics
- A request matches a Block Rule when every term of that rule is found in the Searchable Content. A request matching no Block Rule is allowed.
- The Searchable Content is the request body, the
Title/Messageheaders, and theTitle/titleandMessage/messagequery parameters. Header names are matched case-insensitively. - Matching is case-insensitive by default: both the Searchable Content and the terms are lowercased before matching. Set
FLTR_CASE_SENSITIVE=truefor case-sensitive matching. - Nothing is matched in the URL path, only the body, headers, and query parameters listed above.
The default file location is block_rules.json in the current directory; FLTR_BLOCK_RULES_FILE points to an alternative path. Terms are trimmed when the file is loaded.
Caution
The service refuses to start if any Block Rule has no terms or contains a blank term after trimming.