infra/config/network.nix

33 lines
836 B
Nix

{
networking.firewall.enable = true;
services = {
fail2ban = {
enable = true;
bantime-increment.enable = true;
};
openssh = {
enable = true;
openFirewall = true;
allowSFTP = false;
settings = {
AllowAgentForwarding = false;
AllowStreamLocalForwarding = false;
AllowTcpForwarding = true;
AuthenticationMethods = "publickey";
KbdInteractiveAuthentication = false;
KexAlgorithms = [
"curve25519-sha256"
"curve25519-sha256@libssh.org"
"diffie-hellman-group16-sha512"
"diffie-hellman-group18-sha512"
"sntrup761x25519-sha512@openssh.com"
];
PasswordAuthentication = false;
PermitRootLogin = "prohibit-password";
X11Forwarding = false;
};
};
};
}