fortios_dlp_sensor – Configure sensors used by DLP blocking 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 sensor 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
  • dlp_sensor - Configure sensors used by DLP blocking. type: dict more...
    • comment - Optional comments. type: str more...
    • dlp_log - Enable/disable DLP logging. type: str choices: enable, disable more...
    • entries - DLP sensor entries. type: list member_path: entries:id more...
      • count - Count of dictionary matches to trigger sensor entry match (Dictionary might not be able to trigger more than once based on its "repeat" option, 1 - 255). type: int more...
      • dictionary - Select a DLP dictionary. Source dlp.dictionary.name dlp.exact-data-match.name. type: str more...
      • id - ID. see Notes. type: int required: true more...
      • status - Enable/disable this entry. type: str choices: enable, disable more...
    • eval - Expression to evaluate. type: str 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...
    • filter - Set up DLP filters for this sensor. type: list member_path: filter:id more...
      • action - Action to take with content that this DLP sensor matches. type: str choices: allow, log-only, block, quarantine-ip more...
      • archive - Enable/disable DLP archiving. type: str choices: disable, enable more...
      • company_identifier - Enter a company identifier watermark to match. Only watermarks that your company has placed on the files are matched. type: str more...
      • expiry - Quarantine duration in days, hours, minutes (format = dddhhmm). type: str more...
      • file_size - Match files this size or larger (0 - 4294967295 kbytes). 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: credit-card, ssn, regexp, file-type, file-size, fingerprint, watermark, encrypted more...
      • fp_sensitivity - Select a DLP file pattern sensitivity to match. type: list member_path: filter:id/fp_sensitivity:name more...
        • name - Select a DLP sensitivity. Source dlp.fp-sensitivity.name. type: str required: true more...
      • id - ID. see Notes. type: int required: true 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, mm1, mm3, mm4, mm7 more...
      • regexp - Enter a regular expression to match (max. 255 characters). type: str more...
      • sensitivity - Select a DLP file pattern sensitivity to match. type: list member_path: filter:id/sensitivity:name more...
        • name - Select a DLP sensitivity. Source dlp.sensitivity.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...
    • flow_based - Enable/disable flow-based DLP. type: str choices: enable, disable more...
    • full_archive_proto - Protocols to always content archive. type: list choices: smtp, pop3, imap, http-get, http-post, ftp, nntp, mapi, ssh, cifs, mm1, mm3, mm4, mm7 more...
    • match_type - Logical relation between entries . type: str choices: match-all, match-any, match-eval more...
    • nac_quar_log - Enable/disable NAC quarantine logging. type: str choices: enable, disable more...
    • name - Name of table containing the sensor. type: str required: true more...
    • options - Configure DLP options. type: str more...
    • replacemsg_group - Replacement message group used by this DLP sensor. Source system.replacemsg-group.name. type: str more...
    • summary_proto - Protocols to always log summary. type: list choices: smtp, pop3, imap, http-get, http-post, ftp, nntp, mapi, ssh, cifs, mm1, mm3, mm4, mm7 more...

Notes

Note

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

Examples

- name: Configure sensors used by DLP blocking.
  fortinet.fortios.fortios_dlp_sensor:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      dlp_sensor:
          comment: "Optional comments."
          dlp_log: "enable"
          entries:
              -
                  count: "1"
                  dictionary: "<your_own_value> (source dlp.dictionary.name dlp.exact-data-match.name)"
                  id: "8"
                  status: "enable"
          eval: "<your_own_value>"
          extended_log: "enable"
          feature_set: "flow"
          filter:
              -
                  action: "allow"
                  archive: "disable"
                  company_identifier: "myId_16"
                  expiry: "<your_own_value>"
                  file_size: "10"
                  file_type: "0"
                  filter_by: "credit-card"
                  fp_sensitivity:
                      -
                          name: "default_name_22 (source dlp.fp-sensitivity.name)"
                  id: "23"
                  match_percentage: "10"
                  name: "default_name_25"
                  proto: "smtp"
                  regexp: "<your_own_value>"
                  sensitivity:
                      -
                          name: "default_name_29 (source dlp.sensitivity.name)"
                  severity: "info"
                  type: "file"
          flow_based: "enable"
          full_archive_proto: "smtp"
          match_type: "match-all"
          nac_quar_log: "enable"
          name: "default_name_36"
          options: "<your_own_value>"
          replacemsg_group: "<your_own_value> (source system.replacemsg-group.name)"
          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.