fmgr_application_list – Configure application control lists.

New in version 2.10.

Synopsis

  • This module is able to configure a FortiManager device by allowing the user to [add, get, set, update] the following FortiManager json-rpc urls.
  • /pm/config/adom/{adom}/obj/application/list
  • /pm/config/global/obj/application/list
  • Examples include all parameters and values need to be adjusted to data sources before usage.
  • Tested with FortiManager v6.0.0

Requirements

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

  • ansible>=2.10.0

Parameters

  • loose_validation - Do parameter validation in a loose way type: bool required: false default: false
  • workspace_locking_adom - Acquire the workspace lock if FortiManager is running in workspace mode type: str required: false choices: global, custom dom
  • workspace_locking_timeout - The maximum time in seconds to wait for other users to release workspace lock type: integer required: false default: 300
  • url_params - parameters in url path type: dict required: true
    • adom - the domain prefix type: str choices: none, global, custom dom
  • parameters for method: [add, set, update] - Configure application control lists.
    • data - No description for the parameter type: array
      • 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 - No description for the parameter type: array
        • action - Pass or block traffic, or reset connection for traffic from this application. type: str choices: [pass, block, reset]
        • application - No description for the parameter type: array
          • {no-name} - No description for the parameter type: int
        • behavior - No description for the parameter type: array
          • {no-name} - No description for the parameter type: str
        • category - Category ID list. type: str
        • id - Entry ID. type: int
        • 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 - No description for the parameter type: array
          • id - Parameter ID. type: int
          • value - Parameter value. type: str
        • per-ip-shaper - Per-IP traffic shaper. type: str
        • popularity - No description for the parameter type: array
          • {no-name} - No description for the parameter type: str choices: [1, 2, 3, 4, 5]
        • protocols - No description for the parameter type: array
          • {no-name} - No description for the parameter type: str
        • quarantine - Quarantine method. type: str choices: [none, attacker]
        • quarantine-expiry - Duration of quarantine. 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 - No description for the parameter type: array
          • {no-name} - No description for the parameter type: int
        • session-ttl - Session TTL (0 = default). type: int
        • shaper - Traffic shaper. type: str
        • shaper-reverse - Reverse traffic shaper. type: str
        • sub-category - No description for the parameter type: array
          • {no-name} - No description for the parameter type: int
        • technology - No description for the parameter type: array
          • {no-name} - No description for the parameter type: str
        • vendor - No description for the parameter type: array
          • {no-name} - No description for the parameter type: str
      • extended-log - Enable/disable extended logging. type: str choices: [disable, enable]
      • name - List name. type: str
      • options - No description for the parameter type: array
        • {no-name} - No description for the parameter 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 - No description for the parameter type: array
        • {no-name} - No description for the parameter type: str choices: [skype, edonkey, bittorrent]
      • replacemsg-group - Replacement message group. 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]
  • parameters for method: [get] - Configure application control lists.
    • attr - The name of the attribute to retrieve its datasource. type: str
    • fields - No description for the parameter type: array
      • {no-name} - No description for the parameter type: array
        • {no-name} - No description for the parameter type: str choices: [app-replacemsg, comment, deep-app-inspection, extended-log, name, options, other-application-action, other-application-log, p2p-black-list, replacemsg-group, unknown-application-action, unknown-application-log]
    • filter - No description for the parameter type: array
      • {no-name} - No description for the parameter type: str
    • get used - No description for the parameter type: int
    • loadsub - Enable or disable the return of any sub-objects. type: int
    • option - Set fetch option for the request. type: str choices: [count, object member, datasrc, get reserved, syntax]
    • range - No description for the parameter type: array
      • {no-name} - No description for the parameter type: int
    • sortings - No description for the parameter type: array
      • {attr_name} - No description for the parameter type: int choices: [1, -1]

Notes

Note

  • The module may supports multiple method, every method has different parameters definition
  • One method may also have more than one parameter definition collection, each collection is dedicated to one API endpoint
  • The module may include domain dependent urls, the domain can be specified in url_params as adom
  • To run in workspace mode, the paremeter workspace_locking_adom must be included in the task

Examples

- hosts: fortimanager-inventory
  collections:
    - fortinet.fortimanager
  connection: httpapi
  vars:
     ansible_httpapi_use_ssl: True
     ansible_httpapi_validate_certs: False
     ansible_httpapi_port: 443
  tasks:

   - name: REQUESTING /PM/CONFIG/OBJ/APPLICATION/LIST
     fmgr_application_list:
        loose_validation: False
        workspace_locking_adom: <value in [global, custom adom]>
        workspace_locking_timeout: 300
        method: <value in [add, set, update]>
        url_params:
           adom: <value in [none, global, custom dom]>
        params:
           -
              data:
                -
                    app-replacemsg: <value in [disable, enable]>
                    comment: <value of string>
                    deep-app-inspection: <value in [disable, enable]>
                    entries:
                      -
                          action: <value in [pass, block, reset]>
                          application:
                            - <value of integer>
                          behavior:
                            - <value of string>
                          category: <value of string>
                          id: <value of integer>
                          log: <value in [disable, enable]>
                          log-packet: <value in [disable, enable]>
                          parameters:
                            -
                                id: <value of integer>
                                value: <value of string>
                          per-ip-shaper: <value of string>
                          popularity:
                            - <value in [1, 2, 3, ...]>
                          protocols:
                            - <value of string>
                          quarantine: <value in [none, attacker]>
                          quarantine-expiry: <value of string>
                          quarantine-log: <value in [disable, enable]>
                          rate-count: <value of integer>
                          rate-duration: <value of integer>
                          rate-mode: <value in [periodical, continuous]>
                          rate-track: <value in [none, src-ip, dest-ip, ...]>
                          risk:
                            - <value of integer>
                          session-ttl: <value of integer>
                          shaper: <value of string>
                          shaper-reverse: <value of string>
                          sub-category:
                            - <value of integer>
                          technology:
                            - <value of string>
                          vendor:
                            - <value of string>
                    extended-log: <value in [disable, enable]>
                    name: <value of string>
                    options:
                      - <value in [allow-dns, allow-icmp, allow-http, ...]>
                    other-application-action: <value in [pass, block]>
                    other-application-log: <value in [disable, enable]>
                    p2p-black-list:
                      - <value in [skype, edonkey, bittorrent]>
                    replacemsg-group: <value of string>
                    unknown-application-action: <value in [pass, block]>
                    unknown-application-log: <value in [disable, enable]>

   - name: REQUESTING /PM/CONFIG/OBJ/APPLICATION/LIST
     fmgr_application_list:
        loose_validation: False
        workspace_locking_adom: <value in [global, custom adom]>
        workspace_locking_timeout: 300
        method: <value in [get]>
        url_params:
           adom: <value in [none, global, custom dom]>
        params:
           -
              attr: <value of string>
              fields:
                -
                   - <value in [app-replacemsg, comment, deep-app-inspection, ...]>
              filter:
                - <value of string>
              get used: <value of integer>
              loadsub: <value of integer>
              option: <value in [count, object member, datasrc, ...]>
              range:
                - <value of integer>
              sortings:
                -
                    varidic.attr_name: <value in [1, -1]>

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:

  • return values for method: [add, set, update]
    • status - No description for the parameter type: dict
      • code - No description for the parameter type: int
      • message - No description for the parameter type: str
    • url - No description for the parameter type: str example: /pm/config/adom/{adom}/obj/application/list
  • return values for method: [get]
    • data - No description for the parameter type: array
      • app-replacemsg - Enable/disable replacement messages for blocked applications. type: str
      • comment - comments type: str
      • deep-app-inspection - Enable/disable deep application inspection. type: str
      • entries - No description for the parameter type: array
        • action - Pass or block traffic, or reset connection for traffic from this application. type: str
        • application - No description for the parameter type: array
          • {no-name} - No description for the parameter type: int
        • behavior - No description for the parameter type: array
          • {no-name} - No description for the parameter type: str
        • category - Category ID list. type: str
        • id - Entry ID. type: int
        • log - Enable/disable logging for this application list. type: str
        • log-packet - Enable/disable packet logging. type: str
        • parameters - No description for the parameter type: array
          • id - Parameter ID. type: int
          • value - Parameter value. type: str
        • per-ip-shaper - Per-IP traffic shaper. type: str
        • popularity - No description for the parameter type: array
          • {no-name} - No description for the parameter type: str
        • protocols - No description for the parameter type: array
          • {no-name} - No description for the parameter type: str
        • quarantine - Quarantine method. type: str
        • quarantine-expiry - Duration of quarantine. type: str
        • quarantine-log - Enable/disable quarantine logging. type: str
        • rate-count - Count of the rate. type: int
        • rate-duration - Duration (sec) of the rate. type: int
        • rate-mode - Rate limit mode. type: str
        • rate-track - Track the packet protocol field. type: str
        • risk - No description for the parameter type: array
          • {no-name} - No description for the parameter type: int
        • session-ttl - Session TTL (0 = default). type: int
        • shaper - Traffic shaper. type: str
        • shaper-reverse - Reverse traffic shaper. type: str
        • sub-category - No description for the parameter type: array
          • {no-name} - No description for the parameter type: int
        • technology - No description for the parameter type: array
          • {no-name} - No description for the parameter type: str
        • vendor - No description for the parameter type: array
          • {no-name} - No description for the parameter type: str
      • extended-log - Enable/disable extended logging. type: str
      • name - List name. type: str
      • options - No description for the parameter type: array
        • {no-name} - No description for the parameter type: str
      • other-application-action - Action for other applications. type: str
      • other-application-log - Enable/disable logging for other applications. type: str
      • p2p-black-list - No description for the parameter type: array
        • {no-name} - No description for the parameter type: str
      • replacemsg-group - Replacement message group. type: str
      • unknown-application-action - Pass or block traffic from unknown applications. type: str
      • unknown-application-log - Enable/disable logging for unknown applications. type: str
    • status - No description for the parameter type: dict
      • code - No description for the parameter type: int
      • message - No description for the parameter type: str
    • url - No description for the parameter type: str example: /pm/config/adom/{adom}/obj/application/list

Status

  • This module is not guaranteed to have a backwards compatible interface.

Authors

  • Frank Shen (@fshen01)
  • Link Zheng (@zhengl)

Hint

If you notice any issues in this documentation, you can create a pull request to improve it.