Skip to content
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/wireguard: set networking.firewall.allowedUDPPorts automatically #60124

Closed

Conversation

spacekookie
Copy link
Member

Motivation for this change

This changes the wireguard module to automatically add the provided
listenPort for an interface to the list of allowed udp ports in the
firewall. This means that users don't have to do this themselves when
configuring a wireguard server.
It also adjusts the wireguard test to not rely on explicitly-set
firewall ports

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@spacekookie spacekookie force-pushed the wireguard-automatic-firewall branch 2 times, most recently from cc75535 to e72eeea Compare April 23, 2019 21:40
This changes the wireguard module to automatically add the provided
`listenPort` for an interface to the list of allowed udp ports in the
firewall. This means that users don't have to do this themselves when
configuring a wireguard server.
@grahamc
Copy link
Member

grahamc commented Apr 23, 2019

We typically don't want to do this, with the notable exception of openssh. This is because it is easy for users to add this configuration setting, but difficult for users to remove it. I would personally prefer we not do this, even though I do understand that it makes common case configuration easier.

@alyssais
Copy link
Member

When would you want to set a listen port, but not make it accessible?

@grahamc
Copy link
Member

grahamc commented Apr 23, 2019

For example, I might want to make it accessible on some interfaces but not others.

@alyssais
Copy link
Member

alyssais commented Apr 23, 2019 via email

@spacekookie
Copy link
Member Author

We typically don't want to do this, with the notable exception of openssh. This is because it is easy for users to add this configuration setting, but difficult for users to remove it. I would personally prefer we not do this, even though I do understand that it makes common case configuration easier.

Alright, yea that makes sense.

I couldn't find any issues/ PRs where this rationale had been pointed out explicitly before. So I guess this is now documentation 😅

@spacekookie spacekookie deleted the wireguard-automatic-firewall branch May 11, 2019 18:43
@spacekookie spacekookie restored the wireguard-automatic-firewall branch May 11, 2019 18:43
@Ma27 Ma27 mentioned this pull request Aug 10, 2020
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants