Show / Hide Table of Contents

Class AccessRule

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

Inheritance
object
AccessRule
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Oci.WaasService.Models
Assembly: OCI.DotNetSDK.Waas.dll
Syntax
public class AccessRule

Properties

Action

Declaration
[Required(ErrorMessage = "Action is required.")]
[JsonProperty(PropertyName = "action")]
[JsonConverter(typeof(ResponseEnumConverter))]
public AccessRule.ActionEnum? Action { get; set; }
Property Value
Type Description
AccessRule.ActionEnum?

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. These fields are required when REDIRECT is selected: redirectUrl, redirectResponseCode.
  • SHOW_CAPTCHA: Show a CAPTCHA Challenge page instead of the requested page.
    Regardless of action, no further rules are processed once a rule is matched.
Remarks

Required

BlockAction

Declaration
[JsonProperty(PropertyName = "blockAction")]
[JsonConverter(typeof(ResponseEnumConverter))]
public AccessRule.BlockActionEnum? BlockAction { get; set; }
Property Value
Type Description
AccessRule.BlockActionEnum?

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.

BlockErrorPageCode

Declaration
[JsonProperty(PropertyName = "blockErrorPageCode")]
public string BlockErrorPageCode { get; set; }
Property Value
Type Description
string

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'.

BlockErrorPageDescription

Declaration
[JsonProperty(PropertyName = "blockErrorPageDescription")]
public string BlockErrorPageDescription { get; set; }
Property Value
Type Description
string

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.'

BlockErrorPageMessage

Declaration
[JsonProperty(PropertyName = "blockErrorPageMessage")]
public string BlockErrorPageMessage { get; set; }
Property Value
Type Description
string

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.'

BlockResponseCode

Declaration
[JsonProperty(PropertyName = "blockResponseCode")]
public int? BlockResponseCode { get; set; }
Property Value
Type Description
int?

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. The list of available response codes: 200, 201, 202, 204, 206, 300, 301, 302, 303, 304, 307, 400, 401, 403, 404, 405, 408, 409, 411, 412, 413, 414, 415, 416, 422, 444, 494, 495, 496, 497, 499, 500, 501, 502, 503, 504, 507.

BypassChallenges

Declaration
[JsonProperty(PropertyName = "bypassChallenges", ItemConverterType = typeof(ResponseEnumConverter))]
public List<AccessRule.BypassChallengesEnum> BypassChallenges { get; set; }
Property Value
Type Description
List<AccessRule.BypassChallengesEnum>

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.

CaptchaFooter

Declaration
[JsonProperty(PropertyName = "captchaFooter")]
public string CaptchaFooter { get; set; }
Property Value
Type Description
string

The text to show in the footer when showing a CAPTCHA challenge when action is set to SHOW_CAPTCHA and the request is challenged.

CaptchaHeader

Declaration
[JsonProperty(PropertyName = "captchaHeader")]
public string CaptchaHeader { get; set; }
Property Value
Type Description
string

The text to show in the header when showing a CAPTCHA challenge when action is set to SHOW_CAPTCHA and the request is challenged.

CaptchaSubmitLabel

Declaration
[JsonProperty(PropertyName = "captchaSubmitLabel")]
public string CaptchaSubmitLabel { get; set; }
Property Value
Type Description
string

The text to show on the label of the CAPTCHA challenge submit button when action is set to SHOW_CAPTCHA and the request is challenged.

CaptchaTitle

Declaration
[JsonProperty(PropertyName = "captchaTitle")]
public string CaptchaTitle { get; set; }
Property Value
Type Description
string

The title used when showing a CAPTCHA challenge when action is set to SHOW_CAPTCHA and the request is challenged.

Criteria

Declaration
[Required(ErrorMessage = "Criteria is required.")]
[JsonProperty(PropertyName = "criteria")]
public List<AccessRuleCriteria> Criteria { get; set; }
Property Value
Type Description
List<AccessRuleCriteria>

The list of access rule criteria. The rule would be applied only for the requests that matched all the listed conditions.

Remarks

Required

Name

Declaration
[Required(ErrorMessage = "Name is required.")]
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
Property Value
Type Description
string

The unique name of the access rule.

Remarks

Required

RedirectResponseCode

Declaration
[JsonProperty(PropertyName = "redirectResponseCode")]
[JsonConverter(typeof(ResponseEnumConverter))]
public AccessRule.RedirectResponseCodeEnum? RedirectResponseCode { get; set; }
Property Value
Type Description
AccessRule.RedirectResponseCodeEnum?

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).

RedirectUrl

Declaration
[JsonProperty(PropertyName = "redirectUrl")]
public string RedirectUrl { get; set; }
Property Value
Type Description
string

The target to which the request should be redirected, represented as a URI reference. Required when action is REDIRECT.

ResponseHeaderManipulation

Declaration
[JsonProperty(PropertyName = "responseHeaderManipulation")]
public List<HeaderManipulationAction> ResponseHeaderManipulation { get; set; }
Property Value
Type Description
List<HeaderManipulationAction>

An object that represents an action to apply to an HTTP response headers if all rule criteria will be matched regardless of action value.

In this article
Back to top