fadcos_waf_json_validation_detection – Configuring JSON detection

New in version 1.3.0.

Synopsis

  • Configuring JSON detection

Requirements

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

  • ansible>=2.8

FortiADC Version Compatibility


v7.1.4 v7.2.2 v7.4.0
fadcos_waf_json_validation_detection yes yes yes

Parameters

  • action - Type of action to perform on the object. type: str required: true
  • name - Specify the name of the JSON Detection profile. type: str required: true
  • severity - Set the severity level in WAF logs of potential attacks detected by the JSON Detection profile. type: str required: false
  • security_action - Select the action profile that you want to apply.type: str required: false
  • exception_id - Optional. Select the exception profile that you want to apply to the JSON Detection profile.type: int required: false
  • json_format_checks - Enable to configure security checks for incoming HTTP requests to determine whether they are well-formed. type: str required: false
  • json_limit_checks - Enable to enforce parsing limits to protect web servers from attacks such as DOS attacks. If enabled, you may change the configuration for the following parameters (limit_max_array_value, limit_max_depth, limit_max_object_member, limit_max_string). type: str required: true
  • json_schema_checks - Specify the name of the type: str required: true
  • json_sql_injection_checks - Enable to examine the bodies of incoming requests for inappropriate SQL characters and keywords that might indicate an SQL injection attack.type: str required: false
  • json_xss_checks - Enable to examine the bodies of incoming JSON requests that might indicate possible cross-site scripting attacks.type: int required: false
  • limit_max_array_value - Limits the maximum number of values within a single array. The default value is 256. The valid range is 0~4096. Available only when JSON Limit Checks is enabled. type: str required: false
  • limit_max_depth - Limits the maximum depth in a JSON value. The default value is 16. The valid range is 0~4096. Available only when JSON Limit Checks is enabled.type: str required: false
  • limit_max_object_member - Limits the number of members in a JSON object. The default value is 64. The valid range is 0~4096. Available only when JSON Limit Checks is enabled.type: int required: false
  • limit_max_string - Limits the length of a string in a JSON request for a name or a value. The default value is 64. The valid range is 0~4096. Available only when JSON Limit Checks is enabled. type: str required: false
  • vdom - VDOM name if enabled.type: str required: true(if VDOM is enabled)

Examples

- name:
  hosts: all
  vars:
  connection: httpapi
  gather_facts: false
  tasks:
    - name: Add WAF json_validation_detection
      fadcos_waf_json_validation_detection:
        action: add
        name: jst1
        security_action: alert
        exception_id: n1
        json_format_checks: enable
        json_limit_checks: disable
        json_schema_checks: disable
        json_sql_injection_checks: disable
        json_xss_checks: enable
        limit_max_array_value: 256
        limit_max_depth: 16
        limit_max_object_member: 64
        limit_max_string: 64

    - name: Add WAF duplicate json_validation_detection
      fadcos_waf_json_validation_detection:
        action: add
        name: jst1
        security_action: alert
        exception_id: n1
        json_format_checks: enable
        json_limit_checks: disable
        json_schema_checks: disable

    - name: edit WAF json_validation_detection
      fadcos_waf_json_validation_detection:
        action: edit
        name: jst1
        security_action: block
        exception_id: n1
        limit_max_array_value: 200
        limit_max_depth: 32
        limit_max_object_member: 48
        severity: high

    - name: get WAF json_validation_detection
      fadcos_waf_json_validation_detection:
        action: get
        name: jst1

    - name: delete WAF json_validation_detection
      fadcos_waf_json_validation_detection:
        action: delete
        name: JS1

    - name: delete non-existant WAF json_validation_detection
      fadcos_waf_json_validation_detection:
        action: delete
        name: JS1

Return Values

Common return values are documented: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values, the following are the fields unique to this module:

  • 200 - OK: Request returns successful.
  • 400 - Bad Request: Request cannot be processed by the API.
  • 401 - Not Authorized: Request without successful login session.
  • 403 - Forbidden: Request is missing CSRF token or administrator is missing access profile permissions.
  • 404 - Resource Not Found: Unable to find the specified resource.
  • 405 - Method Not Allowed: Specified HTTP method is not allowed for this resource.
  • 413 - Request Entity Too Large: Request cannot be processed due to large entity.
  • 424 - Failed Dependency: Fail dependency can be duplicate resource, missing required parameter, missing required attribute, or invalid attribute value.
  • 429 - Access temporarily blocked: Maximum failed authentications reached. The offended source is temporarily blocked for certain amount of time.
  • 500 - Internal Server Error: Internal error when processing the request.

For errorcode please check FortiADC API errorcode at : https://fndn.fortinet.net/index.php?/fortiapi/981-fortiadc/

Status

  • This module is not guaranteed to have a backwards compatible interface.

Authors

  • Joseph Chen

Hint

If you notice any issues in this documentation, you can create a pull request to improve it.