mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 08:06:50 +01:00
feat: add fail2ban and scrutiny
This commit is contained in:
parent
4e8afa2dfc
commit
d45f6a9359
6 changed files with 107 additions and 6 deletions
36
modules/homelab/security.nix
Normal file
36
modules/homelab/security.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
lib.mkIf config.fireproof.homelab.enable {
|
||||
services.fail2ban = {
|
||||
enable = true;
|
||||
maxretry = 5;
|
||||
ignoreIP = [
|
||||
"127.0.0.1/8"
|
||||
"10.0.0.0/8"
|
||||
"172.16.0.0/12"
|
||||
"192.168.0.0/16"
|
||||
];
|
||||
jails = {
|
||||
nginx-http-auth.settings = {
|
||||
enabled = true;
|
||||
filter = "nginx-http-auth";
|
||||
port = "http,https";
|
||||
logpath = "/var/log/nginx/error.log";
|
||||
};
|
||||
nginx-botsearch.settings = {
|
||||
enabled = true;
|
||||
filter = "nginx-botsearch";
|
||||
port = "http,https";
|
||||
logpath = "/var/log/nginx/error.log";
|
||||
};
|
||||
nginx-bad-request.settings = {
|
||||
enabled = true;
|
||||
port = "http,https";
|
||||
logpath = "/var/log/nginx/error.log";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue