diff options
Diffstat (limited to 'config/services')
| -rw-r--r-- | config/services/default.nix | 6 | ||||
| -rw-r--r-- | config/services/fail2ban.nix | 15 | ||||
| -rw-r--r-- | config/services/ssh.nix | 10 |
3 files changed, 31 insertions, 0 deletions
diff --git a/config/services/default.nix b/config/services/default.nix new file mode 100644 index 0000000..366b226 --- /dev/null +++ b/config/services/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./fail2ban.nix + ./ssh.nix + ]; +} diff --git a/config/services/fail2ban.nix b/config/services/fail2ban.nix new file mode 100644 index 0000000..050fb93 --- /dev/null +++ b/config/services/fail2ban.nix @@ -0,0 +1,15 @@ +{ + services.fail2ban = { + enable = true; + + bantime = "30m"; + maxretry = 5; + + bantime-increment = { + enable = true; + maxtime = "3d"; + factor = "4"; + rndtime = "10m"; + }; + }; +} diff --git a/config/services/ssh.nix b/config/services/ssh.nix new file mode 100644 index 0000000..46164ef --- /dev/null +++ b/config/services/ssh.nix @@ -0,0 +1,10 @@ +{ lib, ... }: +{ + services.openssh = { + allowSFTP = false; + settings = { + PermitRootLogin = "no"; + AllowGroups = lib.mkDefault [ "wheel" ]; + }; + }; +} |
