mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-08-27 22:04:09 +02:00
security: make firewall secure-by-default, disable explicitly on servers
Flip the base firewall default to ON so new hosts are protected by default. Servers keep the firewall off (trusted internal LAN, WAN protected at the router) via explicit overrides in modules/nixos/server/{server,server-aarch64}.nix. Behavior-preserving for all 18 current hosts; adds a security-firewall eval test guarding the per-host state.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
# Or disable the firewall altogether.
|
||||
networking.firewall.enable = lib.mkDefault false;
|
||||
# Secure by default: firewall ON everywhere unless a host explicitly disables it
|
||||
# (servers disable it in modules/nixos/server/{server,server-aarch64}.nix).
|
||||
networking.firewall.enable = lib.mkDefault true;
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
../../base
|
||||
];
|
||||
|
||||
# Servers run on the trusted internal LAN (NAT'd; WAN protected at the router).
|
||||
# Keep the firewall off here; the secure default is ON (see modules/nixos/base/ssh.nix).
|
||||
networking.firewall.enable = false;
|
||||
|
||||
# Fix: jasper is marked as broken, refusing to evaluate.
|
||||
environment.enableAllTerminfo = lib.mkForce false;
|
||||
}
|
||||
|
||||
@@ -4,4 +4,8 @@
|
||||
../base
|
||||
../../base
|
||||
];
|
||||
|
||||
# Servers run on the trusted internal LAN (NAT'd; WAN protected at the router).
|
||||
# Keep the firewall off here; the secure default is ON (see modules/nixos/base/ssh.nix).
|
||||
networking.firewall.enable = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user