fortios_dlp_profile – Configure DLP profiles 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 dlp feature and profile 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: v7.2.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
  • dlp_profile - Configure DLP profiles. type: dict more...
    • comment - Comment. type: str more...
    • dlp_log - Enable/disable DLP logging. type: str choices: enable, disable more...
    • extended_log - Enable/disable extended logging for data leak prevention. type: str choices: enable, disable more...
    • feature_set - Flow/proxy feature set. type: str choices: flow, proxy more...
    • full_archive_proto - Protocols to always content archive. type: list choices: smtp, pop3, imap, http-get, http-post, ftp, nntp, mapi, ssh, cifs more...
    • nac_quar_log - Enable/disable NAC quarantine logging. type: str choices: enable, disable more...
    • name - Name of the DLP profile. type: str required: true more...
    • replacemsg_group - Replacement message group used by this DLP profile. Source system.replacemsg-group.name. type: str more...
    • rule - Set up DLP rules for this profile. type: list member_path: rule:id more...
      • action - Action to take with content that this DLP profile matches. type: str choices: allow, log-only, block, quarantine-ip more...
      • archive - Enable/disable DLP archiving. type: str choices: disable, enable more...
      • expiry - Quarantine duration in days, hours, minutes (format = dddhhmm). type: str more...
      • file_size - Match files greater than or equal to this size (KB). type: int more...
      • file_type - Select the number of a DLP file pattern table to match. Source dlp.filepattern.id. type: int more...
      • filter_by - Select the type of content to match. type: str choices: sensor, mip, fingerprint, encrypted, none more...
      • id - ID. see Notes. type: int required: true more...
      • label - MIP label dictionary. Source dlp.dictionary.name. type: str more...
      • match_percentage - Percentage of fingerprints in the fingerprint databases designated with the selected sensitivity to match. type: int more...
      • name - Filter name. type: str more...
      • proto - Check messages or files over one or more of these protocols. type: list choices: smtp, pop3, imap, http-get, http-post, ftp, nntp, mapi, ssh, cifs more...
      • sensitivity - Select a DLP file pattern sensitivity to match. type: list member_path: rule:id/sensitivity:name more...
        • name - Select a DLP sensitivity. Source dlp.sensitivity.name. type: str required: true more...
      • sensor - Select DLP sensors. type: list member_path: rule:id/sensor:name more...
        • name - Address name. Source dlp.sensor.name. type: str required: true more...
      • severity - Select the severity or threat level that matches this filter. type: str choices: info, low, medium, high, critical more...
      • type - Select whether to check the content of messages (an email message) or files (downloaded files or email attachments). type: str choices: file, fos_message more...
    • summary_proto - Protocols to always log summary. type: list choices: smtp, pop3, imap, http-get, http-post, ftp, nntp, mapi, ssh, cifs more...

Notes

Note

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

Examples

- name: Configure DLP profiles.
  fortinet.fortios.fortios_dlp_profile:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      dlp_profile:
          comment: "Comment."
          dlp_log: "enable"
          extended_log: "enable"
          feature_set: "flow"
          full_archive_proto: "smtp"
          nac_quar_log: "enable"
          name: "default_name_9"
          replacemsg_group: "<your_own_value> (source system.replacemsg-group.name)"
          rule:
              -
                  action: "allow"
                  archive: "disable"
                  expiry: "<your_own_value>"
                  file_size: "0"
                  file_type: "0"
                  filter_by: "sensor"
                  id: "18"
                  label: "<your_own_value> (source dlp.dictionary.name)"
                  match_percentage: "10"
                  name: "default_name_21"
                  proto: "smtp"
                  sensitivity:
                      -
                          name: "default_name_24 (source dlp.sensitivity.name)"
                  sensor:
                      -
                          name: "default_name_26 (source dlp.sensor.name)"
                  severity: "info"
                  type: "file"
          summary_proto: "smtp"

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.