- Custom deny rules are defined using the following elements:
ruleKey
must be a unique denomination and match ^[A-Z][A-Z0-9_]*$
, e.g., ruleKey: MY_CUSTOM_KEY_01
. threadHandlingMode
can be set to LogOnly
to avoid blocking requests when a custom deny rule matches.blockData
specify request data that are blocked by the custom deny rule. requestConditions
add conditions that must match for the custom deny rule to match. Note that requestConditions
may also be used without blockData
to block all requests meeting the specified conditions.
The following configuration example contains rules to block requests with specific referrer headers, parameter and media types:
The rule LOG_UNWANTED_JSON_DATA
uses both blockData
and requestConditions
to restrict the rule scope. See also CR Deny Rules reference documentation.
The example also uses threatHandlingMode: LogOnly
to log unwanted JSON values without actually blocking any requests.
If one of the configured rules matches a request, the ruleKey
is included in the corresponding access log message. Therefore we recommend using short, descriptive denominations for rule keys.
See also the API Reference documentation link at the end of this article.