mirror of
https://github.com/sophos/sophos-firewall-sdk.git
synced 2026-04-27 00:25:49 +03:00
[PR #95] [MERGED] feat: Manage WebFilter Policies and User Activities #92
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/sophos-firewall-sdk#92
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/sophos/sophos-firewall-sdk/pull/95
Author: @mamullen13316
Created: 6/30/2025
Status: ✅ Merged
Merged: 6/30/2025
Merged by: @mamullen13316
Base:
main← Head:web_policy📝 Commits (3)
7104266feat: webfilterpolicy and useractivity managementb5c8d20fix: take out the debugging statements73cfc7cupdate workflow📊 Changes
7 files changed (+666 additions, -2 deletions)
View changed files
📝
.github/workflows/documentation.yaml(+1 -1)📝
pyproject.toml(+1 -1)📝
sophosfirewall_python/firewallapi.py(+163 -0)➕
sophosfirewall_python/templates/createuseractivity.j2(+22 -0)➕
sophosfirewall_python/templates/createwebfilterpolicy.j2(+61 -0)➕
sophosfirewall_python/templates/updatewebfilterpolicy.j2(+102 -0)➕
sophosfirewall_python/web.py(+316 -0)📄 Description
Provide ability to manage WebFilter Policies and User Activities as mentioned in Issue 94
Setup
Listing and retrieving existing Web Policies
Creating, modifying, and deleting Web Policies
Creating
Modifying
Any of the policy settings can be modified, however for rules we can only support
addandreplaceoptions. This is because the individual rules do not have any single identifier such as a name. To match a rule for modify or delete operations would be difficult due to the numerous settings in each rule that would have to match exactly to the input provided by therulesargument. If an individual rule needs to be modified, to work around this would require defining all of the rules that are needed in the policy in therulesargument and then userule_action='replace'.Deleting
We can use the generic
removemethod.Creating custom User Activities (e.g., specific categories or URL groups)
The new functionality included with this PR is creation of User Activities. Management of URL Groups is already available using
create_urlgroup()andupdate_urlgroup. We have not addressed creating custom Categories in this PR.Creating
Assigning User Activities to Web Policies or directly to specific users
Retrieving existing User Activities for audit purposes