fortios_application_list – Configure application control lists in Fortinet’s FortiOS and FortiGate.

New in version 2.0.0.

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.15

Tips

Using member operation to add an element to an existing object.

FortiOS Version Compatibility

Supported Version Ranges: v6.0.0 -> 7.4.3

Parameters

  • access_token - Token-based authentication. Generated from GUI of Fortigate. type: str required: false
  • enable_log - Enable/Disable logging for task. type: bool required: false default: 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
  • member_path - Member attribute path to operate on. type: str
  • member_state - Add or delete a member under specified attribute path. type: str choices: present, absent
  • state - Indicates whether to create or remove the object. type: str required: true choices: present, absent
  • application_list - Configure application control lists. type: dict more...
    • app_replacemsg - Enable/disable replacement messages for blocked applications. type: str choices: disable, enable more...
    • comment - Comments. type: str more...
    • control_default_network_services - Enable/disable enforcement of protocols over selected ports. type: str choices: disable, enable more...
    • deep_app_inspection - Enable/disable deep application inspection. type: str choices: disable, enable more...
    • default_network_services - Default network service entries. type: list member_path: default_network_services:id more...
      • id - Entry ID. see Notes. type: int required: true more...
      • port - Port number. type: int more...
      • services - Network protocols. type: list choices: http, ssh, telnet, ftp, dns, smtp, pop3, imap, snmp, nntp, https more...
      • violation_action - Action for protocols not in the allowlist for selected port. type: str choices: pass, monitor, block more...
    • enforce_default_app_port - Enable/disable default application port enforcement for allowed applications. type: str choices: disable, enable more...
    • entries - Application list entries. type: list member_path: entries:id more...
      • action - Pass or block traffic, or reset connection for traffic from this application. type: str choices: pass, block, reset more...
      • application - ID of allowed applications. type: list member_path: entries:id/application:id more...
        • id - Application IDs. see Notes. type: int required: true more...
      • behavior - Application behavior filter. type: list
      • category - Category ID list. type: list member_path: entries:id/category:id more...
        • id - Application category ID. see Notes. type: int required: true more...
      • exclusion - ID of excluded applications. type: list member_path: entries:id/exclusion:id more...
        • id - Excluded application IDs. see Notes. type: int required: true more...
      • id - Entry ID. see Notes. type: int required: true more...
      • log - Enable/disable logging for this application list. type: str choices: disable, enable more...
      • log_packet - Enable/disable packet logging. type: str choices: disable, enable more...
      • parameters - Application parameters. type: list member_path: entries:id/parameters:id more...
        • id - Parameter tuple ID. see Notes. type: int required: true more...
        • members - Parameter tuple members. type: list member_path: entries:id/parameters:id/members:id more...
          • id - Parameter. see Notes. type: int required: true more...
          • name - Parameter name. type: str more...
          • value - Parameter value. type: str more...
        • value - Parameter value. type: str more...
      • per_ip_shaper - Per-IP traffic shaper. Source firewall.shaper.per-ip-shaper.name. type: str more...
      • popularity - Application popularity filter (1 - 5, from least to most popular). type: list choices: 1, 2, 3, 4, 5 more...
      • protocols - Application protocol filter. type: list
      • quarantine - Quarantine method. type: str choices: none, attacker more...
      • quarantine_expiry - Duration of quarantine. (Format type: str more...
      • quarantine_log - Enable/disable quarantine logging. type: str choices: disable, enable more...
      • rate_count - Count of the rate. type: int more...
      • rate_duration - Duration (sec) of the rate. type: int more...
      • rate_mode - Rate limit mode. type: str choices: periodical, continuous more...
      • rate_track - Track the packet protocol field. type: str choices: none, src-ip, dest-ip, dhcp-client-mac, dns-domain more...
      • risk - Risk, or impact, of allowing traffic from this application to occur (1 - 5; Low, Elevated, Medium, High, and Critical). type: list member_path: entries:id/risk:level more...
        • level - Risk, or impact, of allowing traffic from this application to occur (1 - 5; Low, Elevated, Medium, High, and Critical). see Notes. type: int required: true more...
      • session_ttl - Session TTL (0 = default). type: int more...
      • shaper - Traffic shaper. Source firewall.shaper.traffic-shaper.name. type: str more...
      • shaper_reverse - Reverse traffic shaper. Source firewall.shaper.traffic-shaper.name. type: str more...
      • sub_category - Application Sub-category ID list. type: list member_path: entries:id/sub_category:id more...
        • id - Application sub-category ID. see Notes. type: int required: true more...
      • technology - Application technology filter. type: list
      • vendor - Application vendor filter. type: list
    • extended_log - Enable/disable extended logging. type: str choices: enable, disable more...
    • force_inclusion_ssl_di_sigs - Enable/disable forced inclusion of SSL deep inspection signatures. type: str choices: disable, enable more...
    • name - List name. type: str required: true more...
    • options - Basic application protocol signatures allowed by default. type: list choices: allow-dns, allow-icmp, allow-http, allow-ssl, allow-quic more...
    • other_application_action - Action for other applications. type: str choices: pass, block more...
    • other_application_log - Enable/disable logging for other applications. type: str choices: disable, enable more...
    • p2p_black_list - P2P applications to be black listed. type: list choices: skype, edonkey, bittorrent more...
    • p2p_block_list - P2P applications to be block listed. type: list choices: skype, edonkey, bittorrent more...
    • replacemsg_group - Replacement message group. Source system.replacemsg-group.name. type: str more...
    • unknown_application_action - Pass or block traffic from unknown applications. type: str choices: pass, block more...
    • unknown_application_log - Enable/disable logging for unknown applications. type: str choices: disable, enable more...

Notes

Note

  • Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks

Examples

- name: Configure application control lists.
  fortinet.fortios.fortios_application_list:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      application_list:
          app_replacemsg: "disable"
          comment: "Comments."
          control_default_network_services: "disable"
          deep_app_inspection: "disable"
          default_network_services:
              -
                  id: "8"
                  port: "0"
                  services: "http"
                  violation_action: "pass"
          enforce_default_app_port: "disable"
          entries:
              -
                  action: "pass"
                  application:
                      -
                          id: "16"
                  behavior: "<your_own_value>"
                  category:
                      -
                          id: "19"
                  exclusion:
                      -
                          id: "21"
                  id: "22"
                  log: "disable"
                  log_packet: "disable"
                  parameters:
                      -
                          id: "26"
                          members:
                              -
                                  id: "28"
                                  name: "default_name_29"
                                  value: "<your_own_value>"
                          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: "0"
                  rate_duration: "60"
                  rate_mode: "periodical"
                  rate_track: "none"
                  risk:
                      -
                          level: "<you_own_value>"
                  session_ttl: "0"
                  shaper: "<your_own_value> (source firewall.shaper.traffic-shaper.name)"
                  shaper_reverse: "<your_own_value> (source firewall.shaper.traffic-shaper.name)"
                  sub_category:
                      -
                          id: "48"
                  technology: "<your_own_value>"
                  vendor: "<your_own_value>"
          extended_log: "enable"
          force_inclusion_ssl_di_sigs: "disable"
          name: "default_name_53"
          options: "allow-dns"
          other_application_action: "pass"
          other_application_log: "disable"
          p2p_black_list: "skype"
          p2p_block_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.