1 { pkgs, lib, config, machines, ... }:
3 #services.sshd.logLevel = "VERBOSE";
4 services.postgresql.extraConfig = "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.losurdo.extraArgs.ipv4
25 "198.252.154.1" # wren.riseup.net
46 environment.etc."fail2ban/action.d/nftables-common.local".text = ''
50 environment.etc."fail2ban/filter.d/postgresql.local".text = ''
54 _daemon = postgresql-start
56 journalmatch = _SYSTEMD_UNIT=postgresql.service + _COMM=postgres
57 prefregex = ^<F-MLFID>%(__prefix_line)s</F-MLFID><F-CONTENT>.+</F-CONTENT>$
58 failregex = ^<HOST>\s+FATAL:\s*no pg_hba.conf entry for host.+$
59 ^<HOST>\s+FATAL:\s*no PostgreSQL user name specified in startup packet.+$
60 ^<HOST>\s+FATAL:\s*password authentication failed for user.+$
61 ^<HOST>\s+FATAL:\s*unsupported frontend protocol.+$
63 #ignoreregex = duration: