-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
T7147: Import Large Network Sets to Firewall Group From File #4341
base: current
Are you sure you want to change the base?
Conversation
👍 |
For the op command, I don't add all because:
|
When I make changes to firewall groups in config mode, all nftables using groups are updated. Is there any mechanism I can invoke in op mode? |
How is this different from T5493 ? |
I read the changes in that PR, he added a new type of group, but I don't see how he uses such group. I would say, the so-called 'remote' should just be a different source for each type of group(embedded in config tree, local file or remote url), but not a new group type. In my case I planned to say from file or url, but I see many different file formats for china route lists, and there is no standards. So I create this PR with least thing which I think VyOS should support, which is loading from a file under Other type of groups can be also added in similar way. |
CI integration ❌ failed! Details
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR introduces a new feature to import large network sets into firewall groups from a file and adds an operation command to update firewall groups from file data. Key changes include:
- Adding a source-file parameter to relevant firewall and network-group configurations.
- Implementing the op command update firewall-groups for nat and policy configurations.
- Updating validation in firewall group configuration to prevent mutually exclusive use of network and file source data.
Reviewed Changes
File | Description |
---|---|
src/helpers/firewall-group-update.py | New helper for retrieving and merging firewall group configuration. |
python/vyos/firewall.py | New implementation of firewall_group_update for op command support. |
src/conf_mode/firewall.py | Extended configuration verification to enforce exclusive parameters in network groups. |
python/vyos/template.py | Added a new Jinja2 filter for nested group processing with file-sourced lists. |
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/conf_mode/firewall.py:445
- Error message on line 449 refers to 'source-file' while the code checks for 'source_file'. Consider using consistent naming for clarity.
if 'network_group' in firewall['group']:
Change summary
source-file
to firewall/group/network-group (ipv6-network-group)update firewall-groups
to update sets from fileOp command updates:
Following with group_tmpl not updated:
Types of changes
Related Task(s)
https://vyos.dev/T7147
Related PR(s)
How to test / Smoketest result
Passed
Checklist: