mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
nixos/fail2ban: add maxretry option
it's not possible to set a different default maxretry value in the DEFAULT jail because the module already does so. expose the maxretry option to the configuration to remedy this. (we can't really remove it entirely because fail2ban defaults to 5)
This commit is contained in:
parent
265d31bcbd
commit
25c827b3cc
@ -62,6 +62,12 @@ in
|
||||
description = "The firewall package used by fail2ban service.";
|
||||
};
|
||||
|
||||
maxretry = mkOption {
|
||||
default = 3;
|
||||
type = types.ints.unsigned;
|
||||
description = "Number of failures before a host gets banned.";
|
||||
};
|
||||
|
||||
banaction = mkOption {
|
||||
default = "iptables-multiport";
|
||||
type = types.str;
|
||||
@ -291,7 +297,7 @@ in
|
||||
''}
|
||||
# Miscellaneous options
|
||||
ignoreip = 127.0.0.1/8 ${optionalString config.networking.enableIPv6 "::1"} ${concatStringsSep " " cfg.ignoreIP}
|
||||
maxretry = 3
|
||||
maxretry = ${toString cfg.maxretry}
|
||||
backend = systemd
|
||||
# Actions
|
||||
banaction = ${cfg.banaction}
|
||||
|
Loading…
Reference in New Issue
Block a user