fortios_firewall_ssl_ssh_profile – Configure SSL/SSH protocol options in Fortinet’s FortiOS and FortiGate.

New in version 2.8.

Synopsis

  • This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify firewall feature and ssl_ssh_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.9.0

Parameters

  • access_token - Token-based authentication. Generated from GUI of Fortigate. type: str required: 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
  • state - Indicates whether to create or remove the object. This attribute was present already in previous version in a deeper level. It has been moved out to this outer level. type: str required: False choices: present, absent
  • firewall_ssl_ssh_profile - Configure SSL/SSH protocol options. type: dict
    • state - B(Deprecated) type: str required: False choices: present, absent
    • caname - CA certificate used by SSL Inspection. Source vpn.certificate.local.name. type: str
    • comment - Optional comments. type: str
    • ftps - Configure FTPS options. type: dict
      • allow_invalid_server_cert - When enabled, allows SSL sessions whose server certificate validation failed. type: str choices: enable, disable
      • client_cert_request - Action based on client certificate request failure. type: str choices: bypass, inspect, block
      • ports - Ports to use for scanning (1 - 65535). type: int
      • status - Configure protocol inspection status. type: str choices: disable, deep-inspection
      • unsupported_ssl - Action based on the SSL encryption used being unsupported. type: str choices: bypass, inspect, block
      • untrusted_cert - Allow, ignore, or block the untrusted SSL session server certificate. type: str choices: allow, block, ignore
    • https - Configure HTTPS options. type: dict
      • allow_invalid_server_cert - When enabled, allows SSL sessions whose server certificate validation failed. type: str choices: enable, disable
      • client_cert_request - Action based on client certificate request failure. type: str choices: bypass, inspect, block
      • ports - Ports to use for scanning (1 - 65535). type: int
      • status - Configure protocol inspection status. type: str choices: disable, certificate-inspection, deep-inspection
      • unsupported_ssl - Action based on the SSL encryption used being unsupported. type: str choices: bypass, inspect, block
      • untrusted_cert - Allow, ignore, or block the untrusted SSL session server certificate. type: str choices: allow, block, ignore
    • imaps - Configure IMAPS options. type: dict
      • allow_invalid_server_cert - When enabled, allows SSL sessions whose server certificate validation failed. type: str choices: enable, disable
      • client_cert_request - Action based on client certificate request failure. type: str choices: bypass, inspect, block
      • ports - Ports to use for scanning (1 - 65535). type: int
      • status - Configure protocol inspection status. type: str choices: disable, deep-inspection
      • unsupported_ssl - Action based on the SSL encryption used being unsupported. type: str choices: bypass, inspect, block
      • untrusted_cert - Allow, ignore, or block the untrusted SSL session server certificate. type: str choices: allow, block, ignore
    • mapi_over_https - Enable/disable inspection of MAPI over HTTPS. type: str choices: enable, disable
    • name - Name. type: str required: True
    • pop3s - Configure POP3S options. type: dict
      • allow_invalid_server_cert - When enabled, allows SSL sessions whose server certificate validation failed. type: str choices: enable, disable
      • client_cert_request - Action based on client certificate request failure. type: str choices: bypass, inspect, block
      • ports - Ports to use for scanning (1 - 65535). type: int
      • status - Configure protocol inspection status. type: str choices: disable, deep-inspection
      • unsupported_ssl - Action based on the SSL encryption used being unsupported. type: str choices: bypass, inspect, block
      • untrusted_cert - Allow, ignore, or block the untrusted SSL session server certificate. type: str choices: allow, block, ignore
    • rpc_over_https - Enable/disable inspection of RPC over HTTPS. type: str choices: enable, disable
    • server_cert - Certificate used by SSL Inspection to replace server certificate. Source vpn.certificate.local.name. type: str
    • server_cert_mode - Re-sign or replace the server"s certificate. type: str choices: re-sign, replace
    • smtps - Configure SMTPS options. type: dict
      • allow_invalid_server_cert - When enabled, allows SSL sessions whose server certificate validation failed. type: str choices: enable, disable
      • client_cert_request - Action based on client certificate request failure. type: str choices: bypass, inspect, block
      • ports - Ports to use for scanning (1 - 65535). type: int
      • status - Configure protocol inspection status. type: str choices: disable, deep-inspection
      • unsupported_ssl - Action based on the SSL encryption used being unsupported. type: str choices: bypass, inspect, block
      • untrusted_cert - Allow, ignore, or block the untrusted SSL session server certificate. type: str choices: allow, block, ignore
    • ssh - Configure SSH options. type: dict
      • inspect_all - Level of SSL inspection. type: str choices: disable, deep-inspection
      • ports - Ports to use for scanning (1 - 65535). type: int
      • ssh_algorithm - Relative strength of encryption algorithms accepted during negotiation. type: str choices: compatible, high-encryption
      • ssh_policy_check - Enable/disable SSH policy check. type: str choices: disable, enable
      • ssh_tun_policy_check - Enable/disable SSH tunnel policy check. type: str choices: disable, enable
      • status - Configure protocol inspection status. type: str choices: disable, deep-inspection
      • unsupported_version - Action based on SSH version being unsupported. type: str choices: bypass, block
    • ssl - Configure SSL options. type: dict
      • allow_invalid_server_cert - When enabled, allows SSL sessions whose server certificate validation failed. type: str choices: enable, disable
      • client_cert_request - Action based on client certificate request failure. type: str choices: bypass, inspect, block
      • inspect_all - Level of SSL inspection. type: str choices: disable, certificate-inspection, deep-inspection
      • unsupported_ssl - Action based on the SSL encryption used being unsupported. type: str choices: bypass, inspect, block
      • untrusted_cert - Allow, ignore, or block the untrusted SSL session server certificate. type: str choices: allow, block, ignore
    • ssl_anomalies_log - Enable/disable logging SSL anomalies. type: str choices: disable, enable
    • ssl_exempt - Servers to exempt from SSL inspection. type: list
      • address - IPv4 address object. Source firewall.address.name firewall.addrgrp.name. type: str
      • address6 - IPv6 address object. Source firewall.address6.name firewall.addrgrp6.name. type: str
      • fortiguard_category - FortiGuard category ID. type: int
      • id - ID number. type: int required: True
      • regex - Exempt servers by regular expression. type: str
      • type - Type of address object (IPv4 or IPv6) or FortiGuard category. type: str choices: fortiguard-category, address, address6, wildcard-fqdn, regex
      • wildcard_fqdn - Exempt servers by wildcard FQDN. Source firewall.wildcard-fqdn.custom.name firewall.wildcard-fqdn.group.name. type: str
    • ssl_exemptions_log - Enable/disable logging SSL exemptions. type: str choices: disable, enable
    • ssl_server - SSL servers. type: list
      • ftps_client_cert_request - Action based on client certificate request failure during the FTPS handshake. type: str choices: bypass, inspect, block
      • https_client_cert_request - Action based on client certificate request failure during the HTTPS handshake. type: str choices: bypass, inspect, block
      • id - SSL server ID. type: int required: True
      • imaps_client_cert_request - Action based on client certificate request failure during the IMAPS handshake. type: str choices: bypass, inspect, block
      • ip - IPv4 address of the SSL server. type: str
      • pop3s_client_cert_request - Action based on client certificate request failure during the POP3S handshake. type: str choices: bypass, inspect, block
      • smtps_client_cert_request - Action based on client certificate request failure during the SMTPS handshake. type: str choices: bypass, inspect, block
      • ssl_other_client_cert_request - Action based on client certificate request failure during an SSL protocol handshake. type: str choices: bypass, inspect, block
    • untrusted_caname - Untrusted CA certificate used by SSL Inspection. Source vpn.certificate.local.name. type: str
    • use_ssl_server - Enable/disable the use of SSL server table for SSL offloading. type: str choices: disable, enable
    • whitelist - Enable/disable exempting servers by FortiGuard whitelist. type: str choices: enable, disable

Notes

Note

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

Examples

- hosts: fortigates
  collections:
    - fortinet.fortios
  connection: httpapi
  vars:
   vdom: "root"
   ansible_httpapi_use_ssl: yes
   ansible_httpapi_validate_certs: no
   ansible_httpapi_port: 443
  tasks:
  - name: Configure SSL/SSH protocol options.
    fortios_firewall_ssl_ssh_profile:
      vdom:  "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      firewall_ssl_ssh_profile:
        caname: "<your_own_value> (source vpn.certificate.local.name)"
        comment: "Optional comments."
        ftps:
            allow_invalid_server_cert: "enable"
            client_cert_request: "bypass"
            ports: "8"
            status: "disable"
            unsupported_ssl: "bypass"
            untrusted_cert: "allow"
        https:
            allow_invalid_server_cert: "enable"
            client_cert_request: "bypass"
            ports: "15"
            status: "disable"
            unsupported_ssl: "bypass"
            untrusted_cert: "allow"
        imaps:
            allow_invalid_server_cert: "enable"
            client_cert_request: "bypass"
            ports: "22"
            status: "disable"
            unsupported_ssl: "bypass"
            untrusted_cert: "allow"
        mapi_over_https: "enable"
        name: "default_name_27"
        pop3s:
            allow_invalid_server_cert: "enable"
            client_cert_request: "bypass"
            ports: "31"
            status: "disable"
            unsupported_ssl: "bypass"
            untrusted_cert: "allow"
        rpc_over_https: "enable"
        server_cert: "<your_own_value> (source vpn.certificate.local.name)"
        server_cert_mode: "re-sign"
        smtps:
            allow_invalid_server_cert: "enable"
            client_cert_request: "bypass"
            ports: "41"
            status: "disable"
            unsupported_ssl: "bypass"
            untrusted_cert: "allow"
        ssh:
            inspect_all: "disable"
            ports: "47"
            ssh_algorithm: "compatible"
            ssh_policy_check: "disable"
            ssh_tun_policy_check: "disable"
            status: "disable"
            unsupported_version: "bypass"
        ssl:
            allow_invalid_server_cert: "enable"
            client_cert_request: "bypass"
            inspect_all: "disable"
            unsupported_ssl: "bypass"
            untrusted_cert: "allow"
        ssl_anomalies_log: "disable"
        ssl_exempt:
         -
            address: "<your_own_value> (source firewall.address.name firewall.addrgrp.name)"
            address6: "<your_own_value> (source firewall.address6.name firewall.addrgrp6.name)"
            fortiguard_category: "63"
            id:  "64"
            regex: "<your_own_value>"
            type: "fortiguard-category"
            wildcard_fqdn: "<your_own_value> (source firewall.wildcard-fqdn.custom.name firewall.wildcard-fqdn.group.name)"
        ssl_exemptions_log: "disable"
        ssl_server:
         -
            ftps_client_cert_request: "bypass"
            https_client_cert_request: "bypass"
            id:  "72"
            imaps_client_cert_request: "bypass"
            ip: "<your_own_value>"
            pop3s_client_cert_request: "bypass"
            smtps_client_cert_request: "bypass"
            ssl_other_client_cert_request: "bypass"
        untrusted_caname: "<your_own_value> (source vpn.certificate.local.name)"
        use_ssl_server: "disable"
        whitelist: "enable"

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.