Automatic Firewall, taking into account the observations from the previous PR#2
Open
mircevski wants to merge 6 commits intomadic-creates:masterfrom
Open
Automatic Firewall, taking into account the observations from the previous PR#2mircevski wants to merge 6 commits intomadic-creates:masterfrom
mircevski wants to merge 6 commits intomadic-creates:masterfrom
Conversation
added 6 commits
May 16, 2025 15:25
…onal VPN auto-dial
…nes inside the script
…of network and, respectively, the trusted networks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
This time I've simplified it quite a lot in terms of lines of code (1 script only / 2 config files) and I've taken into account 2 of your observations:
Your observation: if you have one Wired Connection Network Manager (NM) Profile. This gets activated as soon as a cable is plugged into the device. If you configure to trust this NM profile, it will never create firewall rules. Although, you are possibly connected to an untrusted / unknown network.
My change: I've created another config file that represents another level of decision, basically types of networks that are NOT to be trusted by default. For example WIFI's are not trusted by default, therefore any new WIFI connection gets its Firewall enabled. The old configuration file that represents individual networks that ARE trusted is still in place. This represents the second level of decision, in which a previously NEW/untrusted network can be listed as trusted.
Your observation: NetworkManager provides a firewalld integration. You can configure the firewalld zone per connection. Don't know about other firewall backends.
My change: no more iptables rules and a long script implementing it, but using firewalld's "block"/"public" profiles as the case may be.
Please see if this fits your requirements.
Regards,