blob: 8d3aa3da3273f874fd53db74d2c4ad6d6537a8b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
{ lib, config, pkgs, ... }:
with lib; let
cfg = config.local.net.fail2ban;
inherit (config.local) nets;
in
{
options.local.net.fail2ban = {
enable = mkEnableOption "fail2ban";
};
config = mkIf cfg.enable {
services.fail2ban = {
enable = true;
bantime = "10m";
bantime-increment = {
enable = true;
maxtime = "48h";
rndtime = "10m";
overalljails = true;
};
ignoreIP = [
nets.static-vpn.v6.cidr
nets.gate-srv.v6.cidr
nets.gate-public.hosts.gate.v4.address
nets.gate-public.hosts.gate.v6.address
];
};
};
}
|