[PR #93] [MERGED] FIX: Allow Any as src/dest in firewall rules #90

Closed
opened 2026-02-27 23:19:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/sophos/sophos-firewall-sdk/pull/93
Author: @mamullen13316
Created: 5/6/2025
Status: Merged
Merged: 5/6/2025
Merged by: @mamullen13316

Base: mainHead: fw_rule_fix


📝 Commits (3)

  • ccb7d69 update template to exclude src/dest keys if Any is specified. Required in 21.x.
  • 1bc4a4a update version to v0.1.63
  • d00e761 update template to exclude src/dest keys if Any is specified

📊 Changes

3 files changed (+17 additions, -5 deletions)

View changed files

📝 pyproject.toml (+1 -1)
📝 sophosfirewall_python/templates/createfwrule.j2 (+8 -2)
📝 sophosfirewall_python/templates/updatefwrule.j2 (+8 -2)

📄 Description

Previously, when using create_rule() and update_rule() methods, it was not possible to specify Any for src/dest zone, network, or service. Instead, you had to omit the parameters altogether, or specify an empty list to indicate Any. To reduce the likelihood of errors, in this version it is now possible to specify ['Any']. For example:

rule_params = rule_params = dict(
    rulename="ALLOW ALL - DELETE ME",
    position="Bottom",
    description="Allows everything!",
    action="Accept",
    log="Enable",
    src_zones=["Any"],
    dst_zones=["Any"],
    src_networks=["Any"],
    dst_networks=["Any"],
    service_list=["Any"]
)
resp = fw.create_rule(rule_params=rule_params)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/sophos/sophos-firewall-sdk/pull/93 **Author:** [@mamullen13316](https://github.com/mamullen13316) **Created:** 5/6/2025 **Status:** ✅ Merged **Merged:** 5/6/2025 **Merged by:** [@mamullen13316](https://github.com/mamullen13316) **Base:** `main` ← **Head:** `fw_rule_fix` --- ### 📝 Commits (3) - [`ccb7d69`](https://github.com/sophos/sophos-firewall-sdk/commit/ccb7d699bdd42f433f74402f5e4069d3604de6cb) update template to exclude src/dest keys if Any is specified. Required in 21.x. - [`1bc4a4a`](https://github.com/sophos/sophos-firewall-sdk/commit/1bc4a4ae8ab517552974c9fca84fbf572f9b9820) update version to v0.1.63 - [`d00e761`](https://github.com/sophos/sophos-firewall-sdk/commit/d00e76137e78ad38f36676fd641d0c9787380d09) update template to exclude src/dest keys if Any is specified ### 📊 Changes **3 files changed** (+17 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `pyproject.toml` (+1 -1) 📝 `sophosfirewall_python/templates/createfwrule.j2` (+8 -2) 📝 `sophosfirewall_python/templates/updatefwrule.j2` (+8 -2) </details> ### 📄 Description Previously, when using `create_rule()` and `update_rule()` methods, it was not possible to specify `Any` for src/dest zone, network, or service. Instead, you had to omit the parameters altogether, or specify an empty list to indicate `Any`. To reduce the likelihood of errors, in this version it is now possible to specify `['Any']`. For example: ```python rule_params = rule_params = dict( rulename="ALLOW ALL - DELETE ME", position="Bottom", description="Allows everything!", action="Accept", log="Enable", src_zones=["Any"], dst_zones=["Any"], src_networks=["Any"], dst_networks=["Any"], service_list=["Any"] ) resp = fw.create_rule(rule_params=rule_params) ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 23:19:00 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sophos-firewall-sdk#90
No description provided.