JsChallenge

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

Bases: object

The JavaScript challenge settings. JavaScript Challenge is the function to filter abnormal or malicious bots and allow access to real clients.

Attributes

ACTION_BLOCK A constant which can be used with the action property of a JsChallenge.
ACTION_DETECT A constant which can be used with the action property of a JsChallenge.
action Gets the action of this JsChallenge.
action_expiration_in_seconds Gets the action_expiration_in_seconds of this JsChallenge.
are_redirects_challenged Gets the are_redirects_challenged of this JsChallenge.
challenge_settings Gets the challenge_settings of this JsChallenge.
criteria Gets the criteria of this JsChallenge.
failure_threshold Gets the failure_threshold of this JsChallenge.
is_enabled [Required] Gets the is_enabled of this JsChallenge.
is_nat_enabled Gets the is_nat_enabled of this JsChallenge.
set_http_header Gets the set_http_header of this JsChallenge.

Methods

__init__(**kwargs) Initializes a new JsChallenge object with values from keyword arguments.
ACTION_BLOCK = 'BLOCK'

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

ACTION_DETECT = 'DETECT'

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

__init__(**kwargs)

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

Parameters:
  • is_enabled (bool) – The value to assign to the is_enabled property of this JsChallenge.
  • action (str) – The value to assign to the action property of this JsChallenge. Allowed values for this property are: “DETECT”, “BLOCK”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • failure_threshold (int) – The value to assign to the failure_threshold property of this JsChallenge.
  • action_expiration_in_seconds (int) – The value to assign to the action_expiration_in_seconds property of this JsChallenge.
  • set_http_header (oci.waas.models.Header) – The value to assign to the set_http_header property of this JsChallenge.
  • challenge_settings (oci.waas.models.BlockChallengeSettings) – The value to assign to the challenge_settings property of this JsChallenge.
  • are_redirects_challenged (bool) – The value to assign to the are_redirects_challenged property of this JsChallenge.
  • criteria (list[oci.waas.models.AccessRuleCriteria]) – The value to assign to the criteria property of this JsChallenge.
  • is_nat_enabled (bool) – The value to assign to the is_nat_enabled property of this JsChallenge.
action

Gets the action of this JsChallenge. The action to take against requests from detected bots. If unspecified, defaults to DETECT.

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

Returns:The action of this JsChallenge.
Return type:str
action_expiration_in_seconds

Gets the action_expiration_in_seconds of this JsChallenge. The number of seconds between challenges from the same IP address. If unspecified, defaults to 60.

Returns:The action_expiration_in_seconds of this JsChallenge.
Return type:int
are_redirects_challenged

Gets the are_redirects_challenged of this JsChallenge. When enabled, redirect responses from the origin will also be challenged. This will change HTTP 301/302 responses from origin to HTTP 200 with an HTML body containing JavaScript page redirection.

Returns:The are_redirects_challenged of this JsChallenge.
Return type:bool
challenge_settings

Gets the challenge_settings of this JsChallenge.

Returns:The challenge_settings of this JsChallenge.
Return type:oci.waas.models.BlockChallengeSettings
criteria

Gets the criteria of this JsChallenge. When defined, the JavaScript Challenge would be applied only for the requests that matched all the listed conditions.

Returns:The criteria of this JsChallenge.
Return type:list[oci.waas.models.AccessRuleCriteria]
failure_threshold

Gets the failure_threshold of this JsChallenge. The number of failed requests before taking action. If unspecified, defaults to 10.

Returns:The failure_threshold of this JsChallenge.
Return type:int
is_enabled

[Required] Gets the is_enabled of this JsChallenge. Enables or disables the JavaScript challenge Web Application Firewall feature.

Returns:The is_enabled of this JsChallenge.
Return type:bool
is_nat_enabled

Gets the is_nat_enabled of this JsChallenge. When enabled, the user is identified not only by the IP address but also by an unique additional hash, which prevents blocking visitors with shared IP addresses.

Returns:The is_nat_enabled of this JsChallenge.
Return type:bool
set_http_header

Gets the set_http_header of this JsChallenge. Adds an additional HTTP header to requests that fail the challenge before being passed to the origin. Only applicable when the action is set to DETECT.

Returns:The set_http_header of this JsChallenge.
Return type:oci.waas.models.Header