ProtectionRule

class oci.waas.models.ProtectionRule(**kwargs)

Bases: object

The protection rule settings. Protection rules can allow, block, or trigger an alert if a request meets the parameters of an applied rule.

Attributes:

ACTION_BLOCK

A constant which can be used with the action property of a ProtectionRule.

ACTION_DETECT

A constant which can be used with the action property of a ProtectionRule.

ACTION_OFF

A constant which can be used with the action property of a ProtectionRule.

action

Gets the action of this ProtectionRule.

description

Gets the description of this ProtectionRule.

exclusions

Gets the exclusions of this ProtectionRule.

key

Gets the key of this ProtectionRule.

labels

Gets the labels of this ProtectionRule.

mod_security_rule_ids

Gets the mod_security_rule_ids of this ProtectionRule.

name

Gets the name of this ProtectionRule.

Methods:

__init__(**kwargs)

Initializes a new ProtectionRule object with values from keyword arguments.

ACTION_BLOCK = 'BLOCK'

A constant which can be used with the action property of a ProtectionRule. This constant has a value of “BLOCK”

ACTION_DETECT = 'DETECT'

A constant which can be used with the action property of a ProtectionRule. This constant has a value of “DETECT”

ACTION_OFF = 'OFF'

A constant which can be used with the action property of a ProtectionRule. This constant has a value of “OFF”

__init__(**kwargs)

Initializes a new ProtectionRule object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters
  • key (str) – The value to assign to the key property of this ProtectionRule.

  • mod_security_rule_ids (list[str]) – The value to assign to the mod_security_rule_ids property of this ProtectionRule.

  • name (str) – The value to assign to the name property of this ProtectionRule.

  • description (str) – The value to assign to the description property of this ProtectionRule.

  • action (str) – The value to assign to the action property of this ProtectionRule. Allowed values for this property are: “OFF”, “DETECT”, “BLOCK”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

  • labels (list[str]) – The value to assign to the labels property of this ProtectionRule.

  • exclusions (list[oci.waas.models.ProtectionRuleExclusion]) – The value to assign to the exclusions property of this ProtectionRule.

property action

Gets the action of this ProtectionRule. The action to take when the traffic is detected as malicious. If unspecified, defaults to OFF.

Allowed values for this property are: “OFF”, “DETECT”, “BLOCK”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The action of this ProtectionRule.

Return type

str

property description

Gets the description of this ProtectionRule. The description of the protection rule.

Returns

The description of this ProtectionRule.

Return type

str

property exclusions

Gets the exclusions of this ProtectionRule.

Returns

The exclusions of this ProtectionRule.

Return type

list[oci.waas.models.ProtectionRuleExclusion]

property key

Gets the key of this ProtectionRule. The unique key of the protection rule.

Returns

The key of this ProtectionRule.

Return type

str

property labels

Gets the labels of this ProtectionRule. The list of labels for the protection rule.

Note: Protection rules with a ResponseBody label will have no effect unless isResponseInspected is true.

Returns

The labels of this ProtectionRule.

Return type

list[str]

property mod_security_rule_ids

Gets the mod_security_rule_ids of this ProtectionRule. The list of the ModSecurity rule IDs that apply to this protection rule. For more information about ModSecurity’s open source WAF rules, see Mod Security’s documentation.

Returns

The mod_security_rule_ids of this ProtectionRule.

Return type

list[str]

property name

Gets the name of this ProtectionRule. The name of the protection rule.

Returns

The name of this ProtectionRule.

Return type

str