summaryrefslogtreecommitdiff
path: root/nixos/hosts/apocalypse/firewall.nix
diff options
context:
space:
mode:
authorJakub Stachurski <j.stachurski@student.utwente.nl>2025-05-03 21:49:42 +0200
committerJakub Stachurski <j.stachurski@student.utwente.nl>2025-05-03 21:49:42 +0200
commit40f6e567cd1c8bd893d92b40487571847799c647 (patch)
tree72c6e1eb975ca4fa25fd9ac4a1f4116e19772f9f /nixos/hosts/apocalypse/firewall.nix
parent57dde93d6059cd476bc5e196e0cef348f6544085 (diff)
firewall
Diffstat (limited to 'nixos/hosts/apocalypse/firewall.nix')
-rw-r--r--nixos/hosts/apocalypse/firewall.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/nixos/hosts/apocalypse/firewall.nix b/nixos/hosts/apocalypse/firewall.nix
new file mode 100644
index 0000000..2068d55
--- /dev/null
+++ b/nixos/hosts/apocalypse/firewall.nix
@@ -0,0 +1,47 @@
+{pkgs, config, ...}:
+let
+ baseTCP = [
+
+ ];
+ baseUDP = [
+ 16555 # Wireguard
+ ];
+ baseTCPRanges = [
+ { from = 1714; to = 1764; } # KDE-CONNECT
+ ];
+ baseUDPRanges = [
+ { from = 1714; to = 1764; } # KDE-CONNECT
+ ];
+
+ secureTCP = [
+ 22 80 433 5900
+ ] ++ baseTCP;
+
+ secureUDP = [
+
+ ] ++ baseUDP;
+
+ secureTCPRanges = [
+
+ ] ++ baseTCPRanges ;
+ secureUDPRanges = [
+
+ ] ++ baseUDPRanges;
+in
+{
+ networking.firewall {
+ enable = true;
+ allowedTCPPorts = baseTCP;
+ allowedUDPPorts = baseUDP;
+ allowedUDPPortRanges = baseUDPRanges;
+ allowedTCPPortRanges = baseTCPRanges;
+ interfaces = {
+ "wg0" = {
+ allowedTCPPorts = secureTCP;
+ allowedUDPorts = secureUDP;
+ allowedUDPPortRanges = secureUDPRanges;
+ allowedTCPPortRanges = secureTCPRanges;
+ };
+ };
+}
+