AccessRule

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

Bases: object

A content access rule. An access rule specifies an action to take if a set of criteria is matched by a request.

ACTION_ALLOW = 'ALLOW'

A constant which can be used with the action property of a AccessRule. This constant has a value of "ALLOW"

ACTION_BLOCK = 'BLOCK'

A constant which can be used with the action property of a AccessRule. This constant has a value of "BLOCK"

ACTION_BYPASS = 'BYPASS'

A constant which can be used with the action property of a AccessRule. This constant has a value of "BYPASS"

ACTION_DETECT = 'DETECT'

A constant which can be used with the action property of a AccessRule. This constant has a value of "DETECT"

ACTION_REDIRECT = 'REDIRECT'

A constant which can be used with the action property of a AccessRule. This constant has a value of "REDIRECT"

BLOCK_ACTION_SET_RESPONSE_CODE = 'SET_RESPONSE_CODE'

A constant which can be used with the block_action property of a AccessRule. This constant has a value of "SET_RESPONSE_CODE"

BLOCK_ACTION_SHOW_ERROR_PAGE = 'SHOW_ERROR_PAGE'

A constant which can be used with the block_action property of a AccessRule. This constant has a value of "SHOW_ERROR_PAGE"

BYPASS_CHALLENGES_CAPTCHA = 'CAPTCHA'

A constant which can be used with the bypass_challenges property of a AccessRule. This constant has a value of "CAPTCHA"

BYPASS_CHALLENGES_DEVICE_FINGERPRINT_CHALLENGE = 'DEVICE_FINGERPRINT_CHALLENGE'

A constant which can be used with the bypass_challenges property of a AccessRule. This constant has a value of "DEVICE_FINGERPRINT_CHALLENGE"

BYPASS_CHALLENGES_HUMAN_INTERACTION_CHALLENGE = 'HUMAN_INTERACTION_CHALLENGE'

A constant which can be used with the bypass_challenges property of a AccessRule. This constant has a value of "HUMAN_INTERACTION_CHALLENGE"

BYPASS_CHALLENGES_JS_CHALLENGE = 'JS_CHALLENGE'

A constant which can be used with the bypass_challenges property of a AccessRule. This constant has a value of "JS_CHALLENGE"

REDIRECT_RESPONSE_CODE_FOUND = 'FOUND'

A constant which can be used with the redirect_response_code property of a AccessRule. This constant has a value of "FOUND"

REDIRECT_RESPONSE_CODE_MOVED_PERMANENTLY = 'MOVED_PERMANENTLY'

A constant which can be used with the redirect_response_code property of a AccessRule. This constant has a value of "MOVED_PERMANENTLY"

__init__(**kwargs)

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

Parameters:
  • name (str) -- The value to assign to the name property of this AccessRule.
  • criteria (list[AccessRuleCriteria]) -- The value to assign to the criteria property of this AccessRule.
  • action (str) -- The value to assign to the action property of this AccessRule. Allowed values for this property are: "ALLOW", "DETECT", "BLOCK", "BYPASS", "REDIRECT", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
  • block_action (str) -- The value to assign to the block_action property of this AccessRule. Allowed values for this property are: "SET_RESPONSE_CODE", "SHOW_ERROR_PAGE", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
  • block_response_code (int) -- The value to assign to the block_response_code property of this AccessRule.
  • block_error_page_message (str) -- The value to assign to the block_error_page_message property of this AccessRule.
  • block_error_page_code (str) -- The value to assign to the block_error_page_code property of this AccessRule.
  • block_error_page_description (str) -- The value to assign to the block_error_page_description property of this AccessRule.
  • bypass_challenges (list[str]) -- The value to assign to the bypass_challenges property of this AccessRule. Allowed values for items in this list are: "JS_CHALLENGE", "DEVICE_FINGERPRINT_CHALLENGE", "HUMAN_INTERACTION_CHALLENGE", "CAPTCHA", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
  • redirect_url (str) -- The value to assign to the redirect_url property of this AccessRule.
  • redirect_response_code (str) -- The value to assign to the redirect_response_code property of this AccessRule. Allowed values for this property are: "MOVED_PERMANENTLY", "FOUND", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
action

[Required] Gets the action of this AccessRule. The action to take when the access criteria are met for a rule. If unspecified, defaults to ALLOW.

  • ALLOW: Takes no action, just logs the request.
  • DETECT: Takes no action, but creates an alert for the request.
  • BLOCK: Blocks the request by returning specified response code or showing error page.
  • BYPASS: Bypasses some or all challenges.
  • REDIRECT: Redirects the request to the specified URL.

Regardless of action, no further rules are processed once the rule is matched.

Allowed values for this property are: "ALLOW", "DETECT", "BLOCK", "BYPASS", "REDIRECT", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.

Returns:The action of this AccessRule.
Return type:str
block_action

Gets the block_action of this AccessRule. The method used to block requests if action is set to BLOCK and the access criteria are met. If unspecified, defaults to SET_RESPONSE_CODE.

Allowed values for this property are: "SET_RESPONSE_CODE", "SHOW_ERROR_PAGE", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.

Returns:The block_action of this AccessRule.
Return type:str
block_error_page_code

Gets the block_error_page_code of this AccessRule. The error code to show on the error page when action is set to BLOCK, blockAction is set to SHOW_ERROR_PAGE, and the access criteria are met. If unspecified, defaults to 'Access rules'.

Returns:The block_error_page_code of this AccessRule.
Return type:str
block_error_page_description

Gets the block_error_page_description of this AccessRule. The description text to show on the error page when action is set to BLOCK, blockAction is set to SHOW_ERROR_PAGE, and the access criteria are met. If unspecified, defaults to 'Access blocked by website owner. Please contact support.'

Returns:The block_error_page_description of this AccessRule.
Return type:str
block_error_page_message

Gets the block_error_page_message of this AccessRule. The message to show on the error page when action is set to BLOCK, blockAction is set to SHOW_ERROR_PAGE, and the access criteria are met. If unspecified, defaults to 'Access to the website is blocked.'

Returns:The block_error_page_message of this AccessRule.
Return type:str
block_response_code

Gets the block_response_code of this AccessRule. The response status code to return when action is set to BLOCK, blockAction is set to SET_RESPONSE_CODE, and the access criteria are met. If unspecified, defaults to 403.

Returns:The block_response_code of this AccessRule.
Return type:int
bypass_challenges

Gets the bypass_challenges of this AccessRule. The list of challenges to bypass when action is set to BYPASS. If unspecified or empty, all challenges are bypassed.

  • JS_CHALLENGE: Bypasses JavaScript Challenge.
  • DEVICE_FINGERPRINT_CHALLENGE: Bypasses Device Fingerprint Challenge.
  • HUMAN_INTERACTION_CHALLENGE: Bypasses Human Interaction Challenge.
  • CAPTCHA: Bypasses CAPTCHA Challenge.

Allowed values for items in this list are: "JS_CHALLENGE", "DEVICE_FINGERPRINT_CHALLENGE", "HUMAN_INTERACTION_CHALLENGE", "CAPTCHA", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.

Returns:The bypass_challenges of this AccessRule.
Return type:list[str]
criteria

[Required] Gets the criteria of this AccessRule. The list of access rule criteria.

Returns:The criteria of this AccessRule.
Return type:list[AccessRuleCriteria]
name

[Required] Gets the name of this AccessRule. The unique name of the access rule.

Returns:The name of this AccessRule.
Return type:str
redirect_response_code

Gets the redirect_response_code of this AccessRule. The response status code to return when action is set to REDIRECT.

  • MOVED_PERMANENTLY: Used for designating the permanent movement of a page (numerical code - 301).
  • FOUND: Used for designating the temporary movement of a page (numerical code - 302).

Allowed values for this property are: "MOVED_PERMANENTLY", "FOUND", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.

Returns:The redirect_response_code of this AccessRule.
Return type:str
redirect_url

Gets the redirect_url of this AccessRule. The target to which the request should be redirected, represented as a URI reference.

Returns:The redirect_url of this AccessRule.
Return type:str