You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
832 B
Nix
40 lines
832 B
Nix
9 years ago
|
{ config, pkgs, ... }:
|
||
|
|
||
9 years ago
|
with pkgs.lib;
|
||
|
|
||
|
let
|
||
|
cfg = config.r6d.config-generator;
|
||
9 years ago
|
|
||
|
ignoreip = "pedro.dubronetwork.fr cube.dubronetwork.fr voyage.prunetwork.fr xray.prunetwork.fr 192.168.0.0/16 172.16.0.0/16";
|
||
|
destemail = "admins@dubronetwork.fr";
|
||
|
|
||
9 years ago
|
in {
|
||
9 years ago
|
# Gestion de fail2ban
|
||
|
|
||
9 years ago
|
services = mkIf cfg.fail2ban {
|
||
9 years ago
|
fail2ban = {
|
||
|
enable = true;
|
||
|
jails = {
|
||
|
DEFAULT = ''
|
||
|
# "ignoreip" can be an IP address, a CIDR mask or a DNS host
|
||
9 years ago
|
ignoreip = 127.0.0.1/8 ${ignoreip}
|
||
9 years ago
|
|
||
|
# 1 jour
|
||
|
# bantime = 86400
|
||
|
# 5 jours
|
||
|
bantime = 432000
|
||
9 years ago
|
|
||
9 years ago
|
maxretry = 3
|
||
|
|
||
9 years ago
|
destemail = ${destemail}
|
||
9 years ago
|
'';
|
||
|
ssh-route = ''
|
||
|
filter = sshd
|
||
|
action = route[blocktype=blackhole]
|
||
|
maxretry = 3
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|