1 { pkgs, lib, config, hosts, ... }:
3 services.openssh.logLevel = "VERBOSE";
4 services.postgresql.logLinePrefix = "%h ";
6 systemd.services.nftables.postStart = '' systemctl reload fail2ban '';
10 banaction = "nftables-multiport";
11 banaction-allports = "nftables-allports";
15 formula = "ban.Time * (1 << min(ban.Count, 20)) * banFactor";
21 packageFirewall = pkgs.nftables;
32 hosts.mermet.extraArgs.ipv4
33 "losurdo.sourcephile.fr"
55 environment.etc."fail2ban/action.d/nftables-common.local".text = ''
59 environment.etc."fail2ban/filter.d/postgresql.local".text = ''
63 _daemon = postgresql-start
65 journalmatch = _SYSTEMD_UNIT=postgresql.service + _COMM=postgres
66 prefregex = ^<F-MLFID>%(__prefix_line)s</F-MLFID><F-CONTENT>.+</F-CONTENT>$
67 failregex = ^<HOST>\s+FATAL:\s*no pg_hba.conf entry for host.+$
68 ^<HOST>\s+FATAL:\s*no PostgreSQL user name specified in startup packet.+$
69 ^<HOST>\s+FATAL:\s*password authentication failed for user.+$
70 ^<HOST>\s+FATAL:\s*unsupported frontend protocol.+$
72 #ignoreregex = duration: