2024-03-03 18:06:28 -05:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
libS,
|
|
|
|
...
|
|
|
|
}:
|
2023-12-29 20:54:12 +01:00
|
|
|
|
2024-03-03 18:06:28 -05:00
|
|
|
let
|
|
|
|
cfg = config.services.fail2ban;
|
|
|
|
in
|
|
|
|
{
|
2024-02-05 22:45:43 +01:00
|
|
|
options.services.fail2ban.recommendedDefaults = libS.mkOpinionatedOption "use fail2ban with recommended defaults";
|
2023-12-29 20:54:12 +01:00
|
|
|
|
|
|
|
config.services.fail2ban = lib.mkIf cfg.recommendedDefaults {
|
|
|
|
maxretry = 5;
|
|
|
|
bantime = "24h";
|
|
|
|
bantime-increment = {
|
|
|
|
enable = true;
|
|
|
|
formula = "ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)";
|
|
|
|
maxtime = "168h";
|
|
|
|
overalljails = true;
|
|
|
|
};
|
|
|
|
};
|
2024-01-02 16:30:08 +01:00
|
|
|
}
|