Tom Hubrecht
3c9c38fb03
All checks were successful
Build all the nodes / ap01 (push) Successful in 1m34s
Build all the nodes / geo02 (push) Successful in 2m22s
Build all the nodes / bridge01 (push) Successful in 2m27s
Build all the nodes / hypervisor01 (push) Successful in 2m29s
Build all the nodes / geo01 (push) Successful in 2m30s
Build all the nodes / netcore02 (push) Successful in 34s
Build all the nodes / hypervisor02 (push) Successful in 1m36s
Build all the nodes / compute01 (push) Successful in 3m15s
Build all the nodes / hypervisor03 (push) Successful in 1m46s
Build all the nodes / rescue01 (push) Successful in 1m56s
Build all the nodes / tower01 (push) Successful in 1m43s
Build all the nodes / storage01 (push) Successful in 2m10s
Build all the nodes / vault01 (push) Successful in 2m5s
Build the shell / build-shell (push) Successful in 43s
Run pre-commit on all files / pre-commit (push) Successful in 36s
Build all the nodes / web02 (push) Successful in 1m41s
Build all the nodes / web01 (push) Successful in 2m12s
Build all the nodes / web03 (push) Successful in 1m37s
Also disable the ai filter for nodes that don't have nginx enabled
83 lines
1.6 KiB
Nix
83 lines
1.6 KiB
Nix
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
|
|
#
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
let
|
|
act = a: [
|
|
"nft46"
|
|
"${a} element inet reaction ipvXbans { <ip> }"
|
|
];
|
|
|
|
journalctl = u: [
|
|
"journalctl"
|
|
"-fn0"
|
|
"-u"
|
|
"${u}.service"
|
|
];
|
|
|
|
ban = after: {
|
|
ban.cmd = act "add";
|
|
unban = {
|
|
inherit after;
|
|
|
|
cmd = act "delete";
|
|
};
|
|
};
|
|
in
|
|
|
|
{
|
|
ai-crawlers = {
|
|
cmd = [
|
|
"tail"
|
|
"-n0"
|
|
"-f"
|
|
"/var/log/nginx/access.log"
|
|
];
|
|
|
|
filters.bots = {
|
|
regex = builtins.map (name: ''^<ip>.*"[^"]*${name}[^"]*"$'') [
|
|
"AI2Bot"
|
|
"Amazonbot"
|
|
"Applebot"
|
|
"Applebot-Extended"
|
|
"Bytespider"
|
|
"CCBot"
|
|
"ChatGPT-User"
|
|
"ClaudeBot"
|
|
"Diffbot"
|
|
"DuckAssistBot"
|
|
"FacebookBot"
|
|
"GPTBot"
|
|
"Google-Extended"
|
|
"Kangaroo Bot"
|
|
"Meta-ExternalAgent"
|
|
"Meta-ExternalFetcher"
|
|
"OAI-SearchBot"
|
|
"PerplexityBot"
|
|
"Timpibot"
|
|
"Webzio-Extended"
|
|
"YouBot"
|
|
"omgili"
|
|
];
|
|
actions = ban "720h";
|
|
};
|
|
};
|
|
|
|
ssh = {
|
|
cmd = journalctl "sshd";
|
|
|
|
filters = {
|
|
failedlogin = {
|
|
regex = [
|
|
"authentication failure;.*rhost=<ip>"
|
|
"Connection reset by authenticating user .* <ip>"
|
|
"Connection closed by invalid user .* <ip> port .*"
|
|
"Failed password for .* from <ip>"
|
|
"Invalid user .* from <ip> port .*"
|
|
"Unable to negotiate with <ip> port .*"
|
|
];
|
|
actions = ban "48h";
|
|
};
|
|
};
|
|
};
|
|
}
|