fortios_dnsfilter_profile – Configure DNS domain filter profiles 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 dnsfilter 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.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
- dnsfilter_profile - Configure DNS domain filter profiles. type: dict
- state - B(Deprecated) type: str required: False choices: present, absent
- block_action - Action to take for blocked domains. type: str choices: block, redirect
- block_botnet - Enable/disable blocking botnet C&C DNS lookups. type: str choices: disable, enable
- comment - Comment. type: str
- domain_filter - Domain filter settings. type: dict
- domain_filter_table - DNS domain filter table ID. Source dnsfilter.domain-filter.id. type: int
- external_ip_blocklist - One or more external IP block lists. type: list
- name - External domain block list name. Source system.external-resource.name. type: str required: True
- ftgd_dns - FortiGuard DNS Filter settings. type: dict
- filters - FortiGuard DNS domain filters. type: list
- action - Action to take for DNS requests matching the category. type: str choices: block, monitor
- category - Category number. type: int
- id - ID number. type: int required: True
- log - Enable/disable DNS filter logging for this DNS profile. type: str choices: enable, disable
- options - FortiGuard DNS filter options. type: str choices: error-allow, ftgd-disable
- log_all_domain - Enable/disable logging of all domains visited (detailed DNS logging). type: str choices: enable, disable
- name - Profile name. type: str required: True
- redirect_portal - IP address of the SDNS redirect portal. type: str
- safe_search - Enable/disable Google, Bing, and YouTube safe search. type: str choices: disable, enable
- sdns_domain_log - Enable/disable domain filtering and botnet domain logging. type: str choices: enable, disable
- sdns_ftgd_err_log - Enable/disable FortiGuard SDNS rating error logging. type: str choices: enable, disable
- youtube_restrict - Set safe search for YouTube restriction level. type: str choices: strict, moderate
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 DNS domain filter profiles.
fortios_dnsfilter_profile:
vdom: "{{ vdom }}"
state: "present"
access_token: "<your_own_value>"
dnsfilter_profile:
block_action: "block"
block_botnet: "disable"
comment: "Comment."
domain_filter:
domain_filter_table: "7 (source dnsfilter.domain-filter.id)"
external_ip_blocklist:
-
name: "default_name_9 (source system.external-resource.name)"
ftgd_dns:
filters:
-
action: "block"
category: "13"
id: "14"
log: "enable"
options: "error-allow"
log_all_domain: "enable"
name: "default_name_18"
redirect_portal: "<your_own_value>"
safe_search: "disable"
sdns_domain_log: "enable"
sdns_ftgd_err_log: "enable"
youtube_restrict: "strict"
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