fortios_dlp_sensor – Configure DLP sensors 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 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.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
  • dlp_sensor - Configure DLP sensors. type: dict
    • state - B(Deprecated) type: str required: False choices: present, absent
    • comment - Comment. type: str
    • dlp_log - Enable/disable DLP logging. type: str choices: enable, disable
    • extended_log - Enable/disable extended logging for data leak prevention. type: str choices: enable, disable
    • filter - Set up DLP filters for this sensor. type: list
      • action - Action to take with content that this DLP sensor matches. type: str choices: allow, log-only, block, quarantine-ip
      • archive - Enable/disable DLP archiving. type: str choices: disable, enable
      • company_identifier - Enter a company identifier watermark to match. Only watermarks that your company has placed on the files are matched. type: str
      • expiry - Quarantine duration in days, hours, minutes format (dddhhmm). type: str
      • file_size - Match files this size or larger (0 - 4294967295 kbytes). type: int
      • file_type - Select the number of a DLP file pattern table to match. Source dlp.filepattern.id. type: int
      • filter_by - Select the type of content to match. type: str choices: credit-card, ssn, regexp, file-type, file-size, fingerprint, watermark, encrypted
      • fp_sensitivity - Select a DLP file pattern sensitivity to match. type: list
        • name - Select a DLP sensitivity. Source dlp.fp-sensitivity.name. type: str required: True
      • id - ID. type: int required: True
      • match_percentage - Percentage of fingerprints in the fingerprint databases designated with the selected fp-sensitivity to match. type: int
      • name - Filter name. type: str
      • proto - Check messages or files over one or more of these protocols. type: str choices: smtp, pop3, imap, http-get, http-post, ftp, nntp, mapi, mm1, mm3, mm4, mm7
      • regexp - Enter a regular expression to match (max. 255 characters). type: str
      • severity - Select the severity or threat level that matches this filter. type: str choices: info, low, medium, high, critical
      • type - Select whether to check the content of messages (an email message) or files (downloaded files or email attachments). type: str choices: file, message
    • flow_based - Enable/disable flow-based DLP. type: str choices: enable, disable
    • full_archive_proto - Protocols to always content archive. type: str choices: smtp, pop3, imap, http-get, http-post, ftp, nntp, mapi, mm1, mm3, mm4, mm7
    • nac_quar_log - Enable/disable NAC quarantine logging. type: str choices: enable, disable
    • name - Name of the DLP sensor. type: str required: True
    • options - Configure DLP options. type: str
    • replacemsg_group - Replacement message group used by this DLP sensor. Source system.replacemsg-group.name. type: str
    • summary_proto - Protocols to always log summary. type: str choices: smtp, pop3, imap, http-get, http-post, ftp, nntp, mapi, mm1, mm3, mm4, mm7

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 DLP sensors.
    fortios_dlp_sensor:
      vdom:  "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      dlp_sensor:
        comment: "Comment."
        dlp_log: "enable"
        extended_log: "enable"
        filter:
         -
            action: "allow"
            archive: "disable"
            company_identifier:  "myId_9"
            expiry: "<your_own_value>"
            file_size: "11"
            file_type: "12 (source dlp.filepattern.id)"
            filter_by: "credit-card"
            fp_sensitivity:
             -
                name: "default_name_15 (source dlp.fp-sensitivity.name)"
            id:  "16"
            match_percentage: "17"
            name: "default_name_18"
            proto: "smtp"
            regexp: "<your_own_value>"
            severity: "info"
            type: "file"
        flow_based: "enable"
        full_archive_proto: "smtp"
        nac_quar_log: "enable"
        name: "default_name_26"
        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.