blob: ce35c1fa6d569d4b789e67cefa0636d6353a0ccd (
plain) (
blame)
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
|
{
config,
lib,
this,
...
}:
with lib; let
cfg = config.nixfiles.modules.fail2ban;
in {
options.nixfiles.modules.fail2ban.enable =
mkEnableOption "fail2ban";
config = mkIf cfg.enable {
ark.directories = ["/var/lib/fail2ban"];
services.fail2ban = {
enable = true;
bantime-increment = {
enable = true;
maxtime = "24h";
rndtime = "8m";
};
ignoreIP =
optionals (hasAttr "wireguard" this)
(with config.nixfiles.modules.wireguard; [ipv4.subnet ipv6.subnet]);
jails.DEFAULT.settings.blocktype = "DROP";
};
};
}
|