Disable fail2ban
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
14
hosts/common/configs/system/fail2ban/default.nix
Normal file
14
hosts/common/configs/system/fail2ban/default.nix
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
environment.persistence."/persist/state"."/var/lib/fail2ban" = { };
|
||||||
|
|
||||||
|
services.fail2ban = {
|
||||||
|
enable = true;
|
||||||
|
bantime = "24h";
|
||||||
|
bantime-increment = {
|
||||||
|
enable = true;
|
||||||
|
maxtime = "720h";
|
||||||
|
overalljails = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@@ -1,31 +1,15 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
environment = {
|
environment.systemPackages = with pkgs; [
|
||||||
systemPackages = with pkgs; [
|
|
||||||
kitty.terminfo
|
kitty.terminfo
|
||||||
tmux.terminfo
|
tmux.terminfo
|
||||||
];
|
];
|
||||||
|
|
||||||
persistence."/persist/state"."/var/lib/fail2ban" = { };
|
services.openssh = {
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
|
||||||
openssh = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
PasswordAuthentication = false;
|
PasswordAuthentication = false;
|
||||||
PrintMotd = false;
|
PrintMotd = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
fail2ban = {
|
|
||||||
enable = true;
|
|
||||||
bantime = "24h";
|
|
||||||
bantime-increment = {
|
|
||||||
enable = true;
|
|
||||||
maxtime = "720h";
|
|
||||||
overalljails = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,6 @@ in
|
|||||||
networking.firewall.interfaces.wg0.allowedTCPPorts = [
|
networking.firewall.interfaces.wg0.allowedTCPPorts = [
|
||||||
9100
|
9100
|
||||||
9882
|
9882
|
||||||
9191
|
|
||||||
];
|
];
|
||||||
|
|
||||||
virtualisation.quadlet.containers = {
|
virtualisation.quadlet.containers = {
|
||||||
@@ -55,11 +54,5 @@ in
|
|||||||
volumes = [ "/run/podman/podman.sock:/run/podman/podman.sock:ro" ];
|
volumes = [ "/run/podman/podman.sock:/run/podman/podman.sock:ro" ];
|
||||||
exec = [ "--collector.enable-all" ];
|
exec = [ "--collector.enable-all" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
prometheus-fail2ban-exporter.containerConfig = {
|
|
||||||
image = "docker-archive:${selfPkgs.docker-prometheus-fail2ban-exporter}";
|
|
||||||
publishPorts = [ "9191:9191/tcp" ];
|
|
||||||
volumes = [ "/run/fail2ban/fail2ban.sock:/var/run/fail2ban/fail2ban.sock:ro" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -62,12 +62,6 @@ in
|
|||||||
exec = [ "--collector.enable-all" ];
|
exec = [ "--collector.enable-all" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
prometheus-fail2ban-exporter.containerConfig = {
|
|
||||||
image = "docker-archive:${selfPkgs.docker-prometheus-fail2ban-exporter}";
|
|
||||||
publishPorts = [ "9191:9191/tcp" ];
|
|
||||||
volumes = [ "/run/fail2ban/fail2ban.sock:/var/run/fail2ban/fail2ban.sock:ro" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
prometheus-smartctl-exporter.containerConfig = {
|
prometheus-smartctl-exporter.containerConfig = {
|
||||||
image = "docker-archive:${selfPkgs.docker-prometheus-smartctl-exporter}";
|
image = "docker-archive:${selfPkgs.docker-prometheus-smartctl-exporter}";
|
||||||
publishPorts = [ "9633:9633/tcp" ];
|
publishPorts = [ "9633:9633/tcp" ];
|
||||||
@@ -169,19 +163,6 @@ in
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
|
||||||
job_name = "${hostname}-fail2ban-exporter";
|
|
||||||
static_configs = [
|
|
||||||
{
|
|
||||||
targets = [ "host.containers.internal:9191" ];
|
|
||||||
labels = {
|
|
||||||
app = "fail2ban-exporter";
|
|
||||||
user = "root";
|
|
||||||
inherit hostname;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
job_name = "${hostname}-smartctl-exporter";
|
job_name = "${hostname}-smartctl-exporter";
|
||||||
static_configs = [
|
static_configs = [
|
||||||
@@ -221,19 +202,6 @@ in
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
|
||||||
job_name = "${jupiterVpsHostname}-fail2ban-exporter";
|
|
||||||
static_configs = [
|
|
||||||
{
|
|
||||||
targets = [ "10.0.0.1:9191" ];
|
|
||||||
labels = {
|
|
||||||
app = "fail2ban-exporter";
|
|
||||||
user = "root";
|
|
||||||
hostname = jupiterVpsHostname;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
Reference in New Issue
Block a user