fortinet.fortios.fortios_webfilter_profile module – Configure Web filter profiles in Fortinet’s FortiOS and FortiGate.
Note
This module is part of the fortinet.fortios collection (version 2.3.8).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install fortinet.fortios
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: fortinet.fortios.fortios_webfilter_profile
.
New in fortinet.fortios 2.0.0
Synopsis
This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify webfilter 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
Parameters
Parameter |
Comments |
---|---|
Token-based authentication. Generated from GUI of Fortigate. |
|
Enable/Disable logging for task. Choices:
|
|
Member attribute path to operate on. Delimited by a slash character if there are more than one attribute. Parameter marked with member_path is legitimate for doing member operation. |
|
Add or delete a member under specified attribute path. When member_state is specified, the state option is ignored. Choices:
|
|
Indicates whether to create or remove the object. Choices:
|
|
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. Default: |
|
Configure Web filter profiles. |
|
AntiPhishing profile. |
|
Authentication methods. Choices:
|
|
Enable/disable checking of HTTP Basic Auth field for known credentials. Choices:
|
|
Enable/disable checking of GET URI parameters for known credentials. Choices:
|
|
Enable/disable username only matching of credentials. Action will be taken for valid usernames regardless of password validity. Choices:
|
|
Custom username and password regex patterns. |
|
Category that the pattern matches. Choices:
|
|
Target pattern. |
|
Pattern will be treated either as a regex pattern or literal string. Choices:
|
|
Action to be taken when there is no matching rule. Choices:
|
|
Domain for which to verify received credentials against. Source user.domain-controller.name credential-store.domain-controller .server-name. |
|
AntiPhishing entries. |
|
Action to be taken upon an AntiPhishing match. Choices:
|
|
FortiGuard category to match. |
|
Inspection target name. |
|
LDAP server for which to verify received credentials against. Source user.ldap.name. |
|
Maximum size of a POST body to check for credentials. |
|
Toggle AntiPhishing functionality. Choices:
|
|
Optional comments. |
|
Enable/disable extended logging for web filtering. Choices:
|
|
Flow/proxy feature set. Choices:
|
|
File filter. |
|
File filter entries. |
|
Action taken for matched file. Choices:
|
|
Comment. |
|
Match files transmitted in the session”s originating or reply direction. Choices:
|
|
Select file type. |
|
File type name. Source antivirus.filetype.name. |
|
Add a file filter. |
|
Match password-protected files. Choices:
|
|
Protocols to apply with. Choices:
|
|
Enable/disable file filter logging. Choices:
|
|
Enable/disable file filter archive contents scan. Choices:
|
|
Enable/disable file filter. Choices:
|
|
FortiGuard Web Filter settings. |
|
Do not stop quota for these categories. |
|
FortiGuard filters. |
|
Action to take for matches. Choices:
|
|
Groups with permission to authenticate. |
|
User group name. Source user.group.name. |
|
Categories and groups the filter examines. |
|
ID number. see <a href=’#notes’>Notes</a>. |
|
Enable/disable logging. Choices:
|
|
Override replacement message. |
|
Duration of warnings. |
|
Re-display warning after closing browser or after a timeout. Choices:
|
|
Warning prompts in each category or each domain. Choices:
|
|
Maximum FortiGuard quota used by single page view in seconds (excludes streams). |
|
Options for FortiGuard Web Filter. Choices:
|
|
Allow web filter profile overrides. |
|
FortiGuard traffic quota settings. |
|
FortiGuard categories to apply quota to (category action must be set to monitor). |
|
Duration of quota. |
|
ID number. see <a href=’#notes’>Notes</a>. |
|
Override replacement message. |
|
Quota type. Choices:
|
|
Traffic quota unit of measurement. Choices:
|
|
Traffic quota value. |
|
Enable/disable rating CRL by URL. Choices:
|
|
Enable/disable rating CSS by URL. Choices:
|
|
Enable/disable rating images by URL. Choices:
|
|
Enable/disable rating JavaScript by URL. Choices:
|
|
Enable replacement messages for HTTPS. Choices:
|
|
Web filtering inspection mode. Choices:
|
|
Enable/disable logging all URLs visited. Choices:
|
|
Profile name. |
|
Options. Choices:
|
|
Web Filter override settings. |
|
Allow/deny browser-based (cookie) overrides. Choices:
|
|
Override duration. |
|
Override duration mode. Choices:
|
|
Override scope. Choices:
|
|
User groups with permission to use the override. |
|
User group name. Source user.group.name. |
|
Web filter profile with permission to create overrides. |
|
Web profile. Source webfilter.profile.name. |
|
Profile attribute to retrieve from the RADIUS server. Choices:
|
|
Override profile type. Choices:
|
|
Permitted override types. Choices:
|
|
Action taken for HTTP POST traffic. Choices:
|
|
Replacement message group. Source system.replacemsg-group.name. |
|
Configure URL Extraction |
|
HTTP header name to use for client redirect on blocked requests |
|
Enable / Disable empty message-body entity in HTTP response Choices:
|
|
HTTP header value to use for client redirect on blocked requests |
|
URL extraction server FQDN (fully qualified domain name) |
|
Enable URL Extraction Choices:
|
|
Web content filtering settings. |
|
FortiGuard allowlist settings. Choices:
|
|
Enable/disable automatic addition of URLs detected by FortiSandbox to blacklist. Choices:
|
|
Enable/disable automatic addition of URLs detected by FortiSandbox to blocklist. Choices:
|
|
Banned word table ID. Source webfilter.content.id. |
|
Banned word score threshold. |
|
Content header list. Source webfilter.content-header.id. |
|
Search keywords to log when match is found. |
|
Pattern/keyword to search for. |
|
Enable/disable logging all search phrases. Choices:
|
|
Safe search type. Choices:
|
|
URL filter table ID. Source webfilter.urlfilter.id. |
|
Set Vimeo-restrict (“7” = don”t show mature content, “134” = don”t show unrated and mature content). A value of cookie “content_rating”. |
|
FortiGuard whitelist settings. Choices:
|
|
YouTube EDU filter level. Choices:
|
|
Enable/disable logging of AntiPhishing checks. Choices:
|
|
Enable/disable logging logging blocked web content. Choices:
|
|
Enable/disable extended any filter action logging for web filtering. Choices:
|
|
Enable/disable logging ActiveX. Choices:
|
|
Enable/disable logging Java applets. Choices:
|
|
Enable/disable logging blocked commands. Choices:
|
|
Enable/disable logging cookie filtering. Choices:
|
|
Enable/disable logging blocked cookies. Choices:
|
|
Enable/disable logging Java scripts. Choices:
|
|
Enable/disable logging JScripts. Choices:
|
|
Enable/disable logging referrers. Choices:
|
|
Enable/disable logging unknown scripts. Choices:
|
|
Enable/disable logging VBS scripts. Choices:
|
|
Log encoding in flow mode. Choices:
|
|
Enable/disable logging rating errors. Choices:
|
|
Enable/disable logging daily quota usage. Choices:
|
|
Enable/disable logging invalid domain names. Choices:
|
|
Enable/disable logging URL filtering. Choices:
|
|
Enable/disable web proxy WISP. Choices:
|
|
WISP server selection algorithm. Choices:
|
|
WISP servers. |
|
Server name. Source web-proxy.wisp.name. |
|
YouTube channel filter. |
|
YouTube channel ID to be filtered. |
|
Comment. |
|
ID. see <a href=’#notes’>Notes</a>. |
|
YouTube channel filter status. Choices:
|
Notes
Note
Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks
The module supports check_mode.
Examples
- name: Configure Web filter profiles.
fortinet.fortios.fortios_webfilter_profile:
vdom: "{{ vdom }}"
state: "present"
access_token: "<your_own_value>"
webfilter_profile:
antiphish:
authentication: "domain-controller"
check_basic_auth: "enable"
check_uri: "enable"
check_username_only: "enable"
custom_patterns:
-
category: "username"
pattern: "<your_own_value>"
type: "regex"
default_action: "exempt"
domain_controller: "<your_own_value> (source user.domain-controller.name credential-store.domain-controller.server-name)"
inspection_entries:
-
action: "exempt"
fortiguard_category: "<your_own_value>"
name: "default_name_17"
ldap: "<your_own_value> (source user.ldap.name)"
max_body_len: "65536"
status: "enable"
comment: "Optional comments."
extended_log: "enable"
feature_set: "flow"
file_filter:
entries:
-
action: "log"
comment: "Comment."
direction: "incoming"
file_type:
-
name: "default_name_30 (source antivirus.filetype.name)"
filter: "<your_own_value>"
password_protected: "yes"
protocol: "http"
log: "enable"
scan_archive_contents: "enable"
status: "enable"
ftgd_wf:
exempt_quota: "<your_own_value>"
filters:
-
action: "block"
auth_usr_grp:
-
name: "default_name_42 (source user.group.name)"
category: "0"
id: "44"
log: "enable"
override_replacemsg: "<your_own_value>"
warn_duration: "<your_own_value>"
warning_duration_type: "session"
warning_prompt: "per-domain"
max_quota_timeout: "300"
options: "error-allow"
ovrd: "<your_own_value>"
quota:
-
category: "<your_own_value>"
duration: "<your_own_value>"
id: "56"
override_replacemsg: "<your_own_value>"
type: "time"
unit: "B"
value: "1024"
rate_crl_urls: "disable"
rate_css_urls: "disable"
rate_image_urls: "disable"
rate_javascript_urls: "disable"
https_replacemsg: "enable"
inspection_mode: "proxy"
log_all_url: "enable"
name: "default_name_68"
options: "activexfilter"
override:
ovrd_cookie: "allow"
ovrd_dur: "<your_own_value>"
ovrd_dur_mode: "constant"
ovrd_scope: "user"
ovrd_user_group:
-
name: "default_name_76 (source user.group.name)"
profile:
-
name: "default_name_78 (source webfilter.profile.name)"
profile_attribute: "User-Name"
profile_type: "list"
ovrd_perm: "bannedword-override"
post_action: "normal"
replacemsg_group: "<your_own_value> (source system.replacemsg-group.name)"
url_extraction:
redirect_header: "<your_own_value>"
redirect_no_content: "enable"
redirect_url: "<your_own_value>"
server_fqdn: "<your_own_value>"
status: "enable"
web:
allowlist: "exempt-av"
blacklist: "enable"
blocklist: "enable"
bword_table: "0"
bword_threshold: "10"
content_header_list: "0"
keyword_match:
-
pattern: "<your_own_value>"
log_search: "enable"
safe_search: "url"
urlfilter_table: "0"
vimeo_restrict: "<your_own_value>"
whitelist: "exempt-av"
youtube_restrict: "none"
web_antiphishing_log: "enable"
web_content_log: "enable"
web_extended_all_action_log: "enable"
web_filter_activex_log: "enable"
web_filter_applet_log: "enable"
web_filter_command_block_log: "enable"
web_filter_cookie_log: "enable"
web_filter_cookie_removal_log: "enable"
web_filter_js_log: "enable"
web_filter_jscript_log: "enable"
web_filter_referer_log: "enable"
web_filter_unknown_log: "enable"
web_filter_vbs_log: "enable"
web_flow_log_encoding: "utf-8"
web_ftgd_err_log: "enable"
web_ftgd_quota_usage: "enable"
web_invalid_domain_log: "enable"
web_url_log: "enable"
wisp: "enable"
wisp_algorithm: "primary-secondary"
wisp_servers:
-
name: "default_name_126 (source web-proxy.wisp.name)"
youtube_channel_filter:
-
channel_id: "<your_own_value>"
comment: "Comment."
id: "130"
youtube_channel_status: "disable"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Build number of the fortigate image Returned: always Sample: |
|
Last method used to provision the content into FortiGate Returned: always Sample: |
|
Last result given by FortiGate on last operation applied Returned: always Sample: |
|
Master key (id) used in the last call to FortiGate Returned: success Sample: |
|
Name of the table used to fulfill the request Returned: always Sample: |
|
Path of the table used to fulfill the request Returned: always Sample: |
|
Internal revision number Returned: always Sample: |
|
Serial number of the unit Returned: always Sample: |
|
Indication of the operation’s result Returned: always Sample: |
|
Virtual domain used Returned: always Sample: |
|
Version of the FortiGate Returned: always Sample: |