1 { pkgs, lib, config, machines, ... }:
3 services.openssh.logLevel = "VERBOSE";
4 services.postgresql.settings.log_line_prefix = "%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 machines.mermet.extraArgs.ipv4
33 machines.mermet.extraArgs.wireguard.wg-intra.ipv4
34 "losurdo.sourcephile.fr"
56 environment.etc."fail2ban/action.d/nftables-common.local".text = ''
60 environment.etc."fail2ban/filter.d/postgresql.local".text = ''
64 _daemon = postgresql-start
66 journalmatch = _SYSTEMD_UNIT=postgresql.service + _COMM=postgres
67 prefregex = ^<F-MLFID>%(__prefix_line)s</F-MLFID><F-CONTENT>.+</F-CONTENT>$
68 failregex = ^<HOST>\s+FATAL:\s*no pg_hba.conf entry for host.+$
69 ^<HOST>\s+FATAL:\s*no PostgreSQL user name specified in startup packet.+$
70 ^<HOST>\s+FATAL:\s*password authentication failed for user.+$
71 ^<HOST>\s+FATAL:\s*unsupported frontend protocol.+$
73 #ignoreregex = duration: