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.4.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
    • block_blacklisted_certificates - Enable/disable blocking SSL-based botnet communication by FortiGuard certificate blacklist. type: str choices: disable, enable
    • 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
      • cert_validation_failure - Action based on certificate validation failure. type: str choices: allow, block, ignore
      • cert_validation_timeout - Action based on certificate validation timeout. type: str choices: allow, block, ignore
      • client_certificate - Action based on received client certificate. type: str choices: bypass, inspect, block
      • expired_server_cert - Action based on server certificate is expired. type: str choices: allow, block, ignore
      • ports - Ports to use for scanning (1 - 65535). type: int
      • revoked_server_cert - Action based on server certificate is revoked. type: str choices: allow, block, ignore
      • sni_server_cert_check - Check the SNI in the client hello message with the CN or SAN fields in the returned server certificate. type: str choices: enable, strict, disable
      • status - Configure protocol inspection status. type: str choices: disable, deep-inspection
      • unsupported_ssl_cipher - Action based on the SSL cipher used being unsupported. type: str choices: allow, block
      • unsupported_ssl_negotiation - Action based on the SSL negotiation used being unsupported. type: str choices: allow, block
      • untrusted_server_cert - Action based on server certificate is not issued by a trusted CA. type: str choices: allow, block, ignore
    • https - Configure HTTPS options. type: dict
      • cert_validation_failure - Action based on certificate validation failure. type: str choices: allow, block, ignore
      • cert_validation_timeout - Action based on certificate validation timeout. type: str choices: allow, block, ignore
      • client_certificate - Action based on received client certificate. type: str choices: bypass, inspect, block
      • expired_server_cert - Action based on server certificate is expired. type: str choices: allow, block, ignore
      • ports - Ports to use for scanning (1 - 65535). type: int
      • proxy_after_tcp_handshake - Proxy traffic after the TCP 3-way handshake has been established (not before). type: str choices: enable, disable
      • revoked_server_cert - Action based on server certificate is revoked. type: str choices: allow, block, ignore
      • sni_server_cert_check - Check the SNI in the client hello message with the CN or SAN fields in the returned server certificate. type: str choices: enable, strict, disable
      • status - Configure protocol inspection status. type: str choices: disable, certificate-inspection, deep-inspection
      • unsupported_ssl_cipher - Action based on the SSL cipher used being unsupported. type: str choices: allow, block
      • unsupported_ssl_negotiation - Action based on the SSL negotiation used being unsupported. type: str choices: allow, block
      • untrusted_server_cert - Action based on server certificate is not issued by a trusted CA. type: str choices: allow, block, ignore
    • imaps - Configure IMAPS options. type: dict
      • cert_validation_failure - Action based on certificate validation failure. type: str choices: allow, block, ignore
      • cert_validation_timeout - Action based on certificate validation timeout. type: str choices: allow, block, ignore
      • client_certificate - Action based on received client certificate. type: str choices: bypass, inspect, block
      • expired_server_cert - Action based on server certificate is expired. type: str choices: allow, block, ignore
      • ports - Ports to use for scanning (1 - 65535). type: int
      • proxy_after_tcp_handshake - Proxy traffic after the TCP 3-way handshake has been established (not before). type: str choices: enable, disable
      • revoked_server_cert - Action based on server certificate is revoked. type: str choices: allow, block, ignore
      • sni_server_cert_check - Check the SNI in the client hello message with the CN or SAN fields in the returned server certificate. type: str choices: enable, strict, disable
      • status - Configure protocol inspection status. type: str choices: disable, deep-inspection
      • unsupported_ssl_cipher - Action based on the SSL cipher used being unsupported. type: str choices: allow, block
      • unsupported_ssl_negotiation - Action based on the SSL negotiation used being unsupported. type: str choices: allow, block
      • untrusted_server_cert - Action based on server certificate is not issued by a trusted CA. 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
      • cert_validation_failure - Action based on certificate validation failure. type: str choices: allow, block, ignore
      • cert_validation_timeout - Action based on certificate validation timeout. type: str choices: allow, block, ignore
      • client_certificate - Action based on received client certificate. type: str choices: bypass, inspect, block
      • expired_server_cert - Action based on server certificate is expired. type: str choices: allow, block, ignore
      • ports - Ports to use for scanning (1 - 65535). type: int
      • proxy_after_tcp_handshake - Proxy traffic after the TCP 3-way handshake has been established (not before). type: str choices: enable, disable
      • revoked_server_cert - Action based on server certificate is revoked. type: str choices: allow, block, ignore
      • sni_server_cert_check - Check the SNI in the client hello message with the CN or SAN fields in the returned server certificate. type: str choices: enable, strict, disable
      • status - Configure protocol inspection status. type: str choices: disable, deep-inspection
      • unsupported_ssl_cipher - Action based on the SSL cipher used being unsupported. type: str choices: allow, block
      • unsupported_ssl_negotiation - Action based on the SSL negotiation used being unsupported. type: str choices: allow, block
      • untrusted_server_cert - Action based on server certificate is not issued by a trusted CA. 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
      • cert_validation_failure - Action based on certificate validation failure. type: str choices: allow, block, ignore
      • cert_validation_timeout - Action based on certificate validation timeout. type: str choices: allow, block, ignore
      • client_certificate - Action based on received client certificate. type: str choices: bypass, inspect, block
      • expired_server_cert - Action based on server certificate is expired. type: str choices: allow, block, ignore
      • ports - Ports to use for scanning (1 - 65535). type: int
      • proxy_after_tcp_handshake - Proxy traffic after the TCP 3-way handshake has been established (not before). type: str choices: enable, disable
      • revoked_server_cert - Action based on server certificate is revoked. type: str choices: allow, block, ignore
      • sni_server_cert_check - Check the SNI in the client hello message with the CN or SAN fields in the returned server certificate. type: str choices: enable, strict, disable
      • status - Configure protocol inspection status. type: str choices: disable, deep-inspection
      • unsupported_ssl_cipher - Action based on the SSL cipher used being unsupported. type: str choices: allow, block
      • unsupported_ssl_negotiation - Action based on the SSL negotiation used being unsupported. type: str choices: allow, block
      • untrusted_server_cert - Action based on server certificate is not issued by a trusted CA. 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
      • proxy_after_tcp_handshake - Proxy traffic after the TCP 3-way handshake has been established (not before). type: str choices: enable, disable
      • ssh_algorithm - Relative strength of encryption algorithms accepted during negotiation. type: str choices: compatible, high-encryption
      • 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
      • cert_validation_failure - Action based on certificate validation failure. type: str choices: allow, block, ignore
      • cert_validation_timeout - Action based on certificate validation timeout. type: str choices: allow, block, ignore
      • client_certificate - Action based on received client certificate. type: str choices: bypass, inspect, block
      • expired_server_cert - Action based on server certificate is expired. type: str choices: allow, block, ignore
      • inspect_all - Level of SSL inspection. type: str choices: disable, certificate-inspection, deep-inspection
      • revoked_server_cert - Action based on server certificate is revoked. type: str choices: allow, block, ignore
      • sni_server_cert_check - Check the SNI in the client hello message with the CN or SAN fields in the returned server certificate. type: str choices: enable, strict, disable
      • unsupported_ssl_cipher - Action based on the SSL cipher used being unsupported. type: str choices: allow, block
      • unsupported_ssl_negotiation - Action based on the SSL negotiation used being unsupported. type: str choices: allow, block
      • untrusted_server_cert - Action based on server certificate is not issued by a trusted CA. 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_negotiation_log - Enable/disable logging SSL negotiation. type: str choices: disable, enable
    • ssl_server - SSL server settings used for client certificate request. type: list
      • ftps_client_certificate - Action based on received client certificate during the FTPS handshake. type: str choices: bypass, inspect, block
      • https_client_certificate - Action based on received client certificate during the HTTPS handshake. type: str choices: bypass, inspect, block
      • id - SSL server ID. type: int required: True
      • imaps_client_certificate - Action based on received client certificate during the IMAPS handshake. type: str choices: bypass, inspect, block
      • ip - IPv4 address of the SSL server. type: str
      • pop3s_client_certificate - Action based on received client certificate during the POP3S handshake. type: str choices: bypass, inspect, block
      • smtps_client_certificate - Action based on received client certificate during the SMTPS handshake. type: str choices: bypass, inspect, block
      • ssl_other_client_certificate - Action based on received client certificate 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:
        block_blacklisted_certificates: "disable"
        caname: "<your_own_value> (source vpn.certificate.local.name)"
        comment: "Optional comments."
        ftps:
            cert_validation_failure: "allow"
            cert_validation_timeout: "allow"
            client_certificate: "bypass"
            expired_server_cert: "allow"
            ports: "11"
            revoked_server_cert: "allow"
            sni_server_cert_check: "enable"
            status: "disable"
            unsupported_ssl_cipher: "allow"
            unsupported_ssl_negotiation: "allow"
            untrusted_server_cert: "allow"
        https:
            cert_validation_failure: "allow"
            cert_validation_timeout: "allow"
            client_certificate: "bypass"
            expired_server_cert: "allow"
            ports: "23"
            proxy_after_tcp_handshake: "enable"
            revoked_server_cert: "allow"
            sni_server_cert_check: "enable"
            status: "disable"
            unsupported_ssl_cipher: "allow"
            unsupported_ssl_negotiation: "allow"
            untrusted_server_cert: "allow"
        imaps:
            cert_validation_failure: "allow"
            cert_validation_timeout: "allow"
            client_certificate: "bypass"
            expired_server_cert: "allow"
            ports: "36"
            proxy_after_tcp_handshake: "enable"
            revoked_server_cert: "allow"
            sni_server_cert_check: "enable"
            status: "disable"
            unsupported_ssl_cipher: "allow"
            unsupported_ssl_negotiation: "allow"
            untrusted_server_cert: "allow"
        mapi_over_https: "enable"
        name: "default_name_45"
        pop3s:
            cert_validation_failure: "allow"
            cert_validation_timeout: "allow"
            client_certificate: "bypass"
            expired_server_cert: "allow"
            ports: "51"
            proxy_after_tcp_handshake: "enable"
            revoked_server_cert: "allow"
            sni_server_cert_check: "enable"
            status: "disable"
            unsupported_ssl_cipher: "allow"
            unsupported_ssl_negotiation: "allow"
            untrusted_server_cert: "allow"
        rpc_over_https: "enable"
        server_cert: "<your_own_value> (source vpn.certificate.local.name)"
        server_cert_mode: "re-sign"
        smtps:
            cert_validation_failure: "allow"
            cert_validation_timeout: "allow"
            client_certificate: "bypass"
            expired_server_cert: "allow"
            ports: "67"
            proxy_after_tcp_handshake: "enable"
            revoked_server_cert: "allow"
            sni_server_cert_check: "enable"
            status: "disable"
            unsupported_ssl_cipher: "allow"
            unsupported_ssl_negotiation: "allow"
            untrusted_server_cert: "allow"
        ssh:
            inspect_all: "disable"
            ports: "77"
            proxy_after_tcp_handshake: "enable"
            ssh_algorithm: "compatible"
            ssh_tun_policy_check: "disable"
            status: "disable"
            unsupported_version: "bypass"
        ssl:
            cert_validation_failure: "allow"
            cert_validation_timeout: "allow"
            client_certificate: "bypass"
            expired_server_cert: "allow"
            inspect_all: "disable"
            revoked_server_cert: "allow"
            sni_server_cert_check: "enable"
            unsupported_ssl_cipher: "allow"
            unsupported_ssl_negotiation: "allow"
            untrusted_server_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: "98"
            id:  "99"
            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_negotiation_log: "disable"
        ssl_server:
         -
            ftps_client_certificate: "bypass"
            https_client_certificate: "bypass"
            id:  "108"
            imaps_client_certificate: "bypass"
            ip: "<your_own_value>"
            pop3s_client_certificate: "bypass"
            smtps_client_certificate: "bypass"
            ssl_other_client_certificate: "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.