fortinet.fortios.fortios_authentication_setting 模块 – 在 Fortinet 的 FortiOS 和 FortiGate 中配置身份验证设置。

注意

此模块是 fortinet.fortios 集合(版本 2.3.8)的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install fortinet.fortios。您需要进一步的要求才能使用此模块,有关详细信息,请参阅要求

要在 playbook 中使用它,请指定:fortinet.fortios.fortios_authentication_setting

fortinet.fortios 2.0.0 中的新增功能

概要

  • 此模块能够通过允许用户设置和修改身份验证功能和设置类别来配置 FortiGate 或 FortiOS (FOS) 设备。示例包括所有参数和值,需要在使用前调整为数据源。已使用 FOS v6.0.0 进行测试

要求

执行此模块的主机需要以下要求。

  • ansible>=2.15

参数

参数

注释

access_token

字符串

基于令牌的身份验证。从 Fortigate 的 GUI 生成。

authentication_setting

字典

配置身份验证设置。

active_auth_scheme

字符串

活动身份验证方法(方案名称)。源 authentication.scheme.name。

auth_https

字符串

启用/禁用将 HTTP 用户身份验证重定向到 HTTPS。

选项

  • "enable"

  • "disable"

captive_portal

字符串

强制门户主机名。源 firewall.address.name。

captive_portal6

字符串

IPv6 强制门户主机名。源 firewall.address6.name。

captive_portal_ip

字符串

强制门户 IP 地址。

captive_portal_ip6

字符串

强制门户 IPv6 地址。

captive_portal_port

整数

强制门户端口号 (1 - 65535)。

captive_portal_ssl_port

整数

强制门户 SSL 端口号 (1 - 65535)。

captive_portal_type

字符串

强制门户类型。

选项

  • "fqdn"

  • "ip"

cert_auth

字符串

启用/禁用将证书身份验证重定向到 HTTPS 门户。

选项

  • "enable"

  • "disable"

cert_captive_portal

字符串

证书强制门户主机名。源 firewall.address.name。

cert_captive_portal_ip

字符串

证书强制门户 IP 地址。

cert_captive_portal_port

整数

证书强制门户端口号 (1 - 65535)。

整数

持久 Web 门户 Cookie 的最大存活时间(以分钟为单位)(30 - 10080(1 周))。

整数

持久 Web 门户 Cookie 的刷新率分隔符。刷新值 = cookie-max-age/cookie-refresh-div。

dev_range

列表 / elements=字典

基于 IP 的设备查询的地址范围。

name

字符串 / 必需

地址名称。源 firewall.address.name firewall.addrgrp.name。

字符串

启用/禁用基于 IP 的 Web 门户身份验证上的持久 Cookie。

选项

  • "enable"

  • "disable"

字符串

启用/禁用 Web 门户身份验证上的持久 Cookie。

选项

  • "enable"

  • "disable"

sso_auth_scheme

字符串

单点登录身份验证方法(方案名称)。源 authentication.scheme.name。

update_time

字符串

上次更新的时间。

user_cert_ca

列表 / elements=字典

用于客户端证书验证的 CA 证书。

name

字符串 / 必需

CA 证书列表。源 vpn.certificate.ca.name vpn.certificate.local.name。

enable_log

布尔值

启用/禁用任务日志记录。

选项

  • false ←(默认)

  • true

member_path

字符串

要操作的成员属性路径。

如果存在多个属性,则以斜杠字符分隔。

标记有 member_path 的参数对于执行成员操作是合法的。

member_state

字符串

在指定的属性路径下添加或删除成员。

指定 member_state 时,将忽略 state 选项。

选项

  • "present"

  • "absent"

vdom

字符串

虚拟域,在之前定义的域中。vdom 是 FortiGate 的虚拟实例,可以配置并用作不同的单元。

默认值: "root"

注意

注意

  • 旧版 fortiosapi 已弃用,httpapi 是运行 playbook 的首选方式

示例

- name: Configure authentication setting.
  fortinet.fortios.fortios_authentication_setting:
      vdom: "{{ vdom }}"
      authentication_setting:
          active_auth_scheme: "<your_own_value> (source authentication.scheme.name)"
          auth_https: "enable"
          captive_portal: "<your_own_value> (source firewall.address.name)"
          captive_portal_ip: "<your_own_value>"
          captive_portal_ip6: "<your_own_value>"
          captive_portal_port: "7830"
          captive_portal_ssl_port: "7831"
          captive_portal_type: "fqdn"
          captive_portal6: "<your_own_value> (source firewall.address6.name)"
          cert_auth: "enable"
          cert_captive_portal: "<your_own_value> (source firewall.address.name)"
          cert_captive_portal_ip: "<your_own_value>"
          cert_captive_portal_port: "7832"
          cookie_max_age: "480"
          cookie_refresh_div: "2"
          dev_range:
              -
                  name: "default_name_19 (source firewall.address.name firewall.addrgrp.name)"
          ip_auth_cookie: "enable"
          persistent_cookie: "enable"
          sso_auth_scheme: "<your_own_value> (source authentication.scheme.name)"
          update_time: "<your_own_value>"
          user_cert_ca:
              -
                  name: "default_name_25 (source vpn.certificate.ca.name vpn.certificate.local.name)"

返回值

常见的返回值记录在此处,以下是此模块特有的字段

描述

build

字符串

fortigate 映像的内部版本号

返回:始终

示例: "1547"

http_method

字符串

上次用于将内容配置到 FortiGate 的方法

返回:始终

示例: "PUT"

http_status

字符串

FortiGate 在上次应用的操作中给出的最新结果

返回:始终

示例: "200"

mkey

字符串

上次调用 FortiGate 时使用的主键(ID)

返回:成功

示例: "id"

name

字符串

用于满足请求的表名称

返回:始终

示例: "urlfilter"

path

字符串

用于满足请求的表的路径

返回:始终

示例: "webfilter"

revision

字符串

内部修订号

返回:始终

示例: "17.0.2.10658"

serial

字符串

设备的序列号

返回:始终

示例: "FGVMEVYYQT3AB5352"

status

字符串

指示操作结果

返回:始终

示例: "success"

vdom

字符串

使用的虚拟域

返回:始终

示例: "root"

version

字符串

FortiGate 的版本

返回:始终

示例: "v5.6.3"

作者

  • Link Zheng (@chillancezen)

  • Jie Xue (@JieX19)

  • 陆宏斌 (@fgtdev-hblu)

  • 沈飞 (@frankshen01)

  • 米格尔·安赫尔·穆尼奥斯 (@mamunozgonzalez)

  • 尼古拉斯·托马斯 (@thomnico)