fortios_application_list – Configure application control lists 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 application feature and list category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.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
  • application_list - Configure application control lists. type: dict
    • state - B(Deprecated) type: str required: False choices: present, absent
    • app_replacemsg - Enable/disable replacement messages for blocked applications. type: str choices: disable, enable
    • comment - comments type: str
    • deep_app_inspection - Enable/disable deep application inspection. type: str choices: disable, enable
    • entries - Application list entries. type: list
      • action - Pass or block traffic, or reset connection for traffic from this application. type: str choices: pass, block, reset
      • application - ID of allowed applications. type: list
        • id - Application IDs. type: int required: True
      • behavior - Application behavior filter. type: str
      • category - Category ID list. type: list
        • id - Application category ID. type: int required: True
      • id - Entry ID. type: int required: True
      • log - Enable/disable logging for this application list. type: str choices: disable, enable
      • log_packet - Enable/disable packet logging. type: str choices: disable, enable
      • parameters - Application parameters. type: list
        • id - Parameter ID. type: int required: True
        • value - Parameter value. type: str
      • per_ip_shaper - Per-IP traffic shaper. Source firewall.shaper.per-ip-shaper.name. type: str
      • popularity - Application popularity filter (1 - 5, from least to most popular). type: str choices: 1, 2, 3, 4, 5
      • protocols - Application protocol filter. type: str
      • quarantine - Quarantine method. type: str choices: none, attacker
      • quarantine_expiry - Duration of quarantine. (Format type: str
      • quarantine_log - Enable/disable quarantine logging. type: str choices: disable, enable
      • rate_count - Count of the rate. type: int
      • rate_duration - Duration (sec) of the rate. type: int
      • rate_mode - Rate limit mode. type: str choices: periodical, continuous
      • rate_track - Track the packet protocol field. type: str choices: none, src-ip, dest-ip, dhcp-client-mac, dns-domain
      • risk - Risk, or impact, of allowing traffic from this application to occur (1 - 5; Low, Elevated, Medium, High, and Critical). type: list
        • level - Risk, or impact, of allowing traffic from this application to occur (1 - 5; Low, Elevated, Medium, High, and Critical). type: int required: True
      • session_ttl - Session TTL (0 = default). type: int
      • shaper - Traffic shaper. Source firewall.shaper.traffic-shaper.name. type: str
      • shaper_reverse - Reverse traffic shaper. Source firewall.shaper.traffic-shaper.name. type: str
      • sub_category - Application Sub-category ID list. type: list
        • id - Application sub-category ID. type: int required: True
      • technology - Application technology filter. type: str
      • vendor - Application vendor filter. type: str
    • extended_log - Enable/disable extended logging. type: str choices: enable, disable
    • name - List name. type: str required: True
    • options - Basic application protocol signatures allowed by default. type: str choices: allow-dns, allow-icmp, allow-http, allow-ssl, allow-quic
    • other_application_action - Action for other applications. type: str choices: pass, block
    • other_application_log - Enable/disable logging for other applications. type: str choices: disable, enable
    • p2p_black_list - P2P applications to be black listed. type: str choices: skype, edonkey, bittorrent
    • replacemsg_group - Replacement message group. Source system.replacemsg-group.name. type: str
    • unknown_application_action - Pass or block traffic from unknown applications. type: str choices: pass, block
    • unknown_application_log - Enable/disable logging for unknown applications. type: str choices: disable, enable

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 application control lists.
    fortios_application_list:
      vdom:  "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      application_list:
        app_replacemsg: "disable"
        comment: "comments"
        deep_app_inspection: "disable"
        entries:
         -
            action: "pass"
            application:
             -
                id:  "9"
            behavior: "<your_own_value>"
            category:
             -
                id:  "12"
            id:  "13"
            log: "disable"
            log_packet: "disable"
            parameters:
             -
                id:  "17"
                value: "<your_own_value>"
            per_ip_shaper: "<your_own_value> (source firewall.shaper.per-ip-shaper.name)"
            popularity: "1"
            protocols: "<your_own_value>"
            quarantine: "none"
            quarantine_expiry: "<your_own_value>"
            quarantine_log: "disable"
            rate_count: "25"
            rate_duration: "26"
            rate_mode: "periodical"
            rate_track: "none"
            risk:
             -
                level: "30"
            session_ttl: "31"
            shaper: "<your_own_value> (source firewall.shaper.traffic-shaper.name)"
            shaper_reverse: "<your_own_value> (source firewall.shaper.traffic-shaper.name)"
            sub_category:
             -
                id:  "35"
            technology: "<your_own_value>"
            vendor: "<your_own_value>"
        extended_log: "enable"
        name: "default_name_39"
        options: "allow-dns"
        other_application_action: "pass"
        other_application_log: "disable"
        p2p_black_list: "skype"
        replacemsg_group: "<your_own_value> (source system.replacemsg-group.name)"
        unknown_application_action: "pass"
        unknown_application_log: "disable"

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.