community.fortios.fmgr_fwpol_ipv4 module – Allows the add/delete of Firewall Policies on Packages in FortiManager.
Note
This module is part of the community.fortios collection (version 1.0.0).
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 community.fortios
.
To use it in a playbook, specify: community.fortios.fmgr_fwpol_ipv4
.
Parameters
Parameter |
Comments |
---|---|
Policy action (allow/deny/ipsec). choice | deny | Blocks sessions that match the firewall policy. choice | accept | Allows session that match the firewall policy. choice | ipsec | Firewall policy becomes a policy-based IPsec VPN policy. Choices:
|
|
The ADOM the configuration should belong to. Default: “root” |
|
Application category ID list. |
|
Application group names. |
|
Application ID list. |
|
Name of an existing Application list. |
|
HTTPS server certificate for policy authentication. |
|
Enable/disable authentication-based routing. choice | disable | Disable authentication-based routing. choice | enable | Enable authentication-based routing. Choices:
|
|
HTTP-to-HTTPS redirect address for firewall authentication. |
|
Enable/disable offloading security profile processing to CP processors. choice | disable | Disable ASIC offloading. choice | enable | Enable auto ASIC offloading. Choices:
|
|
Name of an existing Antivirus profile. |
|
Enable/disable block notification. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Enable to exempt some users from the captive portal. choice | disable | Disable exemption of captive portal. choice | enable | Enable exemption of captive portal. Choices:
|
|
Enable/disable capture packets. choice | disable | Disable capture packets. choice | enable | Enable capture packets. Choices:
|
|
Comment. |
|
Custom fields to append to log messages for this policy. |
|
Enable TCP NPU session delay to guarantee packet order of 3-way handshake. choice | disable | Disable TCP NPU session delay in order to guarantee packet order of 3-way handshake. choice | enable | Enable TCP NPU session delay in order to guarantee packet order of 3-way handshake. Choices:
|
|
Names of devices or device groups that can be matched by the policy. |
|
Enable to change packet’s DiffServ values to the specified diffservcode-forward value. choice | disable | Disable WAN optimization. choice | enable | Enable WAN optimization. Choices:
|
|
Enable to change packet’s reverse (reply) DiffServ values to the specified diffservcode-rev value. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Change packet’s DiffServ to this value. |
|
Change packet’s reverse (reply) DiffServ to this value. |
|
Enable/disable user authentication disclaimer. choice | disable | Disable user authentication disclaimer. choice | enable | Enable user authentication disclaimer. Choices:
|
|
Name of an existing DLP sensor. |
|
Name of an existing DNS filter profile. |
|
Enable DSCP check. choice | disable | Disable DSCP check. choice | enable | Enable DSCP check. Choices:
|
|
Enable negated DSCP match. choice | disable | Disable DSCP negate. choice | enable | Enable DSCP negate. Choices:
|
|
DSCP value. |
|
Enable DSRI to ignore HTTP server responses. choice | disable | Disable DSRI. choice | enable | Enable DSRI. Choices:
|
|
Destination address and address group names. |
|
When enabled dstaddr specifies what the destination address must NOT be. choice | disable | Disable destination address negate. choice | enable | Enable destination address negate. Choices:
|
|
Outgoing (egress) interface. |
|
Normal behavior is to “skip” tasks that fail dependency checks, so other tasks can run. If set to “enabled” if a failed dependency check happeens, Ansible will exit as with failure instead of skip. Choices:
|
|
How to handle sessions if the configuration of this firewall policy changes. choice | check-all | Flush all current sessions accepted by this policy. choice | check-new | Continue to allow sessions already accepted by this policy. Choices:
|
|
Enable to prevent source NAT from changing a session’s source port. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Enable/disable Fortinet Single Sign-On. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
FSSO agent to use for NTLM authentication. |
|
Label for the policy that appears when the GUI is in Global View mode. |
|
Names of user groups that can authenticate with this policy. |
|
GTP profile. |
|
Name of an existing ICAP profile. |
|
Name of identity-based routing rule. |
|
Policy-based IPsec VPN | only traffic from the remote network can initiate a VPN. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Enable/disable use of Internet Services for this policy. If enabled, dstaddr and service are not used. choice | disable | Disable use of Internet Services in policy. choice | enable | Enable use of Internet Services in policy. Choices:
|
|
Custom Internet Service name. |
|
Internet Service ID. |
|
When enabled internet-service specifies what the service must NOT be. choice | disable | Disable negated Internet Service match. choice | enable | Enable negated Internet Service match. Choices:
|
|
Enable/disable use of Internet Services in source for this policy. If enabled, source address is not used. choice | disable | Disable use of Internet Services source in policy. choice | enable | Enable use of Internet Services source in policy. Choices:
|
|
Custom Internet Service source name. |
|
Internet Service source ID. |
|
When enabled internet-service-src specifies what the service must NOT be. choice | disable | Disable negated Internet Service source match. choice | enable | Enable negated Internet Service source match. Choices:
|
|
Enable to use IP Pools for source NAT. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Name of an existing IPS sensor. |
|
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. choice | disable | Disable learning mode in firewall policy. choice | enable | Enable learning mode in firewall policy. Choices:
|
|
Enable or disable logging. Log all sessions or security profile sessions. choice | disable | Disable all logging for this policy. choice | all | Log all sessions accepted or denied by this policy. choice | utm | Log traffic that has a security profile applied to it. Choices:
|
|
Record logs when a session starts and ends. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Enable to match packets that have had their destination addresses changed by a VIP. choice | disable | Do not match DNATed packet. choice | enable | Match DNATed packet. Choices:
|
|
Name of an existing MMS profile. |
|
Sets one of three modes for managing the object. Allows use of soft-adds instead of overwriting existing values Choices:
|
|
Policy name. |
|
Enable/disable source NAT. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Policy-based IPsec VPN | apply destination NAT to inbound traffic. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Policy-based IPsec VPN | source NAT IP address for outgoing traffic. |
|
Policy-based IPsec VPN | apply source NAT to outbound traffic. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Enable/disable UTM Network Processor acceleration. choice | disable | Disable UTM Network Processor acceleration. choice | enable | Enable UTM Network Processor acceleration. Choices:
|
|
Enable/disable NTLM authentication. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
HTTP-User-Agent value of supported browsers. |
|
Enable/disable NTLM guest user access. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Policy-based IPsec VPN | only traffic from the internal network can initiate a VPN. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
The policy package you want to modify Default: “default” |
|
Per-IP traffic shaper. |
|
Accept UDP packets from any host. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Accept UDP packets from any Session Traversal Utilities for NAT (STUN) host. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Policy ID. |
|
IP Pool names. |
|
Name of profile group. |
|
Name of an existing Protocol options profile. |
|
Determine whether the firewall policy allows security profile groups or single profiles only. choice | single | Do not allow security profile groups. choice | group | Allow security profile groups. Choices:
|
|
Enable MAC authentication bypass. The bypassed MAC address must be received from RADIUS server. choice | disable | Disable MAC authentication bypass. choice | enable | 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. |
|
Enable/disable RADIUS single sign-on (RSSO). choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Address names if this is an RTP NAT policy. |
|
Enable Real Time Protocol (RTP) NAT. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Block or monitor connections to Botnet servers or disable Botnet scanning. choice | disable | Do not scan connections to botnet servers. choice | block | Block connections to botnet servers. choice | monitor | Log connections to botnet servers. Choices:
|
|
Schedule name. |
|
Enable to force current sessions to end when the schedule object times out. choice | disable | Disable schedule timeout. choice | enable | Enable schedule timeout. Choices:
|
|
Enable to send a reply when a session is denied or blocked by a firewall policy. choice | disable | Disable deny-packet sending. choice | enable | Enable deny-packet sending. Choices:
|
|
Service and service group names. |
|
When enabled service specifies what the service must NOT be. choice | disable | Disable negated service match. choice | enable | Enable negated service match. Choices:
|
|
TTL in seconds for sessions accepted by this policy (0 means use the system default session TTL). |
|
Name of an existing Spam filter profile. |
|
Source address and address group names. |
|
When enabled srcaddr specifies what the source address must NOT be. choice | disable | Disable source address negate. choice | enable | Enable source address negate. Choices:
|
|
Incoming (ingress) interface. |
|
Name of an existing SSH filter profile. |
|
Enable to copy decrypted SSL traffic to a FortiGate interface (called SSL mirroring). choice | disable | Disable SSL mirror. choice | enable | Enable SSL mirror. Choices:
|
|
SSL mirror interface name. |
|
Name of an existing SSL SSH profile. |
|
Enable or disable this policy. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Receiver TCP maximum segment size (MSS). |
|
Sender TCP maximum segment size (MSS). |
|
Enable/disable creation of TCP session without SYN flag. choice | all | Enable TCP session without SYN. choice | data-only | Enable TCP session data only. choice | disable | Disable TCP session without SYN. Choices:
|
|
Enable/disable sending RST packets when TCP sessions expire. choice | disable | Disable sending of RST packet upon TCP session expiration. choice | enable | Enable sending of RST packet upon TCP session expiration. Choices:
|
|
Traffic shaper. |
|
Reverse traffic shaper. |
|
URL category ID list. |
|
Names of individual users that can authenticate with this policy. |
|
Enable to add one or more security profiles (AV, IPS, etc.) to the firewall policy. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
VLAN forward direction user priority | 255 passthrough, 0 lowest, 7 highest. |
|
VLAN reverse direction user priority | 255 passthrough, 0 lowest, 7 highest.. |
|
Set VLAN filters. |
|
Name of an existing VoIP profile. |
|
EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. |
|
VPN Destination Node Host. |
|
VPN Destination Node Seq. |
|
VPN Destination Node Seq. |
|
EXPERTS ONLY! KNOWLEDGE OF FMGR JSON API IS REQUIRED! List of multiple child objects to be added. Expects a list of dictionaries. Dictionaries must use FortiManager API parameters, not the ansible ones listed below. If submitted, all other prefixed sub-parameters ARE IGNORED. This object is MUTUALLY EXCLUSIVE with its options. We expect that you know what you are doing with these list parameters, and are leveraging the JSON API Guide. |
|
VPN Source Node Host. |
|
VPN Source Node Seq. |
|
VPN Source Node. |
|
Policy-based IPsec VPN | name of the IPsec VPN Phase 1. |
|
Name of an existing Web application firewall profile. |
|
Enable/disable WAN optimization. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
WAN optimization auto-detection mode. choice | active | Active WAN optimization peer auto-detection. choice | passive | Passive WAN optimization peer auto-detection. choice | off | Turn off WAN optimization peer auto-detection. Choices:
|
|
WAN optimization passive mode options. This option decides what IP address will be used to connect server. choice | default | Allow client side WAN opt peer to decide. choice | transparent | Use address of client to connect to server. choice | non-transparent | Use local FortiGate address to connect to server. Choices:
|
|
WAN optimization peer. |
|
WAN optimization profile. |
|
Enable/disable forwarding traffic matching this policy to a configured WCCP server. choice | disable | Disable WCCP setting. choice | enable | Enable WCCP setting. Choices:
|
|
Enable/disable web cache. choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
|
Enable/disable web cache for HTTPS. choice | disable | Disable web cache for HTTPS. choice | enable | Enable web cache for HTTPS. Choices:
|
|
Name of an existing Web filter profile. |
|
Enable/disable WiFi Single Sign On (WSSO). choice | disable | Disable setting. choice | enable | Enable setting. Choices:
|
Notes
Note
Full Documentation at https://ftnt-ansible-docs.readthedocs.io/en/latest/.
Examples
- name: ADD VERY BASIC IPV4 POLICY WITH NO NAT (WIDE OPEN)
community.fortios.fmgr_fwpol_ipv4:
mode: "set"
adom: "ansible"
package_name: "default"
name: "Basic_IPv4_Policy"
comments: "Created by Ansible"
action: "accept"
dstaddr: "all"
srcaddr: "all"
dstintf: "any"
srcintf: "any"
logtraffic: "utm"
service: "ALL"
schedule: "always"
- name: ADD VERY BASIC IPV4 POLICY WITH NAT AND MULTIPLE ENTRIES
community.fortios.fmgr_fwpol_ipv4:
mode: "set"
adom: "ansible"
package_name: "default"
name: "Basic_IPv4_Policy_2"
comments: "Created by Ansible"
action: "accept"
dstaddr: "google-play"
srcaddr: "all"
dstintf: "any"
srcintf: "any"
logtraffic: "utm"
service: "HTTP, HTTPS"
schedule: "always"
nat: "enable"
users: "karen, kevin"
- name: ADD VERY BASIC IPV4 POLICY WITH NAT AND MULTIPLE ENTRIES AND SEC PROFILES
community.fortios.fmgr_fwpol_ipv4:
mode: "set"
adom: "ansible"
package_name: "default"
name: "Basic_IPv4_Policy_3"
comments: "Created by Ansible"
action: "accept"
dstaddr: "google-play, autoupdate.opera.com"
srcaddr: "corp_internal"
dstintf: "zone_wan1, zone_wan2"
srcintf: "zone_int1"
logtraffic: "utm"
service: "HTTP, HTTPS"
schedule: "always"
nat: "enable"
users: "karen, kevin"
av_profile: "sniffer-profile"
ips_sensor: "default"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
full API response, includes status code and message Returned: always |
Authors
Luke Weighall (@lweighall)
Andrew Welsh (@Ghilli3)
Jim Huber (@p4r4n0y1ng)