summaryrefslogtreecommitdiff
path: root/modules/system/access
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-05 02:14:50 -0700
committerFuwn <[email protected]>2024-09-05 02:14:50 -0700
commit21db2e5762854966fb735e68d001e4ab6dbbbcbf (patch)
treeabb082f3a762b9dcddb66ece6dc5cbfcd314fb9f /modules/system/access
parentBump: docker (diff)
downloadnixos-config-21db2e5762854966fb735e68d001e4ab6dbbbcbf.tar.xz
nixos-config-21db2e5762854966fb735e68d001e4ab6dbbbcbf.zip
Bump
Diffstat (limited to 'modules/system/access')
-rw-r--r--modules/system/access/ssh.nix45
1 files changed, 27 insertions, 18 deletions
diff --git a/modules/system/access/ssh.nix b/modules/system/access/ssh.nix
index b1fc187..8a2b30d 100644
--- a/modules/system/access/ssh.nix
+++ b/modules/system/access/ssh.nix
@@ -1,26 +1,35 @@
+{ lib, config, ... }:
{
programs.ssh.startAgent = false;
- services.openssh = {
- enable = true;
- ports = [ 22 ];
- openFirewall = false;
+ services = {
+ fail2ban.jails.sshd.settings = {
+ enabled = true;
+ filter = "sshd[mode=aggressive]";
+ port = lib.strings.concatStringsSep "," (map toString config.services.openssh.ports);
+ };
+
+ openssh = {
+ enable = true;
+ ports = [ 22 ];
+ openFirewall = false;
- settings = {
- KexAlgorithms = [
- "curve25519-sha256"
- "diffie-hellman-group16-sha512"
- "diffie-hellman-group18-sha512"
- "diffie-hellman-group-exchange-sha256"
- ];
+ settings = {
+ KexAlgorithms = [
+ "curve25519-sha256"
+ "diffie-hellman-group16-sha512"
+ "diffie-hellman-group18-sha512"
+ "diffie-hellman-group-exchange-sha256"
+ ];
- Macs = [
- ];
+ Macs = [
+ ];
+ };
};
};
}