oracle.oci.oci_waas_human_interaction_challenge – Manage a HumanInteractionChallenge resource in Oracle Cloud Infrastructure

Note

This plugin is part of the oracle.oci collection (version 4.14.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install oracle.oci.

To use it in a playbook, specify: oracle.oci.oci_waas_human_interaction_challenge.

New in version 2.9.0: of oracle.oci

Synopsis

  • This module allows the user to update a HumanInteractionChallenge resource in Oracle Cloud Infrastructure

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
action
string
    Choices:
  • DETECT
  • BLOCK
The action to take against requests from detected bots. If unspecified, defaults to `DETECT`.
This parameter is updatable.
action_expiration_in_seconds
integer
The number of seconds between challenges for the same IP address. If unspecified, defaults to `60`.
This parameter is updatable.
api_user
string
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
string
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
string
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
string
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_purpose
string
    Choices:
  • service_principal
The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None.
auth_type
string
    Choices:
  • api_key ←
  • instance_principal
  • instance_obo_user
  • resource_principal
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
cert_bundle
string
The full path to a CA certificate bundle to be used for SSL verification. This will override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE variable, if any, is used.
challenge_settings
dictionary
This parameter is updatable.
block_action
string
    Choices:
  • SET_RESPONSE_CODE
  • SHOW_ERROR_PAGE
  • SHOW_CAPTCHA
The method used to block requests that fail the challenge, if `action` is set to `BLOCK`. If unspecified, defaults to `SHOW_ERROR_PAGE`.
This parameter is updatable.
block_error_page_code
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 request is blocked. If unspecified, defaults to `403`.
This parameter is updatable.
block_error_page_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 request is blocked. If unspecified, defaults to `Access blocked by website owner. Please contact support.`
This parameter is updatable.
block_error_page_message
string
The message to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE`, and the request is blocked. If unspecified, defaults to `Access to the website is blocked`.
This parameter is updatable.
block_response_code
integer
The response status code to return when `action` is set to `BLOCK`, `blockAction` is set to `SET_RESPONSE_CODE` or `SHOW_ERROR_PAGE`, and the request is blocked. 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`.
This parameter is updatable.
captcha_footer
string
The text to show in the footer when showing a CAPTCHA challenge when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, default to `Enter the letters and numbers as they are shown in image above`.
This parameter is updatable.
captcha_header
string
The text to show in the header when showing a CAPTCHA challenge when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, defaults to `We have detected an increased number of attempts to access this webapp. To help us keep this webapp secure, please let us know that you are not a robot by entering the text from captcha below.`
This parameter is updatable.
captcha_submit_label
string
The text to show on the label of the CAPTCHA challenge submit button when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, defaults to `Yes, I am human`.
This parameter is updatable.
captcha_title
string
The title used when showing a CAPTCHA challenge when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, defaults to `Are you human?`
This parameter is updatable.
config_file_location
string
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
string
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
failure_threshold
integer
The number of failed requests before taking action. If unspecified, defaults to `10`.
This parameter is updatable.
failure_threshold_expiration_in_seconds
integer
The number of seconds before the failure threshold resets. If unspecified, defaults to `60`.
This parameter is updatable.
interaction_threshold
integer
The number of interactions required to pass the challenge. If unspecified, defaults to `3`.
This parameter is updatable.
is_enabled
boolean / required
    Choices:
  • no
  • yes
Enables or disables the human interaction challenge Web Application Firewall feature.
is_nat_enabled
boolean
    Choices:
  • no
  • yes
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.
This parameter is updatable.
recording_period_in_seconds
integer
The number of seconds to record the interactions from the user. If unspecified, defaults to `15`.
This parameter is updatable.
region
string
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
set_http_header
dictionary
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`.
This parameter is updatable.
name
string / required
The name of the header.
This parameter is updatable.
value
string / required
The value of the header.
This parameter is updatable.
state
string
    Choices:
  • present ←
The state of the HumanInteractionChallenge.
Use state=present to update an existing a HumanInteractionChallenge.
tenancy
string
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm
waas_policy_id
string / required
The OCID of the WAAS policy.

aliases: id
wait
boolean
    Choices:
  • no
  • yes ←
Whether to wait for create or delete operation to complete.
wait_timeout
integer
Time, in seconds, to wait when wait=yes. Defaults to 1200 for most of the services but some services might have a longer wait timeout.

Examples

- name: Update human_interaction_challenge
  oci_waas_human_interaction_challenge:
    # required
    waas_policy_id: "ocid1.waaspolicy.oc1..xxxxxxEXAMPLExxxxxx"
    is_enabled: true

    # optional
    action: DETECT
    failure_threshold: 56
    action_expiration_in_seconds: 56
    failure_threshold_expiration_in_seconds: 56
    interaction_threshold: 56
    recording_period_in_seconds: 56
    set_http_header:
      # required
      name: name_example
      value: value_example
    challenge_settings:
      # optional
      block_action: SET_RESPONSE_CODE
      block_response_code: 56
      block_error_page_message: block_error_page_message_example
      block_error_page_description: block_error_page_description_example
      block_error_page_code: block_error_page_code_example
      captcha_title: captcha_title_example
      captcha_header: captcha_header_example
      captcha_footer: captcha_footer_example
      captcha_submit_label: captcha_submit_label_example
    is_nat_enabled: true

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
human_interaction_challenge
complex
on success
Details of the HumanInteractionChallenge resource acted upon by the current operation

Sample:
{'action': 'DETECT', 'action_expiration_in_seconds': 56, 'challenge_settings': {'block_action': 'SET_RESPONSE_CODE', 'block_error_page_code': 'block_error_page_code_example', 'block_error_page_description': 'block_error_page_description_example', 'block_error_page_message': 'block_error_page_message_example', 'block_response_code': 56, 'captcha_footer': 'captcha_footer_example', 'captcha_header': 'captcha_header_example', 'captcha_submit_label': 'captcha_submit_label_example', 'captcha_title': 'captcha_title_example'}, 'failure_threshold': 56, 'failure_threshold_expiration_in_seconds': 56, 'interaction_threshold': 56, 'is_enabled': True, 'is_nat_enabled': True, 'recording_period_in_seconds': 56, 'set_http_header': {'name': 'name_example', 'value': 'value_example'}}
 
action
string
on success
The action to take against requests from detected bots. If unspecified, defaults to `DETECT`.

Sample:
DETECT
 
action_expiration_in_seconds
integer
on success
The number of seconds between challenges for the same IP address. If unspecified, defaults to `60`.

Sample:
56
 
challenge_settings
complex
on success

   
block_action
string
on success
The method used to block requests that fail the challenge, if `action` is set to `BLOCK`. If unspecified, defaults to `SHOW_ERROR_PAGE`.

Sample:
SET_RESPONSE_CODE
   
block_error_page_code
string
on success
The error code to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE` and the request is blocked. If unspecified, defaults to `403`.

Sample:
block_error_page_code_example
   
block_error_page_description
string
on success
The description text to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE`, and the request is blocked. If unspecified, defaults to `Access blocked by website owner. Please contact support.`

Sample:
block_error_page_description_example
   
block_error_page_message
string
on success
The message to show on the error page when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_ERROR_PAGE`, and the request is blocked. If unspecified, defaults to `Access to the website is blocked`.

Sample:
block_error_page_message_example
   
block_response_code
integer
on success
The response status code to return when `action` is set to `BLOCK`, `blockAction` is set to `SET_RESPONSE_CODE` or `SHOW_ERROR_PAGE`, and the request is blocked. 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`.

Sample:
56
    captcha_footer
string
on success
The text to show in the footer when showing a CAPTCHA challenge when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, default to `Enter the letters and numbers as they are shown in image above`.

Sample:
captcha_footer_example
   
captcha_header
string
on success
The text to show in the header when showing a CAPTCHA challenge when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, defaults to `We have detected an increased number of attempts to access this webapp. To help us keep this webapp secure, please let us know that you are not a robot by entering the text from captcha below.`

Sample:
captcha_header_example
   
captcha_submit_label
string
on success
The text to show on the label of the CAPTCHA challenge submit button when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, defaults to `Yes, I am human`.

Sample:
captcha_submit_label_example
   
captcha_title
string
on success
The title used when showing a CAPTCHA challenge when `action` is set to `BLOCK`, `blockAction` is set to `SHOW_CAPTCHA`, and the request is blocked. If unspecified, defaults to `Are you human?`

Sample:
captcha_title_example
 
failure_threshold
integer
on success
The number of failed requests before taking action. If unspecified, defaults to `10`.

Sample:
56
 
failure_threshold_expiration_in_seconds
integer
on success
The number of seconds before the failure threshold resets. If unspecified, defaults to `60`.

Sample:
56
 
interaction_threshold
integer
on success
The number of interactions required to pass the challenge. If unspecified, defaults to `3`.

Sample:
56
 
is_enabled
boolean
on success
Enables or disables the human interaction challenge Web Application Firewall feature.

Sample:
True
 
is_nat_enabled
boolean
on success
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.

Sample:
True
 
recording_period_in_seconds
integer
on success
The number of seconds to record the interactions from the user. If unspecified, defaults to `15`.

Sample:
56
 
set_http_header
complex
on success
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`.

   
name
string
on success
The name of the header.

Sample:
name_example
   
value
string
on success
The value of the header.

Sample:
value_example


Authors

  • Oracle (@oracle)