fortios_icap_profile – Configure ICAP profiles 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 icap feature and profile 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.14

Tips

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

FortiOS Version Compatibility


Supported Version Ranges
fortios_icap_profile v6.0.0 -> latest

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
  • icap_profile - Configure ICAP profiles. type: dict more...
    • response_204 - Enable/disable allowance of 204 response from ICAP server. type: str choices: disable, enable more...
    • size_limit_204 - 204 response size limit to be saved by ICAP client in megabytes (1 - 10). type: int more...
    • chunk_encap - Enable/disable chunked encapsulation . type: str choices: disable, enable more...
    • comment - Comment. type: str more...
    • extension_feature - Enable/disable ICAP extension features. type: list choices: scan-progress more...
    • file_transfer - Configure the file transfer protocols to pass transferred files to an ICAP server as REQMOD. type: list choices: ssh, ftp more...
    • file_transfer_failure - Action to take if the ICAP server cannot be contacted when processing a file transfer. type: str choices: error, bypass more...
    • file_transfer_path - Path component of the ICAP URI that identifies the file transfer processing service. type: str more...
    • file_transfer_server - ICAP server to use for a file transfer. Source icap.server.name icap.server-group.name. type: str more...
    • icap_block_log - Enable/disable UTM log when infection found . type: str choices: disable, enable more...
    • icap_headers - Configure ICAP forwarded request headers. type: list member_path: icap_headers:id more...
      • base64_encoding - Enable/disable use of base64 encoding of HTTP content. type: str choices: disable, enable more...
      • content - HTTP header content. type: str more...
      • id - HTTP forwarded header ID. see Notes. type: int required: true more...
      • name - HTTP forwarded header name. type: str more...
    • methods - The allowed HTTP methods that will be sent to ICAP server for further processing. type: list choices: delete, get, head, options, post, put, trace, connect, other more...
    • name - ICAP profile name. type: str required: true more...
    • preview - Enable/disable preview of data to ICAP server. type: str choices: disable, enable more...
    • preview_data_length - Preview data length to be sent to ICAP server. type: int more...
    • replacemsg_group - Replacement message group. Source system.replacemsg-group.name. type: str more...
    • request - Enable/disable whether an HTTP request is passed to an ICAP server. type: str choices: disable, enable more...
    • request_failure - Action to take if the ICAP server cannot be contacted when processing an HTTP request. type: str choices: error, bypass more...
    • request_path - Path component of the ICAP URI that identifies the HTTP request processing service. type: str more...
    • request_server - ICAP server to use for an HTTP request. Source icap.server.name icap.server-group.name. type: str more...
    • respmod_default_action - Default action to ICAP response modification (respmod) processing. type: str choices: forward, bypass more...
    • respmod_forward_rules - ICAP response mode forward rules. type: list member_path: respmod_forward_rules:name more...
      • action - Action to be taken for ICAP server. type: str choices: forward, bypass more...
      • header_group - HTTP header group. type: list member_path: respmod_forward_rules:name/header_group:id more...
        • case_sensitivity - Enable/disable case sensitivity when matching header. type: str choices: disable, enable more...
        • header - HTTP header regular expression. type: str more...
        • header_name - HTTP header. type: str more...
        • id - ID. see Notes. type: int required: true more...
      • host - Address object for the host. Source firewall.address.name firewall.addrgrp.name firewall.proxy-address.name. type: str more...
      • http_resp_status_code - HTTP response status code. type: list member_path: respmod_forward_rules:name/http_resp_status_code:code more...
        • code - HTTP response status code. see Notes. type: int required: true more...
      • name - Address name. type: str required: true more...
    • response - Enable/disable whether an HTTP response is passed to an ICAP server. type: str choices: disable, enable more...
    • response_failure - Action to take if the ICAP server cannot be contacted when processing an HTTP response. type: str choices: error, bypass more...
    • response_path - Path component of the ICAP URI that identifies the HTTP response processing service. type: str more...
    • response_req_hdr - Enable/disable addition of req-hdr for ICAP response modification (respmod) processing. type: str choices: disable, enable more...
    • response_server - ICAP server to use for an HTTP response. Source icap.server.name icap.server-group.name. type: str more...
    • scan_progress_interval - Scan progress interval value. type: int more...
    • streaming_content_bypass - Enable/disable bypassing of ICAP server for streaming content. type: str choices: disable, enable more...
    • timeout - Time (in seconds) that ICAP client waits for the response from ICAP server. type: int more...

Notes

Note

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

Examples

- name: Configure ICAP profiles.
  fortinet.fortios.fortios_icap_profile:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      icap_profile:
          response_204: "disable"
          size_limit_204: "1"
          chunk_encap: "disable"
          comment: "Comment."
          extension_feature: "scan-progress"
          file_transfer: "ssh"
          file_transfer_failure: "error"
          file_transfer_path: "<your_own_value>"
          file_transfer_server: "<your_own_value> (source icap.server.name icap.server-group.name)"
          icap_block_log: "disable"
          icap_headers:
              -
                  base64_encoding: "disable"
                  content: "<your_own_value>"
                  id: "16"
                  name: "default_name_17"
          methods: "delete"
          name: "default_name_19"
          preview: "disable"
          preview_data_length: "0"
          replacemsg_group: "<your_own_value> (source system.replacemsg-group.name)"
          request: "disable"
          request_failure: "error"
          request_path: "<your_own_value>"
          request_server: "<your_own_value> (source icap.server.name icap.server-group.name)"
          respmod_default_action: "forward"
          respmod_forward_rules:
              -
                  action: "forward"
                  header_group:
                      -
                          case_sensitivity: "disable"
                          header: "<your_own_value>"
                          header_name: "<your_own_value>"
                          id: "34"
                  host: "myhostname (source firewall.address.name firewall.addrgrp.name firewall.proxy-address.name)"
                  http_resp_status_code:
                      -
                          code: "<you_own_value>"
                  name: "default_name_38"
          response: "disable"
          response_failure: "error"
          response_path: "<your_own_value>"
          response_req_hdr: "disable"
          response_server: "<your_own_value> (source icap.server.name icap.server-group.name)"
          scan_progress_interval: "10"
          streaming_content_bypass: "disable"
          timeout: "30"

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.