blob: 998de217ff2060d56ba30e2a4dec8e4d1bac7505 (
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
34
|
{ 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.vpn0.v4.cidr
nets.gate0.v4.cidr
nets.gate0.v6.cidr
nets.gate-public.hosts.gate.v4.address
nets.gate-public.hosts.gate.v6.address
];
};
};
}
|