fortios_casb_user_activity – Configure CASB user activity in Fortinet’s FortiOS and FortiGate.

New in version 2.0.0.

Synopsis

  • This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify casb feature and user_activity category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.0

Requirements

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

  • ansible>=2.15

Tips

Using member operation to add an element to an existing object.

FortiOS Version Compatibility

Supported Version Ranges: v7.4.1 -> 7.4.3

Parameters

  • access_token - Token-based authentication. Generated from GUI of Fortigate. type: str required: false
  • enable_log - Enable/Disable logging for task. type: bool required: false default: False
  • vdom - Virtual domain, among those defined previously. A vdom is a virtual instance of the FortiGate that can be configured and used as a different unit. type: str default: root
  • member_path - Member attribute path to operate on. type: str
  • member_state - Add or delete a member under specified attribute path. type: str choices: present, absent
  • state - Indicates whether to create or remove the object. type: str required: true choices: present, absent
  • casb_user_activity - Configure CASB user activity. type: dict more...
    • application - CASB SaaS application name. Source casb.saas-application.name. type: str more...
    • casb_name - CASB user activity signature name. type: str more...
    • category - CASB user activity category. type: str choices: activity-control, tenant-control, domain-control, safe-search-control, other more...
    • control_options - CASB control options. type: list member_path: control_options:name more...
      • name - CASB control option name. type: str required: true more...
      • operations - CASB control option operations. type: list member_path: control_options:name/operations:name more...
        • action - CASB operation action. type: str choices: append, prepend, replace, new, new-on-not-found, delete more...
        • case_sensitive - CASB operation search case sensitive. type: str choices: enable, disable more...
        • direction - CASB operation direction. type: str choices: request more...
        • header_name - CASB operation header name to search. type: str more...
        • name - CASB control option operation name. type: str required: true more...
        • search_key - CASB operation key to search. type: str more...
        • search_pattern - CASB operation search pattern. type: str choices: simple, substr, regexp more...
        • target - CASB operation target. type: str choices: header, path more...
        • value_from_input - Enable/disable value from user input. type: str choices: enable, disable more...
        • values - CASB operation new values. type: list member_path: control_options:name/operations:name/values:value more...
          • value - Operation value. type: str required: true more...
      • status - CASB control option status. type: str choices: enable, disable more...
    • description - CASB user activity description. type: str more...
    • match - CASB user activity match rules. type: list member_path: match:id more...
      • id - CASB user activity match rules ID. see Notes. type: int required: true more...
      • rules - CASB user activity rules. type: list member_path: match:id/rules:id more...
        • case_sensitive - CASB user activity match case sensitive. type: str choices: enable, disable more...
        • domains - CASB user activity domain list. type: list member_path: match:id/rules:id/domains:domain more...
          • domain - Domain list separated by space. type: str required: true more...
        • header_name - CASB user activity rule header name. type: str more...
        • id - CASB user activity rule ID. see Notes. type: int required: true more...
        • match_pattern - CASB user activity rule match pattern. type: str choices: simple, substr, regexp more...
        • match_value - CASB user activity rule match value. type: str more...
        • methods - CASB user activity method list. type: list member_path: match:id/rules:id/methods:method more...
          • method - User activity method. type: str required: true more...
        • negate - Enable/disable what the matching strategy must not be. type: str choices: enable, disable more...
        • type - CASB user activity rule type. type: str choices: domains, host, path, header, header-value, method more...
      • strategy - CASB user activity rules strategy. type: str choices: and, or more...
    • match_strategy - CASB user activity match strategy. type: str choices: and, or more...
    • name - CASB user activity name. type: str required: true more...
    • status - CASB user activity status. type: str choices: enable, disable more...
    • type - CASB user activity type. type: str choices: built-in, customized more...
    • uuid - Universally Unique Identifier (UUID; automatically assigned but can be manually reset). type: str more...

Notes

Note

  • Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks

Examples

- name: Configure CASB user activity.
  fortinet.fortios.fortios_casb_user_activity:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      casb_user_activity:
          application: "<your_own_value> (source casb.saas-application.name)"
          casb_name: "<your_own_value>"
          category: "activity-control"
          control_options:
              -
                  name: "default_name_7"
                  operations:
                      -
                          action: "append"
                          case_sensitive: "enable"
                          direction: "request"
                          header_name: "<your_own_value>"
                          name: "default_name_13"
                          search_key: "<your_own_value>"
                          search_pattern: "simple"
                          target: "header"
                          value_from_input: "enable"
                          values:
                              -
                                  value: "<your_own_value>"
                  status: "enable"
          description: "<your_own_value>"
          match:
              -
                  id: "23"
                  rules:
                      -
                          case_sensitive: "enable"
                          domains:
                              -
                                  domain: "<your_own_value>"
                          header_name: "<your_own_value>"
                          id: "29"
                          match_pattern: "simple"
                          match_value: "<your_own_value>"
                          methods:
                              -
                                  method: "<your_own_value>"
                          negate: "enable"
                          type: "domains"
                  strategy: "and"
          match_strategy: "and"
          name: "default_name_38"
          status: "enable"
          type: "built-in"
          uuid: "<your_own_value>"

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:

  • build - Build number of the fortigate image returned: always type: str sample: 1547
  • http_method - Last method used to provision the content into FortiGate returned: always type: str sample: PUT
  • http_status - Last result given by FortiGate on last operation applied returned: always type: str sample: 200
  • mkey - Master key (id) used in the last call to FortiGate returned: success type: str sample: id
  • name - Name of the table used to fulfill the request returned: always type: str sample: urlfilter
  • path - Path of the table used to fulfill the request returned: always type: str sample: webfilter
  • revision - Internal revision number returned: always type: str sample: 17.0.2.10658
  • serial - Serial number of the unit returned: always type: str sample: FGVMEVYYQT3AB5352
  • status - Indication of the operation's result returned: always type: str sample: success
  • vdom - Virtual domain used returned: always type: str sample: root
  • version - Version of the FortiGate returned: always type: str sample: v5.6.3

Status

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

Authors

  • Link Zheng (@chillancezen)

  • Jie Xue (@JieX19)

  • Hongbin Lu (@fgtdev-hblu)

  • Frank Shen (@frankshen01)

  • Miguel Angel Munoz (@mamunozgonzalez)

  • Nicolas Thomas (@thomnico)

Hint

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