fortinet.fortimanager.fmgr_system_fortiguard 模块 – 配置 FortiGuard 服务。

注意

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

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

要安装它,请使用: ansible-galaxy collection install fortinet.fortimanager

要在 playbook 中使用它,请指定: fortinet.fortimanager.fmgr_system_fortiguard

fortinet.fortimanager 2.0.0 中的新增功能

概要

  • 此模块能够配置 FortiManager 设备。

  • 示例包括所有需要在使用前调整为数据源的参数和值。

参数

参数

注释

access_token

字符串

无需使用用户名和密码即可访问 FortiManager 的令牌。

adom

字符串 / 必需

请求 URL 中的参数 (adom)。

bypass_validation

布尔值

仅当模块模式与 FortiManager API 结构不同时设置为 True,模块将继续执行而无需验证参数。

选项

  • false ← (默认)

  • true

enable_log

布尔值

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

选项

  • false ← (默认)

  • true

forticloud_access_token

字符串

使用 forticloud API 访问令牌验证 Ansible 客户端。

proposed_method

字符串

底层 Json RPC 请求的覆盖方法。

选项

  • "update"

  • "set"

  • "add"

rc_failed

列表 / 元素=整数

将覆盖失败条件的 rc 代码列表。

rc_succeeded

列表 / 元素=整数

将覆盖成功条件的 rc 代码列表。

system_fortiguard

字典

设置的顶级参数。

antispam_cache

别名:antispam-cache

字符串

启用/禁用 FortiGuard 反垃圾邮件请求缓存。

选项

  • "disable"

  • "enable"

antispam_cache_mpercent

别名:antispam-cache-mpercent

整数

反垃圾邮件缓存允许使用的 FortiGate 内存最大百分比

antispam_cache_mpermille

别名:antispam-cache-mpermille

整数

反垃圾邮件缓存允许使用的 FortiGate 内存最大千分比

antispam_cache_ttl

别名:antispam-cache-ttl

整数

反垃圾邮件缓存条目的生存时间(秒)

antispam_expiration

别名:antispam-expiration

整数

反垃圾邮件过期时间。

antispam_force_off

别名:antispam-force-off

字符串

启用/禁用关闭 FortiGuard 反垃圾邮件服务。

选项

  • "disable"

  • "enable"

antispam_license

别名:antispam-license

整数

反垃圾邮件许可证。

antispam_timeout

别名:antispam-timeout

整数

反垃圾邮件查询超时

anycast_sdns_server_ip

别名:anycast-sdns-server-ip

字符串

FortiGuard anycast DNS 评级服务器的 IP 地址。

anycast_sdns_server_port

别名:anycast-sdns-server-port

整数

连接到 FortiGuard anycast DNS 评级服务器的端口。

auto_firmware_upgrade

别名:auto-firmware-upgrade

字符串

启用/禁用从 FortiGuard 自动进行补丁级别固件升级。

选项

  • "disable"

  • "enable"

auto_firmware_upgrade_day

别名:auto-firmware-upgrade-day

列表 / 元素=字符串

允许的日期

选项

  • "sunday"

  • "monday"

  • "tuesday"

  • "wednesday"

  • "thursday"

  • "friday"

  • "saturday"

auto_firmware_upgrade_delay

别名:auto-firmware-upgrade-delay

整数

延迟的天数

auto_firmware_upgrade_end_hour

别名:auto-firmware-upgrade-end-hour

整数

从 FortiGuard 自动进行补丁级别固件升级的指定时间窗口中的结束时间(24 小时制)

auto_firmware_upgrade_start_hour

别名:auto-firmware-upgrade-start-hour

整数

从 FortiGuard 自动进行补丁级别固件升级的指定时间窗口中的开始时间(24 小时制)

auto_join_forticloud

别名:auto-join-forticloud

字符串

自动连接并登录 FortiCloud。

选项

  • "disable"

  • "enable"

avquery_cache

别名:avquery-cache

字符串

启用/禁用 FortiGuard 防病毒缓存。

选项

  • "disable"

  • "enable"

avquery_cache_mpercent

别名:avquery-cache-mpercent

整数

防病毒缓存可以使用内存的最大百分比

avquery_cache_ttl

别名:avquery-cache-ttl

整数

防病毒缓存条目的生存时间

avquery_force_off

别名:avquery-force-off

字符串

关闭 FortiGuard 防病毒服务。

选项

  • "disable"

  • "enable"

avquery_license

别名:avquery-license

整数

FortiGuard 防病毒合同许可证检查之间的时间间隔。

avquery_timeout

别名:avquery-timeout

整数

防病毒查询超时

ddns_server_ip

别名:ddns-server-ip

字符串

FortiDDNS 服务器的 IP 地址。

ddns_server_ip6

别名:ddns-server-ip6

字符串

FortiDDNS 服务器的 IPv6 地址。

ddns_server_port

别名:ddns-server-port

整数

用于与 FortiDDNS 服务器通信的端口。

FDS_license_expiring_days

别名: FDS-license-expiring-days

整数

FortiGuard 许可证过期前生成许可证过期事件日志的天数阈值

fortiguard_anycast

别名: fortiguard-anycast

字符串

启用/禁用 FortiGuard 的 anycast 网络。

选项

  • "disable"

  • "enable"

fortiguard_anycast_source

别名: fortiguard-anycast-source

字符串

配置在 FortiGuard 的 anycast 网络中提供 FortiGuard 服务的 Fortinet 服务器。

选项

  • "fortinet"

  • "aws"

  • "debug"

gui_prompt_auto_upgrade

别名: gui-prompt-auto-upgrade

字符串

启用/禁用提示自动补丁级别固件升级建议。

选项

  • "disable"

  • "enable"

接口

字符串

指定到达服务器的出站接口。

interface_select_method

别名: interface-select-method

字符串

指定如何选择到达服务器的出站接口。

选项

  • "auto"

  • "sdwan"

  • "specify"

load_balance_servers

别名: load-balance-servers

整数

作为第一个 FortiGuard 选项轮换的服务器数量。

outbreak_prevention_cache

别名: outbreak-prevention-cache

字符串

启用/禁用 FortiGuard 病毒爆发防护缓存。

选项

  • "disable"

  • "enable"

outbreak_prevention_cache_mpercent

别名: outbreak-prevention-cache-mpercent

整数

FortiGuard 病毒爆发防护缓存可以使用内存的最大百分比

outbreak_prevention_cache_mpermille

别名: outbreak-prevention-cache-mpermille

整数

FortiGuard 病毒爆发防护缓存可以使用内存的最大千分比

outbreak_prevention_cache_ttl

别名: outbreak-prevention-cache-ttl

整数

FortiGuard 病毒爆发防护缓存条目的生存时间

outbreak_prevention_expiration

别名: outbreak-prevention-expiration

整数

爆发防护过期时间。

outbreak_prevention_force_off

别名: outbreak-prevention-force-off

字符串

关闭 FortiGuard 病毒爆发防护服务。

选项

  • "disable"

  • "enable"

outbreak_prevention_license

别名: outbreak-prevention-license

整数

爆发防护许可证。

outbreak_prevention_timeout

别名: outbreak-prevention-timeout

整数

FortiGuard 病毒爆发防护超时

persistent_connection

别名: persistent-connection

字符串

启用/禁用使用持久连接以接收来自 FortiGuard 的更新通知。

选项

  • "disable"

  • "enable"

端口

字符串

用于与 FortiGuard 服务器通信的端口。

选项

  • "53"

  • "80"

  • "8888"

  • "443"

协议

字符串

用于与 FortiGuard 服务器通信的协议。

选项

  • "udp"

  • "http"

  • "https"

proxy_password

别名: proxy-password

任意

(列表) 代理用户密码。

proxy_server_ip

别名: proxy-server-ip

字符串

代理服务器的 IP 地址。

proxy_server_port

别名: proxy-server-port

整数

用于与代理服务器通信的端口。

proxy_username

别名: proxy-username

字符串

代理用户名。

sandbox_inline_scan

别名: sandbox-inline-scan

字符串

启用/禁用 FortiCloud 沙箱在线扫描。

选项

  • "disable"

  • "enable"

sandbox_region

别名: sandbox-region

字符串

云沙箱区域。

sdns_options

别名: sdns-options

列表 / 元素=字符串

FortiGuard DNS 服务的自定义选项。

选项

  • "include-question-section"

sdns_server_ip

别名: sdns-server-ip

任意

(列表) FortiDNS 服务器的 IP 地址。

sdns_server_port

别名: sdns-server-port

整数

用于与 FortiDNS 服务器通信的端口。

service_account_id

别名: service-account-id

字符串

服务帐户 ID。

source_ip

别名: source-ip

字符串

用于与 FortiGuard 通信的源 IPv4 地址。

source_ip6

别名: source-ip6

字符串

用于与 FortiGuard 通信的源 IPv6 地址。

update_build_proxy

别名: update-build-proxy

字符串

启用/禁用代理字典重建。

选项

  • "disable"

  • "enable"

update_dldb

别名: update-dldb

字符串

启用/禁用 DLP 签名更新。

选项

  • "disable"

  • "enable"

update_extdb

别名: update-extdb

字符串

启用/禁用外部资源更新。

选项

  • "disable"

  • "enable"

update_ffdb

别名: update-ffdb

字符串

启用/禁用互联网服务数据库更新。

选项

  • "disable"

  • "enable"

update_server_location

别名: update-server-location

字符串

签名更新服务器位置。

选项

  • "any"

  • "usa"

  • "automatic"

  • "eu"

update_uwdb

别名: update-uwdb

字符串

启用/禁用允许列表更新。

选项

  • "disable"

  • "enable"

vdom

字符串

FortiGuard 服务虚拟域名称。

videofilter_expiration

别名: videofilter-expiration

整数

视频过滤过期时间。

videofilter_license

别名: videofilter-license

整数

视频过滤许可证。

webfilter_cache

别名: webfilter-cache

字符串

启用/禁用 FortiGuard 网页过滤器缓存。

选项

  • "disable"

  • "enable"

webfilter_cache_ttl

别名: webfilter-cache-ttl

整数

网页过滤器缓存条目的生存时间(秒)

webfilter_expiration

别名: webfilter-expiration

整数

网页过滤器过期时间。

webfilter_force_off

别名: webfilter-force-off

字符串

启用/禁用关闭 FortiGuard 网页过滤服务。

选项

  • "disable"

  • "enable"

webfilter_license

别名: webfilter-license

整数

网页过滤器许可证。

webfilter_timeout

别名: webfilter-timeout

整数

网页过滤器查询超时

workspace_locking_adom

字符串

在工作区模式下运行 FortiManager 时要锁定的 ADOM,值可以是全局和其他值,包括 root。

workspace_locking_timeout

整数

等待其他用户释放工作区锁的最大时间(秒)。

默认值: 300

注释

注意

  • 从 2.4.0 版本开始,所有输入参数都使用下划线命名约定 (snake_case)。请将诸如“var-name”之类的参数更改为“var_name”。旧的参数名称仍然可用,但您会收到弃用警告。您可以通过在 ansible.cfg 中设置 deprecation_warnings=False 来忽略此警告。

  • 此 FortiManager 模块支持在工作区锁定模式下运行,顶级参数 workspace_locking_adom 和 workspace_locking_timeout 有助于完成此工作。

  • 通常,当返回非零 rc 时,运行一个模块可能会失败。您还可以使用参数 rc_failed 和 rc_succeeded 来覆盖失败或成功的条件。

示例

- name: Example playbook (generated based on argument schema)
  hosts: fortimanagers
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Configure FortiGuard services.
      fortinet.fortimanager.fmgr_system_fortiguard:
        # bypass_validation: false
        workspace_locking_adom: <value in [global, custom adom including root]>
        workspace_locking_timeout: 300
        # rc_succeeded: [0, -2, -3, ...]
        # rc_failed: [-2, -3, ...]
        adom: <your own value>
        system_fortiguard:
          antispam_cache: <value in [disable, enable]>
          antispam_cache_mpercent: <integer>
          antispam_cache_ttl: <integer>
          antispam_expiration: <integer>
          antispam_force_off: <value in [disable, enable]>
          antispam_license: <integer>
          antispam_timeout: <integer>
          auto_join_forticloud: <value in [disable, enable]>
          ddns_server_ip: <string>
          ddns_server_port: <integer>
          load_balance_servers: <integer>
          outbreak_prevention_cache: <value in [disable, enable]>
          outbreak_prevention_cache_mpercent: <integer>
          outbreak_prevention_cache_ttl: <integer>
          outbreak_prevention_expiration: <integer>
          outbreak_prevention_force_off: <value in [disable, enable]>
          outbreak_prevention_license: <integer>
          outbreak_prevention_timeout: <integer>
          port: <value in [53, 80, 8888, ...]>
          sdns_server_ip: <list or string>
          sdns_server_port: <integer>
          service_account_id: <string>
          source_ip: <string>
          source_ip6: <string>
          update_server_location: <value in [any, usa, automatic, ...]>
          webfilter_cache: <value in [disable, enable]>
          webfilter_cache_ttl: <integer>
          webfilter_expiration: <integer>
          webfilter_force_off: <value in [disable, enable]>
          webfilter_license: <integer>
          webfilter_timeout: <integer>
          protocol: <value in [udp, http, https]>
          proxy_password: <list or string>
          proxy_server_ip: <string>
          proxy_server_port: <integer>
          proxy_username: <string>
          sandbox_region: <string>
          avquery_cache_ttl: <integer>
          avquery_timeout: <integer>
          avquery_cache: <value in [disable, enable]>
          avquery_cache_mpercent: <integer>
          avquery_license: <integer>
          avquery_force_off: <value in [disable, enable]>
          fortiguard_anycast: <value in [disable, enable]>
          fortiguard_anycast_source: <value in [fortinet, aws, debug]>
          interface: <string>
          interface_select_method: <value in [auto, sdwan, specify]>
          sdns_options:
            - "include-question-section"
          anycast_sdns_server_ip: <string>
          anycast_sdns_server_port: <integer>
          persistent_connection: <value in [disable, enable]>
          update_build_proxy: <value in [disable, enable]>
          update_extdb: <value in [disable, enable]>
          update_ffdb: <value in [disable, enable]>
          update_uwdb: <value in [disable, enable]>
          videofilter_expiration: <integer>
          videofilter_license: <integer>
          ddns_server_ip6: <string>
          vdom: <string>
          auto_firmware_upgrade: <value in [disable, enable]>
          auto_firmware_upgrade_day:
            - "sunday"
            - "monday"
            - "tuesday"
            - "wednesday"
            - "thursday"
            - "friday"
            - "saturday"
          auto_firmware_upgrade_end_hour: <integer>
          auto_firmware_upgrade_start_hour: <integer>
          sandbox_inline_scan: <value in [disable, enable]>
          auto_firmware_upgrade_delay: <integer>
          gui_prompt_auto_upgrade: <value in [disable, enable]>
          FDS_license_expiring_days: <integer>
          antispam_cache_mpermille: <integer>
          outbreak_prevention_cache_mpermille: <integer>
          update_dldb: <value in [disable, enable]>

返回值

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

描述

元数据

字典

请求的结果。

返回值: 始终

request_url

字符串

请求的完整 URL。

返回值: 始终

示例: "/sys/login/user"

response_code

整数

API 请求的状态。

返回值: 始终

示例: 0

response_data

列表 / 元素=字符串

API 响应。

返回值: 始终

response_message

字符串

API 响应的描述性消息。

返回值: 始终

示例: "OK."

system_information

字典

目标系统的信息。

返回值: 始终

rc

整数

请求的状态。

返回值: 始终

示例: 0

version_check_warning

列表 / 元素=字符串

如果剧本中使用的参数不受当前 FortiManager 版本支持,则会发出警告。

返回值: 复杂

作者

  • 杜欣伟 (@dux-fortinet)

  • 李星 (@lix-fortinet)

  • 薛杰 (@JieX19)

  • 郑琳 (@chillancezen)

  • 沈峰 (@fshen01)

  • 陆宏斌 (@fgtdev-hblu)