fortinet.fortimanager.fmgr_pm_config_pblock_firewall_policy module – Configure IPv4/IPv6 policies.
Note
This module is part of the fortinet.fortimanager collection (version 2.8.2).
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.fortimanager
.
To use it in a playbook, specify: fortinet.fortimanager.fmgr_pm_config_pblock_firewall_policy
.
New in fortinet.fortimanager 2.1.0
Synopsis
This module is able to configure a FortiManager device.
Examples include all parameters and values which need to be adjusted to data sources before usage.
Parameters
Parameter |
Comments |
---|---|
The token to access FortiManager without using username and password. |
|
The parameter (adom) in requested url. |
|
Only set to True when module schema diffs with FortiManager API structure, module continues to execute without validating parameters. Choices:
|
|
Enable/Disable logging for task. Choices:
|
|
Authenticate Ansible client with forticloud API access token. |
|
The parameter (pblock) in requested url. |
|
The top level parameters set. |
|
Assigned policy block. |
|
Policy action Choices:
|
|
Enable/disable anti-replay check. Choices:
|
|
(list) Application category ID list. |
|
(list) Application group names. |
|
(list) Application ID list. |
|
Name of an existing Application list. |
|
HTTPS server certificate for policy authentication. |
|
Enable/disable authentication-based routing. Choices:
|
|
HTTP-to-HTTPS redirect address for firewall authentication. |
|
Enable/disable policy traffic ASIC offloading. Choices:
|
|
Name of an existing Antivirus profile. |
|
Best route. Choices:
|
|
Enable/disable block notification. Choices:
|
|
Enable to exempt some users from the captive portal. Choices:
|
|
Enable/disable capture packets. Choices:
|
|
Name of an existing CASB profile. |
|
Enable/Disable CGN endpoint independent filtering. Choices:
|
|
Enable/Disable CGN endpoint independent mapping Choices:
|
|
NP log server group name |
|
Resource quota |
|
Session quota |
|
Enable/disable software endpoint independent filtering control. Choices:
|
|
Name of an existing CIFS profile. |
|
Comment. |
|
(list) Custom fields to append to log messages for this policy. |
|
Decrypted traffic mirror. |
|
Enable TCP NPU session delay to guarantee packet order of 3-way handshake. Choices:
|
|
(list) Names of devices or device groups that can be matched by the policy. |
|
Name of an existing Diameter filter profile. |
|
Enable to copy packets DiffServ values from sessions original direction to its reply direction. Choices:
|
|
Enable to change packets DiffServ values to the specified diffservcode-forward value. Choices:
|
|
Enable to change packets reverse Choices:
|
|
Change packets DiffServ to this value. |
|
Change packets reverse |
|
Enable/disable user authentication disclaimer. Choices:
|
|
Name of an existing DLP profile. |
|
Name of an existing DLP sensor. |
|
Name of an existing DNS filter profile. |
|
Enable DSCP check. Choices:
|
|
Enable negated DSCP match. Choices:
|
|
DSCP value. |
|
Enable DSRI to ignore HTTP server responses. Choices:
|
|
(list) Destination IPv4 address and address group names. |
|
(list) Destination IPv6 address name and address group names. |
|
When enabled dstaddr6 specifies what the destination address must NOT be. Choices:
|
|
When enabled dstaddr/dstaddr6 specifies what the destination address must NOT be. Choices:
|
|
(list) Outgoing |
|
Enable/disable dynamic RADIUS defined traffic shaping. Choices:
|
|
Enable/Disable check endpoint-independent-filtering pinhole. Choices:
|
|
Enable/Disable learning of end-point-independent filtering pinhole. Choices:
|
|
Enable/disable email collection. Choices:
|
|
Name of an existing email filter profile. |
|
Enable/disable Forward Error Correction on traffic matching this policy on a FEC device. Choices:
|
|
Name of an existing file-filter profile. |
|
How to handle sessions if the configuration of this firewall policy changes. Choices:
|
|
Enable to prevent source NAT from changing a sessions source port. Choices:
|
|
Enable/disable Fortinet Single Sign-On. Choices:
|
|
FSSO agent to use for NTLM authentication. |
|
(list) Names of FSSO groups. |
|
Enable/disable recognition of anycast IP addresses using the geography IP database. Choices:
|
|
Match geography address based either on its physical location or registered location. Choices:
|
|
Label for the policy that appears when the GUI is in Global View mode. |
|
(list) Names of user groups that can authenticate with this policy. |
|
GTP profile. |
|
Redirect HTTP Choices:
|
|
Name of an existing ICAP profile. |
|
Name of identity-based routing rule. |
|
Policy-based IPsec VPN Choices:
|
|
Policy inspection mode Choices:
|
|
Enable/disable use of Internet Services for this policy. Choices:
|
|
Enable/disable use of IPv6 Internet Services for this policy. Choices:
|
|
(list) Custom IPv6 Internet Service name. |
|
(list) Custom Internet Service6 group name. |
|
(list) Internet Service group name. |
|
(list) IPv6 Internet Service name. |
|
When enabled internet-service6 specifies what the service must NOT be. Choices:
|
|
Enable/disable use of IPv6 Internet Services in source for this policy. Choices:
|
|
(list) Custom IPv6 Internet Service source name. |
|
(list) Custom Internet Service6 source group name. |
|
(list) Internet Service6 source group name. |
|
(list) IPv6 Internet Service source name. |
|
When enabled internet-service6-src specifies what the service must NOT be. Choices:
|
|
(list) Custom Internet Service name. |
|
(list) Custom Internet Service group name. |
|
(list) Internet Service group name. |
|
(list) Internet Service ID. |
|
(list) Internet Service name. |
|
When enabled internet-service specifies what the service must NOT be. Choices:
|
|
Enable/disable use of Internet Services in source for this policy. Choices:
|
|
(list) Custom Internet Service source name. |
|
(list) Custom Internet Service source group name. |
|
(list) Internet Service source group name. |
|
(list) Internet Service source ID. |
|
(list) Internet Service source name. |
|
When enabled internet-service-src specifies what the service must NOT be. Choices:
|
|
IP version of the policy. |
|
Enable to use IP Pools for source NAT. Choices:
|
|
Name of an existing IPS sensor. |
|
Name of an existing VoIP |
|
Label for the policy that appears when the GUI is in Section View mode. |
|
Enable to allow everything, but log all of the meaningful data for security information gathering. Choices:
|
|
Enable/disable HTTP transaction log. Choices:
|
|
Enable or disable logging. Choices:
|
|
Record logs when a session starts. Choices:
|
|
Enable to match packets that have had their destination addresses changed by a VIP. Choices:
|
|
Enable/disable matching of only those packets that have had their destination addresses changed by a VIP. Choices:
|
|
Name of an existing MMS profile. |
|
Policy name. |
|
Enable/disable source NAT. Choices:
|
|
Enable/disable NAT46. Choices:
|
|
Enable/disable NAT64. Choices:
|
|
Policy-based IPsec VPN Choices:
|
|
Policy-based IPsec VPN |
|
Policy-based IPsec VPN Choices:
|
|
(list) Dynamic Network Service name. |
|
(list) Dynamic Network Service source name. |
|
Enable/disable UTM Network Processor acceleration. Choices:
|
|
Enable/disable NTLM authentication. Choices:
|
|
(list) HTTP-User-Agent value of supported browsers. |
|
Enable/disable NTLM guest user access. Choices:
|
|
Policy-based IPsec VPN Choices:
|
|
Enable/disable passive WAN health measurement. Choices:
|
|
Enable/disable PCP inbound DNAT. Choices:
|
|
Enable/disable PCP outbound SNAT. Choices:
|
|
(list) PCP pool names. |
|
Per-IP traffic shaper. |
|
Accept UDP packets from any host. Choices:
|
|
Accept UDP packets from any Session Traversal Utilities for NAT Choices:
|
|
PFCP profile. |
|
Behaviour of the policy. |
|
Enable/disable policy expiry. Choices:
|
|
Policy expiry date |
|
Policy expiry date and time, in epoch format. |
|
Enable/Disable hardware session setup for CGNAT. Choices:
|
|
Policy ID |
|
(list) IP Pool names. |
|
(list) IPv6 pool names. |
|
Enable/disable preservation of the original source port from source NAT if it has not been used. Choices:
|
|
Name of profile group. |
|
Name of an existing Protocol options profile. |
|
Determine whether the firewall policy allows security profile groups or single profiles only. Choices:
|
|
Enable IP authentication bypass. Choices:
|
|
Enable MAC authentication bypass. Choices:
|
|
URL users are directed to after seeing and accepting the disclaimer or authenticating. |
|
Override the default replacement message group for this policy. |
|
Direction of the initial traffic for reputation to take effect. Choices:
|
|
Direction of the initial traffic for IPv6 reputation to take effect. Choices:
|
|
Minimum Reputation to take action. |
|
IPv6 Minimum Reputation to take action. |
|
Enable/disable RADIUS single sign-on Choices:
|
|
(list) Address names if this is an RTP NAT policy. |
|
Enable Real Time Protocol Choices:
|
|
Block or monitor connections to Botnet servers or disable Botnet scanning. Choices:
|
|
Schedule name. |
|
Enable to force current sessions to end when the schedule object times out. Choices:
|
|
Name of an existing SCTP filter profile. |
|
Enable to send a reply when a session is denied or blocked by a firewall policy. Choices:
|
|
(list) Service and service group names. |
|
When enabled service specifies what the service must NOT be. Choices:
|
|
(int or str) TTL in seconds for sessions accepted by this policy |
|
(list) Security group tags. |
|
Enable/disable security group tags Choices:
|
|
Name of an existing Spam filter profile. |
|
(list) Vendor MAC source ID. |
|
(list) Source IPv4 address and address group names. |
|
(list) Source IPv6 address name and address group names. |
|
When enabled srcaddr6 specifies what the source address must NOT be. Choices:
|
|
When enabled srcaddr/srcaddr6 specifies what the source address must NOT be. Choices:
|
|
(list) Incoming |
|
Name of an existing SSH filter profile. |
|
Redirect SSH traffic to matching transparent proxy policy. Choices:
|
|
Enable to copy decrypted SSL traffic to a FortiGate interface Choices:
|
|
(list) SSL mirror interface name. |
|
Name of an existing SSL SSH profile. |
|
Enable or disable this policy. Choices:
|
|
Receiver TCP maximum segment size |
|
Sender TCP maximum segment size |
|
Enable/disable creation of TCP session without SYN flag. Choices:
|
|
TCP timeout profile ID |
|
Enable/disable sending RST packets when TCP sessions expire. Choices:
|
|
ToS |
|
Non-zero bit positions are used for comparison while zero bit positions are ignored. |
|
Enable negated TOS match. Choices:
|
|
Traffic shaper. |
|
Reverse traffic shaper. |
|
UDP timeout profile ID |
|
(list) URL category ID list. |
|
(list) Names of individual users that can authenticate with this policy. |
|
Enable to add one or more security profiles Choices:
|
|
Universally Unique Identifier |
|
Name of an existing VideoFilter profile. |
|
Name of an existing virtual-patch profile. |
|
VLAN forward direction user priority |
|
VLAN reverse direction user priority |
|
Set VLAN filters. |
|
Name of an existing VoIP profile. |
|
Policy-based IPsec VPN |
|
Name of an existing Web application firewall profile. |
|
Enable/disable WAN optimization. Choices:
|
|
WAN optimization auto-detection mode. Choices:
|
|
WAN optimization passive mode options. Choices:
|
|
WAN optimization peer. |
|
WAN optimization profile. |
|
Enable/disable forwarding traffic matching this policy to a configured WCCP server. Choices:
|
|
Enable/disable web cache. Choices:
|
|
Enable/disable web cache for HTTPS. Choices:
|
|
Name of an existing Web filter profile. |
|
Webproxy forward server name. |
|
Webproxy profile name. |
|
Enable/disable WiFi Single Sign On Choices:
|
|
Enable/disable zero trust device ownership. Choices:
|
|
(list) Source ztna-ems-tag names. |
|
(list) Source ztna-ems-tag-secondary names. |
|
(list) Source ztna-geo-tag names. |
|
Redirect ZTNA traffic to matching Access-Proxy proxy-policy. Choices:
|
|
Enable/disable zero trust access. Choices:
|
|
ZTNA tag matching logic. Choices:
|
|
The overridden method for the underlying Json RPC request. Choices:
|
|
The rc codes list with which the conditions to fail will be overriden. |
|
The rc codes list with which the conditions to succeed will be overriden. |
|
The directive to create, update or delete an object. Choices:
|
|
The adom to lock for FortiManager running in workspace mode, the value can be global and others including root. |
|
The maximum time in seconds to wait for other user to release the workspace lock. Default: |
Notes
Note
Starting in version 2.4.0, all input arguments are named using the underscore naming convention (snake_case). Please change the arguments such as “var-name” to “var_name”. Old argument names are still available yet you will receive deprecation warnings. You can ignore this warning by setting deprecation_warnings=False in ansible.cfg.
Running in workspace locking mode is supported in this FortiManager module, the top level parameters workspace_locking_adom and workspace_locking_timeout help do the work.
To create or update an object, use state present directive.
To delete an object, use state absent directive.
Normally, running one module can fail when a non-zero rc is returned. you can also override the conditions to fail or succeed with parameters rc_failed and rc_succeeded
Examples
- name: Example playbook (generated based on argument schema)
hosts: fortimanagers
connection: httpapi
vars:
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_httpapi_port: 443
tasks:
- name: Configure IPv4/IPv6 policies.
fortinet.fortimanager.fmgr_pm_config_pblock_firewall_policy:
# bypass_validation: false
workspace_locking_adom: <value in [global, custom adom including root]>
workspace_locking_timeout: 300
# rc_succeeded: [0, -2, -3, ...]
# rc_failed: [-2, -3, ...]
adom: <your own value>
pblock: <your own value>
state: present # <value in [present, absent]>
pm_config_pblock_firewall_policy:
_policy_block: <integer>
action: <value in [deny, accept, ipsec, ...]>
anti_replay: <value in [disable, enable]>
application_list: <string>
auth_cert: <string>
auth_path: <value in [disable, enable]>
auth_redirect_addr: <string>
auto_asic_offload: <value in [disable, enable]>
av_profile: <string>
block_notification: <value in [disable, enable]>
captive_portal_exempt: <value in [disable, enable]>
capture_packet: <value in [disable, enable]>
cifs_profile: <string>
comments: <string>
custom_log_fields: <list or string>
decrypted_traffic_mirror: <string>
delay_tcp_npu_session: <value in [disable, enable]>
diffserv_forward: <value in [disable, enable]>
diffserv_reverse: <value in [disable, enable]>
diffservcode_forward: <string>
diffservcode_rev: <string>
disclaimer: <value in [disable, enable, user, ...]>
dlp_profile: <string>
dnsfilter_profile: <string>
dsri: <value in [disable, enable]>
dstaddr: <list or string>
dstaddr_negate: <value in [disable, enable]>
dstaddr6: <list or string>
dstintf: <list or string>
dynamic_shaping: <value in [disable, enable]>
email_collect: <value in [disable, enable]>
emailfilter_profile: <string>
fec: <value in [disable, enable]>
file_filter_profile: <string>
firewall_session_dirty: <value in [check-all, check-new]>
fixedport: <value in [disable, enable]>
fsso_agent_for_ntlm: <string>
fsso_groups: <list or string>
geoip_anycast: <value in [disable, enable]>
geoip_match: <value in [physical-location, registered-location]>
global_label: <string>
groups: <list or string>
gtp_profile: <string>
http_policy_redirect: <value in [disable, enable]>
icap_profile: <string>
identity_based_route: <string>
inbound: <value in [disable, enable]>
inspection_mode: <value in [proxy, flow]>
internet_service: <value in [disable, enable]>
internet_service_custom: <list or string>
internet_service_custom_group: <list or string>
internet_service_group: <list or string>
internet_service_name: <list or string>
internet_service_negate: <value in [disable, enable]>
internet_service_src: <value in [disable, enable]>
internet_service_src_custom: <list or string>
internet_service_src_custom_group: <list or string>
internet_service_src_group: <list or string>
internet_service_src_name: <list or string>
internet_service_src_negate: <value in [disable, enable]>
ippool: <value in [disable, enable]>
ips_sensor: <string>
label: <string>
logtraffic: <value in [disable, enable, all, ...]>
logtraffic_start: <value in [disable, enable]>
match_vip: <value in [disable, enable]>
match_vip_only: <value in [disable, enable]>
name: <string>
nat: <value in [disable, enable]>
nat46: <value in [disable, enable]>
nat64: <value in [disable, enable]>
natinbound: <value in [disable, enable]>
natip: <string>
natoutbound: <value in [disable, enable]>
np_acceleration: <value in [disable, enable]>
ntlm: <value in [disable, enable]>
ntlm_enabled_browsers: <list or string>
ntlm_guest: <value in [disable, enable]>
outbound: <value in [disable, enable]>
passive_wan_health_measurement: <value in [disable, enable]>
per_ip_shaper: <string>
permit_any_host: <value in [disable, enable]>
permit_stun_host: <value in [disable, enable]>
pfcp_profile: <string>
policy_expiry: <value in [disable, enable]>
policy_expiry_date: <string>
policyid: <integer>
poolname: <list or string>
poolname6: <list or string>
profile_group: <string>
profile_protocol_options: <string>
profile_type: <value in [single, group]>
radius_mac_auth_bypass: <value in [disable, enable]>
redirect_url: <string>
replacemsg_override_group: <string>
reputation_direction: <value in [source, destination]>
reputation_minimum: <integer>
rtp_addr: <list or string>
rtp_nat: <value in [disable, enable]>
schedule: <string>
schedule_timeout: <value in [disable, enable]>
sctp_filter_profile: <string>
send_deny_packet: <value in [disable, enable]>
service: <list or string>
service_negate: <value in [disable, enable]>
session_ttl: <integer or string>
sgt: <list or integer>
sgt_check: <value in [disable, enable]>
src_vendor_mac: <list or string>
srcaddr: <list or string>
srcaddr_negate: <value in [disable, enable]>
srcaddr6: <list or string>
srcintf: <list or string>
ssh_filter_profile: <string>
ssh_policy_redirect: <value in [disable, enable]>
ssl_ssh_profile: <string>
status: <value in [disable, enable]>
tcp_mss_receiver: <integer>
tcp_mss_sender: <integer>
tcp_session_without_syn: <value in [all, data-only, disable]>
timeout_send_rst: <value in [disable, enable]>
tos: <string>
tos_mask: <string>
tos_negate: <value in [disable, enable]>
traffic_shaper: <string>
traffic_shaper_reverse: <string>
users: <list or string>
utm_status: <value in [disable, enable]>
uuid: <string>
videofilter_profile: <string>
vlan_cos_fwd: <integer>
vlan_cos_rev: <integer>
vlan_filter: <string>
voip_profile: <string>
vpntunnel: <string>
waf_profile: <string>
wanopt: <value in [disable, enable]>
wanopt_detection: <value in [active, passive, off]>
wanopt_passive_opt: <value in [default, transparent, non-transparent]>
wanopt_peer: <string>
wanopt_profile: <string>
wccp: <value in [disable, enable]>
webcache: <value in [disable, enable]>
webcache_https: <value in [disable, ssl-server, any, ...]>
webfilter_profile: <string>
webproxy_forward_server: <string>
webproxy_profile: <string>
ztna_ems_tag: <list or string>
ztna_geo_tag: <list or string>
ztna_status: <value in [disable, enable]>
policy_offload: <value in [disable, enable]>
cgn_session_quota: <integer>
tcp_timeout_pid: <string>
udp_timeout_pid: <string>
dlp_sensor: <string>
cgn_eif: <value in [disable, enable]>
cgn_log_server_grp: <string>
cgn_resource_quota: <integer>
cgn_eim: <value in [disable, enable]>
mms_profile: <string>
app_category: <list or string>
internet_service_src_id: <list or string>
rsso: <value in [disable, enable]>
internet_service_id: <list or string>
best_route: <value in [disable, enable]>
fsso: <value in [disable, enable]>
url_category: <list or string>
app_group: <list or string>
ssl_mirror_intf: <list or string>
wsso: <value in [disable, enable]>
ssl_mirror: <value in [disable, enable]>
application: <list or integer>
dscp_negate: <value in [disable, enable]>
learning_mode: <value in [disable, enable]>
devices: <list or string>
dscp_value: <string>
spamfilter_profile: <string>
scan_botnet_connections: <value in [disable, block, monitor]>
dscp_match: <value in [disable, enable]>
diffserv_copy: <value in [disable, enable]>
dstaddr6_negate: <value in [disable, enable]>
internet_service6: <value in [disable, enable]>
internet_service6_custom: <list or string>
internet_service6_custom_group: <list or string>
internet_service6_group: <list or string>
internet_service6_name: <list or string>
internet_service6_negate: <value in [disable, enable]>
internet_service6_src: <value in [disable, enable]>
internet_service6_src_custom: <list or string>
internet_service6_src_custom_group: <list or string>
internet_service6_src_group: <list or string>
internet_service6_src_name: <list or string>
internet_service6_src_negate: <value in [disable, enable]>
network_service_dynamic: <list or string>
network_service_src_dynamic: <list or string>
reputation_direction6: <value in [source, destination]>
reputation_minimum6: <integer>
srcaddr6_negate: <value in [disable, enable]>
ip_version_type: <string>
ips_voip_filter: <string>
pcp_inbound: <value in [disable, enable]>
pcp_outbound: <value in [disable, enable]>
pcp_poolname: <list or string>
policy_behaviour_type: <string>
policy_expiry_date_utc: <string>
ztna_device_ownership: <value in [disable, enable]>
ztna_ems_tag_secondary: <list or string>
ztna_policy_redirect: <value in [disable, enable]>
ztna_tags_match_logic: <value in [or, and]>
casb_profile: <string>
virtual_patch_profile: <string>
diameter_filter_profile: <string>
port_preserve: <value in [disable, enable]>
cgn_sw_eif_ctrl: <value in [disable, enable]>
eif_check: <value in [disable, enable]>
eif_learn: <value in [disable, enable]>
log_http_transaction: <value in [disable, enable, all, ...]>
radius_ip_auth_bypass: <value in [disable, enable]>
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The result of the request. Returned: always |
|
The full url requested. Returned: always Sample: |
|
The status of api request. Returned: always Sample: |
|
The api response. Returned: always |
|
The descriptive message of the api response. Returned: always Sample: |
|
The information of the target system. Returned: always |
|
The status the request. Returned: always Sample: |
|
Warning if the parameters used in the playbook are not supported by the current FortiManager version. Returned: complex |