-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
nixos/opensnitch: Add module for opensnitch #132319
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.
Great module. Would merge as is. I have left some comments... they are all nitpicks, though. Hopefully nothing too annoying. If you want a hand with anything, or strongly disagree, please do mention.
Would it be possible in a future PR to read in the NixOS firewall rules and apply them here as well?
| a package's store path. Intended for process rules | ||
| which should survive NixOS updates. | ||
| ''; | ||
| default = with pkgs; [ nix ]; |
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.
I believe the same comment about default above applies here as well...
|
I reworked this PR and module which now simply enables the opensnitch systemd service. Depends on including systemd unit files in opensnitch package. |
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.
@onny sorry for the delay. All tested, ready to merge? LGTM 👍
|
It works fine but it depends on this PR #137679 :) |
|
#137679 got merged and this PR is ready to go ;) |
|
@onny awesome stuff. What are the plans from here? Once the ui is in place what happens if a sysadmin has set rules with the NixOS firewall declaratively? If a user modifies these NixOS rules with Thoughts? |
|
Stuff like this is when you kinda wish github added all the stars/bouquets one has received :) |
|
For anyone only following the "latest" post- rules are in /var/lib/opensnitch/rules Also, for those who didn't know, like me, opensnitch bundles adblocking too (https://github.com/evilsocket/opensnitch/blob/be32ddc574f70157e214f9018ea42e4b24148202/utils/legacy/make_ads_rules.py), although looks like this has some hardcoded paths too. A bit of suggestion for future work "to whomsoever it might concern :)" Ideally there would be "nixy" way of specifying rules so that every update doesn't need me to recreate all the rules (would get boring soon). A starting point for that work could be https://github.com/evilsocket/opensnitch/blob/8d3540f7f95b40afdd44255ab0ab22ce23cbd333/daemon/rule/rule.go. So I envisage an array of options with the fields same as the |
I'm planning to add the UI part as a service/module to home-manager. I'm only using it to ask for all apps as default without any predefined rules. So this is not my use case and maybe someone else could add further config options? |
Motivation for this change
Opensnitch is one of the few Linux application firewalls. It is well maintained and we already have a package for it in Nixpkgs. As requested in this issue, this PR provides a module for OpenSnitch.
This PR is a continuation of an earlier one. It just enables the systemd service without any further configuration, which is not needed for using the daemon.
It depends on an other PR for including systemd unit files in the opensnitch package.
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)