fortinet.fortios.fortios_firewall_mms_profile 模块 – 在 Fortinet 的 FortiOS 和 FortiGate 中配置 MMS 配置文件。

注意

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

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

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

要在剧本中使用它,请指定: fortinet.fortios.fortios_firewall_mms_profile

fortinet.fortios 2.0.0 中的新增功能

概要

  • 此模块能够通过允许用户设置和修改防火墙功能和 mms_profile 类别来配置 FortiGate 或 FortiOS (FOS) 设备。示例包括所有参数,在使用前需要将值调整到数据源。已在 FOS v6.0.0 上测试。

要求

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

  • ansible>=2.15

参数

参数

注释

access_token

字符串

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

enable_log

布尔值

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

选项

  • false ← (默认)

  • true

firewall_mms_profile

字典

配置 MMS 配置文件。

avnotificationtable

整数

反病毒通知表 ID。来源 antivirus.notification.id。

bwordtable

整数

MMS 禁止词表 ID。来源 webfilter.content.id。

carrier_endpoint_prefix

字符串

启用/禁用端点值的加前缀。

选项

  • "enable"

  • "disable"

carrier_endpoint_prefix_range_max

整数

可以加前缀的端点值的最大长度 (1 - 48)。

carrier_endpoint_prefix_range_min

整数

要加前缀的最小端点长度 (1 - 48)。

carrier_endpoint_prefix_string

字符串

用于加前缀端点值的字符串。

carrierendpointbwltable

整数

运营商端点过滤器表 ID。来源 firewall.carrier-endpoint-bwl.id。

comment

字符串

注释。

dupe

列表 / 元素=字典

重复配置。

action1

列表 / 元素=字符串

达到阈值时要采取的操作。

选项

  • "block"

  • "archive"

  • "log"

  • "archive-first"

  • "alert-notif"

action2

列表 / 元素=字符串

达到阈值时要采取的操作。

选项

  • "block"

  • "archive"

  • "log"

  • "archive-first"

  • "alert-notif"

action3

列表 / 元素=字符串

达到阈值时要采取的操作。

选项

  • "block"

  • "archive"

  • "log"

  • "archive-first"

  • "alert-notif"

block_time1

整数

操作生效的持续时间 (0 - 35791 分钟)。

block_time2

整数

操作生效的持续时间 (0 - 35791 分钟)。

block_time3

整数

操作生效的持续时间 (0 - 35791 分钟)。

limit1

整数

允许的最大消息数。

limit2

整数

允许的最大消息数。

limit3

整数

允许的最大消息数。

protocol

字符串 / 必需

协议。

status1

字符串

启用/禁用 status1 检测。

选项

  • "enable"

  • "disable"

status2

字符串

启用/禁用 status2 检测。

选项

  • "enable"

  • "disable"

status3

字符串

启用/禁用 status3 检测。

选项

  • "enable"

  • "disable"

window1

整数

计数消息的窗口 (1 - 2880 分钟)。

window2

整数

计数消息的窗口 (1 - 2880 分钟)。

window3

整数

计数消息的窗口 (1 - 2880 分钟)。

extended_utm_log

字符串

启用/禁用详细的 UTM 日志消息。

flood

列表 / 元素=字典

洪泛配置。

action1

列表 / 元素=字符串

达到阈值时要采取的操作。

选项

  • "block"

  • "archive"

  • "log"

  • "archive-first"

  • "alert-notif"

action2

列表 / 元素=字符串

达到阈值时要采取的操作。

选项

  • "block"

  • "archive"

  • "log"

  • "archive-first"

  • "alert-notif"

action3

列表 / 元素=字符串

达到阈值时要采取的操作。

选项

  • "block"

  • "archive"

  • "log"

  • "archive-first"

  • "alert-notif"

block_time1

整数

操作生效的持续时间 (0 - 35791 分钟)。

block_time2

整数

操作生效的持续时间 (0 - 35791 分钟)。

block_time3

整数

操作生效的持续时间 (0 - 35791 分钟)。

limit1

整数

允许的最大消息数。

limit2

整数

允许的最大消息数。

limit3

整数

允许的最大消息数。

protocol

字符串 / 必需

协议。

status1

字符串

启用/禁用 status1 检测。

选项

  • "enable"

  • "disable"

status2

字符串

启用/禁用 status2 检测。

选项

  • "enable"

  • "disable"

status3

字符串

启用/禁用 status3 检测。

选项

  • "enable"

  • "disable"

window1

整数

计数消息的窗口 (1 - 2880 分钟)。

window2

整数

计数消息的窗口 (1 - 2880 分钟)。

window3

整数

计数消息的窗口 (1 - 2880 分钟)。

mm1

列表 / 元素=字符串

MM1 选项。

选项

  • "avmonitor"

  • "oversize"

  • "quarantine"

  • "scan"

  • "bannedword"

  • "chunkedbypass"

  • "clientcomfort"

  • "servercomfort"

  • "carrier-endpoint-bwl"

  • "remove-blocked"

  • "mms-checksum"

mm1_addr_hdr

字符串

包含用户地址的 HTTP 头字段 (对于 MM1)。

mm1_addr_source

字符串

MM1 用户地址的来源。

选项

  • "http-header"

  • "cookie"

mm1_convert_hex

字符串

启用/禁用将 MM1 的用户地址从十六进制字符串转换。

选项

  • "enable"

  • "disable"

mm1_outbreak_prevention

字符串

启用病毒爆发防护服务。

选项

  • "disabled"

  • "files"

  • "full-archive"

mm1_retr_dupe

字符串

启用/禁用 MM1 retr 的重复扫描。

选项

  • "enable"

  • "disable"

mm1_retrieve_scan

字符串

启用/禁用对 MM1 检索配置消息的扫描。

选项

  • "enable"

  • "disable"

mm1comfortamount

整数

MM1 舒适量 (0 - 4294967295)。

mm1comfortinterval

整数

MM1 舒适间隔 (0 - 4294967295)。

mm1oversizelimit

整数

要扫描的最大文件大小 (1 - 819200 kB)。

mm3

列表 / 元素=字符串

MM3 选项。

选项

  • "avmonitor"

  • "oversize"

  • "quarantine"

  • "scan"

  • "bannedword"

  • "fragmail"

  • "splice"

  • "carrier-endpoint-bwl"

  • "remove-blocked"

  • "mms-checksum"

mm3_outbreak_prevention

字符串

启用病毒爆发防护服务。

选项

  • "disabled"

  • "files"

  • "full-archive"

mm3oversizelimit

整数

要扫描的最大文件大小 (1 - 819200 kB)。

mm4

列表 / 元素=字符串

MM4 选项。

选项

  • "avmonitor"

  • "oversize"

  • "quarantine"

  • "scan"

  • "bannedword"

  • "fragmail"

  • "splice"

  • "carrier-endpoint-bwl"

  • "remove-blocked"

  • "mms-checksum"

mm4_outbreak_prevention

字符串

启用病毒爆发防护服务。

选项

  • "disabled"

  • "files"

  • "full-archive"

mm4oversizelimit

整数

要扫描的最大文件大小 (1 - 819200 kB)。

mm7

列表 / 元素=字符串

MM7 选项。

选项

  • "avmonitor"

  • "oversize"

  • "quarantine"

  • "scan"

  • "bannedword"

  • "chunkedbypass"

  • "clientcomfort"

  • "servercomfort"

  • "carrier-endpoint-bwl"

  • "remove-blocked"

  • "mms-checksum"

mm7_addr_hdr

字符串

包含用户地址的 HTTP 头字段 (对于 MM7)。

mm7_addr_source

字符串

MM7 用户地址的来源。

选项

  • "http-header"

  • "cookie"

mm7_convert_hex

字符串

启用/禁用将 MM7 的用户地址从十六进制字符串转换。

选项

  • "enable"

  • "disable"

mm7_outbreak_prevention

字符串

启用病毒爆发防护服务。

选项

  • "disabled"

  • "files"

  • "full-archive"

mm7comfortamount

整数

MM7 舒适量 (0 - 4294967295)。

mm7comfortinterval

整数

MM7 舒适间隔 (0 - 4294967295)。

mm7oversizelimit

整数

要扫描的最大文件大小 (1 - 819200 kB)。

mms_antispam_mass_log

字符串

启用/禁用 MMS 反垃圾邮件群发日志记录。

选项

  • "enable"

  • "disable"

mms_av_block_log

字符串

启用/禁用 MMS 反病毒文件阻止日志记录。

选项

  • "enable"

  • "disable"

mms_av_oversize_log

字符串

启用/禁用 MMS 反病毒超大文件阻止日志记录。

选项

  • "enable"

  • "disable"

mms_av_virus_log

字符串

启用/禁用 MMS 反病毒扫描日志记录。

选项

  • "enable"

  • "disable"

mms_carrier_endpoint_filter_log

字符串

启用/禁用MMS端点过滤器阻止的日志记录。

选项

  • "enable"

  • "disable"

mms_checksum_log

字符串

启用/禁用MMS内容校验和日志记录。

选项

  • "enable"

  • "disable"

mms_checksum_table

整数

MMS内容校验和表ID。来源antivirus.mms-checksum.id。

mms_notification_log

字符串

启用/禁用MMS通知消息的日志记录。

选项

  • "enable"

  • "disable"

mms_web_content_log

字符串

启用/禁用MMS网页内容阻止的日志记录。

选项

  • "enable"

  • "disable"

mmsbwordthreshold

整数

MMS禁用词阈值。

name

字符串 / 必需

配置文件名称。

notif_msisdn

列表 / 元素=字典

针对MSISDN的通知。

msisdn

字符串 / 必需

接收方MSISDN。

threshold

列表 / 元素=字符串

此MSISDN将收到警报的阈值。

选项

  • "flood-thresh-1"

  • "flood-thresh-2"

  • "flood-thresh-3"

  • "dupe-thresh-1"

  • "dupe-thresh-2"

  • "dupe-thresh-3"

notification

列表 / 元素=字典

通知配置。

alert_int

整数

警报通知发送间隔。

alert_int_mode

字符串

警报通知间隔模式。

选项

  • "hours"

  • "minutes"

alert_src_msisdn

字符串

指定警报消息的发送地址。

alert_status

字符串

警报通知状态。

选项

  • "enable"

  • "disable"

bword_int

整数

禁用词通知发送间隔。

bword_int_mode

字符串

禁用词通知间隔模式。

选项

  • "hours"

  • "minutes"

bword_status

字符串

禁用词通知状态。

选项

  • "enable"

  • "disable"

carrier_endpoint_bwl_int

整数

运营商端点黑/白名单通知发送间隔。

carrier_endpoint_bwl_int_mode

字符串

运营商端点黑/白名单通知间隔模式。

选项

  • "hours"

  • "minutes"

carrier_endpoint_bwl_status

字符串

运营商端点黑/白名单通知状态。

选项

  • "enable"

  • "disable"

days_allowed

列表 / 元素=字符串

允许发送通知消息的星期几。

选项

  • "sunday"

  • "monday"

  • "tuesday"

  • "wednesday"

  • "thursday"

  • "friday"

  • "saturday"

detect_server

字符串

启用/禁用自动服务器地址确定。

选项

  • "enable"

  • "disable"

dupe_int

整数

重复通知发送间隔。

dupe_int_mode

字符串

重复通知间隔模式。

选项

  • "hours"

  • "minutes"

dupe_status

字符串

重复通知状态。

选项

  • "enable"

  • "disable"

file_block_int

整数

文件阻止通知发送间隔。

file_block_int_mode

字符串

文件阻止通知间隔模式。

选项

  • "hours"

  • "minutes"

file_block_status

字符串

文件阻止通知状态。

选项

  • "enable"

  • "disable"

flood_int

整数

泛洪通知发送间隔。

flood_int_mode

字符串

泛洪通知间隔模式。

选项

  • "hours"

  • "minutes"

flood_status

字符串

泛洪通知状态。

选项

  • "enable"

  • "disable"

from_in_header

字符串

启用/禁用在HTTP标头中插入发送地址。

选项

  • "enable"

  • "disable"

mms_checksum_int

整数

MMS校验和通知发送间隔。

mms_checksum_int_mode

字符串

MMS校验和通知间隔模式。

选项

  • "hours"

  • "minutes"

mms_checksum_status

字符串

MMS校验和通知状态。

选项

  • "enable"

  • "disable"

mmsc_hostname

字符串

MMSC的主机名或IP地址。

mmsc_password

字符串

与MMSC进行身份验证所需的密码。

mmsc_port

整数

MMSC上用于发送MMS消息的端口(1-65535)。

mmsc_url

字符串

MMSC上用于发送MMS消息的URL。

mmsc_username

字符串

与MMSC进行身份验证所需的用户名。

msg_protocol

字符串

用于发送通知消息的协议。

选项

  • "mm1"

  • "mm3"

  • "mm4"

  • "mm7"

msg_type

字符串

MM7消息类型。

选项

  • "submit-req"

  • "deliver-req"

protocol

字符串 / 必需

协议。

rate_limit

整数

发送通知消息的速率限制(0-250)。

tod_window_duration

字符串

一天中的时间窗口持续时间。

tod_window_end

字符串

已过时。

tod_window_start

字符串

一天中的时间窗口开始时间。

user_domain

字符串

用户地址所属的域名。

vas_id

字符串

VAS标识符。

vasp_id

字符串

VASP标识符。

virus_int

整数

病毒通知发送间隔。

virus_int_mode

字符串

病毒通知间隔模式。

选项

  • "hours"

  • "minutes"

virus_status

字符串

病毒通知状态。

选项

  • "enable"

  • "disable"

outbreak_prevention

字典

配置病毒爆发防护设置。

external_blocklist

字符串

启用/禁用外部恶意软件黑名单。

选项

  • "disable"

  • "enable"

ftgd_service

字符串

启用/禁用FortiGuard病毒爆发防护服务。

选项

  • "disable"

  • "enable"

remove_blocked_const_length

字符串

启用/禁用MMS替换被阻止文件的固定长度。

选项

  • "enable"

  • "disable"

replacemsg_group

字符串

替换消息组。来源system.replacemsg-group.name。

member_path

字符串

要操作的成员属性路径。

如果有多个属性,则用斜杠字符分隔。

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

member_state

字符串

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

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

选项

  • "present"

  • "absent"

state

字符串 / 必需

指示是创建还是删除对象。

选项

  • "present"

  • "absent"

vdom

字符串

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

默认值: "root"

注释

注意

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

示例

- name: Configure MMS profiles.
  fortinet.fortios.fortios_firewall_mms_profile:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      firewall_mms_profile:
          avnotificationtable: "2147483647"
          bwordtable: "2147483647"
          carrier_endpoint_prefix: "enable"
          carrier_endpoint_prefix_range_max: "24"
          carrier_endpoint_prefix_range_min: "24"
          carrier_endpoint_prefix_string: "<your_own_value>"
          carrierendpointbwltable: "2147483647"
          comment: "Comment."
          dupe:
              -
                  action1: "block"
                  action2: "block"
                  action3: "block"
                  block_time1: "17895"
                  block_time2: "17895"
                  block_time3: "17895"
                  limit1: "1073741823"
                  limit2: "1073741823"
                  limit3: "1073741823"
                  protocol: "<your_own_value>"
                  status1: "enable"
                  status2: "enable"
                  status3: "enable"
                  window1: "1440"
                  window2: "1440"
                  window3: "1440"
          extended_utm_log: "<your_own_value>"
          flood:
              -
                  action1: "block"
                  action2: "block"
                  action3: "block"
                  block_time1: "17895"
                  block_time2: "17895"
                  block_time3: "17895"
                  limit1: "1073741823"
                  limit2: "1073741823"
                  limit3: "1073741823"
                  protocol: "<your_own_value>"
                  status1: "enable"
                  status2: "enable"
                  status3: "enable"
                  window1: "1440"
                  window2: "1440"
                  window3: "1440"
          mm1: "avmonitor"
          mm1_addr_hdr: "<your_own_value>"
          mm1_addr_source: "http-header"
          mm1_convert_hex: "enable"
          mm1_outbreak_prevention: "disabled"
          mm1_retr_dupe: "enable"
          mm1_retrieve_scan: "enable"
          mm1comfortamount: "2147483647"
          mm1comfortinterval: "2147483647"
          mm1oversizelimit: "409600"
          mm3: "avmonitor"
          mm3_outbreak_prevention: "disabled"
          mm3oversizelimit: "409600"
          mm4: "avmonitor"
          mm4_outbreak_prevention: "disabled"
          mm4oversizelimit: "409600"
          mm7: "avmonitor"
          mm7_addr_hdr: "<your_own_value>"
          mm7_addr_source: "http-header"
          mm7_convert_hex: "enable"
          mm7_outbreak_prevention: "disabled"
          mm7comfortamount: "2147483647"
          mm7comfortinterval: "2147483647"
          mm7oversizelimit: "409600"
          mms_antispam_mass_log: "enable"
          mms_av_block_log: "enable"
          mms_av_oversize_log: "enable"
          mms_av_virus_log: "enable"
          mms_carrier_endpoint_filter_log: "enable"
          mms_checksum_log: "enable"
          mms_checksum_table: "2147483647"
          mms_notification_log: "enable"
          mms_web_content_log: "enable"
          mmsbwordthreshold: "1073741823"
          name: "default_name_80"
          notif_msisdn:
              -
                  msisdn: "<your_own_value>"
                  threshold: "flood-thresh-1"
          notification:
              -
                  alert_int: "720"
                  alert_int_mode: "hours"
                  alert_src_msisdn: "<your_own_value>"
                  alert_status: "enable"
                  bword_int: "720"
                  bword_int_mode: "hours"
                  bword_status: "enable"
                  carrier_endpoint_bwl_int: "720"
                  carrier_endpoint_bwl_int_mode: "hours"
                  carrier_endpoint_bwl_status: "enable"
                  days_allowed: "sunday"
                  detect_server: "enable"
                  dupe_int: "720"
                  dupe_int_mode: "hours"
                  dupe_status: "enable"
                  file_block_int: "720"
                  file_block_int_mode: "hours"
                  file_block_status: "enable"
                  flood_int: "720"
                  flood_int_mode: "hours"
                  flood_status: "enable"
                  from_in_header: "enable"
                  mms_checksum_int: "720"
                  mms_checksum_int_mode: "hours"
                  mms_checksum_status: "enable"
                  mmsc_hostname: "myhostname"
                  mmsc_password: "<your_own_value>"
                  mmsc_port: "32767"
                  mmsc_url: "<your_own_value>"
                  mmsc_username: "<your_own_value>"
                  msg_protocol: "mm1"
                  msg_type: "submit-req"
                  protocol: "<your_own_value>"
                  rate_limit: "125"
                  tod_window_duration: "<your_own_value>"
                  tod_window_end: "<your_own_value>"
                  tod_window_start: "<your_own_value>"
                  user_domain: "<your_own_value>"
                  vas_id: "<your_own_value>"
                  vasp_id: "<your_own_value>"
                  virus_int: "720"
                  virus_int_mode: "hours"
                  virus_status: "enable"
          outbreak_prevention:
              external_blocklist: "disable"
              ftgd_service: "disable"
          remove_blocked_const_length: "enable"
          replacemsg_group: "<your_own_value> (source system.replacemsg-group.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"

作者

  • 郑链 (@chillancezen)

  • 薛杰 (@JieX19)

  • 陆宏斌 (@fgtdev-hblu)

  • 沈方 (@frankshen01)

  • Miguel Angel Munoz (@mamunozgonzalez)

  • Nicolas Thomas (@thomnico)