CustomRule Class

Defines the common attributes for a custom rule that can be included in a waf policy.

Constructor

CustomRule()

Variables

Name Description
name
str

Defines the name of the custom rule. Required.

enabled_state
Union[str, <xref:"CustomRuleEnabledState">]

Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. Known values are: "Disabled" and "Enabled".

priority
int

Defines in what order this rule be evaluated in the overall list of custom rules. Required.

match_conditions
list[<xref:"MatchCondition">]

List of match conditions. Required.

action
Union[str, <xref:"ActionType">]

Describes what action to be applied when rule matches. Required. Known values are: "Allow", "Block", "Log", and "Redirect".

Attributes

action

"Allow", "Block", "Log", and "Redirect".

action: Required[str | ActionType]

enabledState

Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. Known values are: "Disabled" and "Enabled".

enabledState: str | CustomRuleEnabledState

matchConditions

List of match conditions. Required.

matchConditions: Required[list['MatchCondition']]

name

Defines the name of the custom rule. Required.

name: Required[str]

priority

Defines in what order this rule be evaluated in the overall list of custom rules. Required.

priority: Required[int]