-
-
Notifications
You must be signed in to change notification settings - Fork 707
[client] Set up firewall rules for dns routes dynamically based on dns response #3702
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
Conversation
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.
Pull Request Overview
This PR implements dynamic DNS route firewall rules by introducing new types and function signatures throughout the codebase to replace raw netip.Prefix values with a more expressive firewall.Network type. It also adjusts DNS forwarder logic and updates various firewall manager implementations (nftables and iptables) to integrate with the new dynamic routing and DNS forwarding functionality.
- Updated function signatures to use firewall.Network instead of netip.Prefix.
- Refactored DNS forwarder functions to work with new entry types.
- Modified rule generation in both nftables and iptables logic to support dynamic ipset updates.
Reviewed Changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
client/internal/engine.go | Adjusted DNS forwarder configuration and route update ordering. |
client/internal/dnsfwd/* | Refactored DNS forwarder and its tests to use ForwarderEntry structs. |
client/internal/acl/* | Minor logging message update in ACL rule application. |
client/firewall/* | Updated API calls and structures to accommodate the new firewall.Network type, and refactored iptables/nftables rule creation. |
client/firewall/manager/* | Replaced old GenerateSetName calls with NewPrefixSet and updated tests accordingly. |
Comments suppressed due to low confidence (1)
client/internal/dnsfwd/forwarder.go:240
- In the getMatchingEntries function, when multiple entries score equally, only the latter is chosen. Consider explicitly handling ties to ensure the most appropriate match is selected.
for _, entry := range f.fwdEntries {
ef668dd
to
db2a803
Compare
|
Describe your changes
This PR enhances NetBird's firewall implementation by replacing static wide firewall rules for DNS routes with dynamic rule generation.
Issue ticket number and link
Stack
Checklist