nixos-config/features/server/harden.nix
Sridhar Ratnakumar c56141af59 cleanup
2022-03-30 14:04:29 -04:00

28 lines
597 B
Nix

{ pkgs, ... }: {
# Firewall
networking.firewall.enable = true;
security.sudo.execWheelOnly = true;
security.auditd.enable = true;
security.audit.enable = true;
services = {
openssh = {
enable = true;
permitRootLogin = "prohibit-password"; # distributed-build.nix requires it
passwordAuthentication = false;
allowSFTP = false;
};
fail2ban = {
enable = true;
ignoreIP = [
# quebec
"70.53.237.50"
];
};
};
nix.settings.allowed-users = [ "root" "srid" ];
nix.settings.trusted-users = [ "root" "srid" ];
}