fortios_spamfilter_profile – Configure AntiSpam profiles in Fortinet’s FortiOS and FortiGate

From Get docs
Ansible/docs/2.8/modules/fortios spamfilter profile module


fortios_spamfilter_profile – Configure AntiSpam profiles in Fortinet’s FortiOS and FortiGate

New in version 2.8.


Synopsis

  • This module is able to configure a FortiGate or FortiOS by allowing the user to set and modify spamfilter feature and profile category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.2

Requirements

The below requirements are needed on the host that executes this module.

  • fortiosapi>=0.9.8

Parameters

Parameter Choices/Defaults Comments

host

- / required

FortiOS or FortiGate ip address.

https

boolean

  • no
  • yes

Indicates if the requests towards FortiGate must use HTTPS protocol

password

-

Default:

""

FortiOS or FortiGate password.

spamfilter_profile

-

Default:

null

Configure AntiSpam profiles.

comment

-

Comment.

external

-

  • enable
  • disable

Enable/disable external Email inspection.

flow-based

-

  • enable
  • disable

Enable/disable flow-based spam filtering.

gmail

-

Gmail.

log

-

  • enable
  • disable

Enable/disable logging.

imap

-

IMAP.

action

-

  • pass
  • tag

Action for spam email.

log

-

  • enable
  • disable

Enable/disable logging.

tag-msg

-

Subject text or header added to spam email.

tag-type

-

  • subject
  • header
  • spaminfo

Tag subject or header for spam email.

mapi

-

MAPI.

action

-

  • pass
  • discard

Action for spam email.

log

-

  • enable
  • disable

Enable/disable logging.

msn-hotmail

-

MSN Hotmail.

log

-

  • enable
  • disable

Enable/disable logging.

name

- / required

Profile name.

options

-

  • bannedword
  • spambwl
  • spamfsip
  • spamfssubmit
  • spamfschksum
  • spamfsurl
  • spamhelodns
  • spamraddrdns
  • spamrbl
  • spamhdrcheck
  • spamfsphish

Options.

pop3

-

POP3.

action

-

  • pass
  • tag

Action for spam email.

log

-

  • enable
  • disable

Enable/disable logging.

tag-msg

-

Subject text or header added to spam email.

tag-type

-

  • subject
  • header
  • spaminfo

Tag subject or header for spam email.

replacemsg-group

-

Replacement message group. Source system.replacemsg-group.name.

smtp

-

SMTP.

action

-

  • pass
  • tag
  • discard

Action for spam email.

hdrip

-

  • disable
  • enable

Enable/disable SMTP email header IP checks for spamfsip, spamrbl and spambwl filters.

local-override

-

  • disable
  • enable

Enable/disable local filter to override SMTP remote check result.

log

-

  • enable
  • disable

Enable/disable logging.

tag-msg

-

Subject text or header added to spam email.

tag-type

-

  • subject
  • header
  • spaminfo

Tag subject or header for spam email.

spam-bwl-table

-

Anti-spam black/white list table ID. Source spamfilter.bwl.id.

spam-bword-table

-

Anti-spam banned word table ID. Source spamfilter.bword.id.

spam-bword-threshold

-

Spam banned word threshold.

spam-filtering

-

  • enable
  • disable

Enable/disable spam filtering.

spam-iptrust-table

-

Anti-spam IP trust table ID. Source spamfilter.iptrust.id.

spam-log

-

  • disable
  • enable

Enable/disable spam logging for email filtering.

spam-log-fortiguard-response

-

  • disable
  • enable

Enable/disable logging FortiGuard spam response.

spam-mheader-table

-

Anti-spam MIME header table ID. Source spamfilter.mheader.id.

spam-rbl-table

-

Anti-spam DNSBL table ID. Source spamfilter.dnsbl.id.

state

-

  • present
  • absent

Indicates whether to create or remove the object

yahoo-mail

-

Yahoo! Mail.

log

-

  • enable
  • disable

Enable/disable logging.

username

- / required

FortiOS or FortiGate username.

vdom

-

Default:

"root"

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.



Notes

Note

  • Requires fortiosapi library developed by Fortinet
  • Run as a local_action in your playbook


Examples

- hosts: localhost
  vars:
   host: "192.168.122.40"
   username: "admin"
   password: ""
   vdom: "root"
  tasks:
  - name: Configure AntiSpam profiles.
    fortios_spamfilter_profile:
      host:  "{{ host }}"
      username: "{{ username }}"
      password: "{{ password }}"
      vdom:  "{{ vdom }}"
      https: "False"
      spamfilter_profile:
        state: "present"
        comment: "Comment."
        external: "enable"
        flow-based: "enable"
        gmail:
            log: "enable"
        imap:
            action: "pass"
            log: "enable"
            tag-msg: "<your_own_value>"
            tag-type: "subject"
        mapi:
            action: "pass"
            log: "enable"
        msn-hotmail:
            log: "enable"
        name: "default_name_18"
        options: "bannedword"
        pop3:
            action: "pass"
            log: "enable"
            tag-msg: "<your_own_value>"
            tag-type: "subject"
        replacemsg-group: "<your_own_value> (source system.replacemsg-group.name)"
        smtp:
            action: "pass"
            hdrip: "disable"
            local-override: "disable"
            log: "enable"
            tag-msg: "<your_own_value>"
            tag-type: "subject"
        spam-bwl-table: "33 (source spamfilter.bwl.id)"
        spam-bword-table: "34 (source spamfilter.bword.id)"
        spam-bword-threshold: "35"
        spam-filtering: "enable"
        spam-iptrust-table: "37 (source spamfilter.iptrust.id)"
        spam-log: "disable"
        spam-log-fortiguard-response: "disable"
        spam-mheader-table: "40 (source spamfilter.mheader.id)"
        spam-rbl-table: "41 (source spamfilter.dnsbl.id)"
        yahoo-mail:
            log: "enable"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description

build

string

always

Build number of the fortigate image


Sample:

1547

http_method

string

always

Last method used to provision the content into FortiGate


Sample:

PUT

http_status

string

always

Last result given by FortiGate on last operation applied


Sample:

200

mkey

string

success

Master key (id) used in the last call to FortiGate


Sample:

id

name

string

always

Name of the table used to fulfill the request


Sample:

urlfilter

path

string

always

Path of the table used to fulfill the request


Sample:

webfilter

revision

string

always

Internal revision number


Sample:

17.0.2.10658

serial

string

always

Serial number of the unit


Sample:

FGVMEVYYQT3AB5352

status

string

always

Indication of the operation's result


Sample:

success

vdom

string

always

Virtual domain used


Sample:

root

version

string

always

Version of the FortiGate


Sample:

v5.6.3




Status

Authors

  • Miguel Angel Munoz (@mamunozgonzalez)
  • Nicolas Thomas (@thomnico)

Hint

If you notice any issues in this documentation you can edit this document to improve it.


© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.8/modules/fortios_spamfilter_profile_module.html