add vpn addresses to fail2ban whitelist
This commit is contained in:
parent
4a7bda944f
commit
7f692459a9
|
@ -3,7 +3,9 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; {
|
with lib; let
|
||||||
|
inherit (config.local.sys) nets;
|
||||||
|
in {
|
||||||
networking = {
|
networking = {
|
||||||
nftables.enable = false; # learn how to use this later
|
nftables.enable = false; # learn how to use this later
|
||||||
firewall = {
|
firewall = {
|
||||||
|
@ -52,7 +54,11 @@ with lib; {
|
||||||
fail2ban = {
|
fail2ban = {
|
||||||
enable = true;
|
enable = true;
|
||||||
bantime = "10m";
|
bantime = "10m";
|
||||||
ignoreIP = ["37.205.12.34"]; # Never ban the server's own IP
|
ignoreIP = [
|
||||||
|
nets.default.hosts.vps.v6.cidr
|
||||||
|
nets.default.hosts.vps.v4.address
|
||||||
|
nets.vpn.v6.cidr
|
||||||
|
];
|
||||||
bantime-increment = {
|
bantime-increment = {
|
||||||
enable = true;
|
enable = true;
|
||||||
formula = "ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)";
|
formula = "ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)";
|
||||||
|
|
Loading…
Reference in a new issue