sophos.sophos_firewall.sfos_firewall_rule module – Manage Firewall Rules (Protect > Rules & policies)
Note
This module is part of the sophos.sophos_firewall collection (version 2.0.1).
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 sophos.sophos_firewall
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: sophos.sophos_firewall.sfos_firewall_rule
.
New in sophos.sophos_firewall 1.0.0
Synopsis
Creates, updates or removes firewall rules (Protect > Rules & policies) on Sophos Firewall
Requirements
The below requirements are needed on the host that executes this module.
sophosfirewall-python
Beginning in version 2.0.0, this module requires use of an httpapi connection plugin. See the HTTPAPI example for details.
Parameters
Parameter |
Comments |
---|---|
The rule action. Choices:
|
|
Name of the rule to insert this rule after. |
|
Name of the rule to insert this rule before. |
|
Rule description. |
|
Destination network(s). |
|
Destination zone(s). |
|
Enable or disable logging. Choices:
|
|
Name of the firewall rule to create, update, or delete |
|
Indicates where the rule should be inserted. Choices:
|
|
Name of service(s). |
|
Source network(s). |
|
Source zone(s). |
|
Use Choices:
|
|
Enabled or Disabled state of the rule Choices:
|
Examples
- name: Create Firewall Rule
sophos.sophos_firewall.sfos_firewall_rule:
name: TEST RULE 100
after_rulename: TEST RULE 99
action: accept
description: Test rule created by Ansible
log: enable
status: enable
position: bottom
src_zones:
- LAN
dst_zones:
- WAN
src_networks:
- SRCNET1
- SRCNET2
dst_networks:
- DSTNET1
- DSTNET2
service_list:
- HTTPS
- SSH
state: present
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Serialized object containing the API response. Returned: always |
Collection links
Warning
If the firewall is a member of a group in Central, the changes made by Ansible will override the settings of the group. The actual configuration on the firewall may then differ from what is displayed for the same setting in the Central group.