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;
23 machines.mermet.extraArgs.ipv4
24 machines.mermet.extraArgs.wireguard.wg-intranet.ipv4
25 machines.losurdo.extraArgs.ipv4
26 "198.252.154.1" # wren.riseup.net
47 environment.etc."fail2ban/action.d/nftables-common.local".text = ''
51 environment.etc."fail2ban/filter.d/postgresql.local".text = ''
55 _daemon = postgresql-start
57 journalmatch = _SYSTEMD_UNIT=postgresql.service + _COMM=postgres
58 prefregex = ^<F-MLFID>%(__prefix_line)s</F-MLFID><F-CONTENT>.+</F-CONTENT>$
59 failregex = ^<HOST>\s+FATAL:\s*no pg_hba.conf entry for host.+$
60 ^<HOST>\s+FATAL:\s*no PostgreSQL user name specified in startup packet.+$
61 ^<HOST>\s+FATAL:\s*password authentication failed for user.+$
62 ^<HOST>\s+FATAL:\s*unsupported frontend protocol.+$
64 #ignoreregex = duration: