tlaternet-server/configuration/services/crowdsec.nix
Tristan Daniël Maat f5b1acda4f
feat(crowdsec): Switch to whitelisting wireguard IP
My IP address is not static, and grafana seems to comfortably produce
enough traffic to get me IP banned.
2025-02-07 01:40:45 +08:00

54 lines
1,017 B
Nix

{ config, lib, ... }:
{
security.crowdsec = {
enable = true;
parserWhitelist = [
"10.45.249.2"
];
extraGroups = [
"systemd-journal"
"nginx"
];
acquisitions = [
{
source = "journalctl";
labels.type = "syslog";
journalctl_filter = [
"SYSLOG_IDENTIFIER=Nextcloud"
];
}
{
source = "journalctl";
labels.type = "syslog";
journalctl_filter = [
"SYSLOG_IDENTIFIER=sshd-session"
];
}
{
labels.type = "nginx";
filenames =
[
"/var/log/nginx/*.log"
]
++ lib.mapAttrsToList (
vHost: _: "/var/log/nginx/${vHost}/access.log"
) config.services.nginx.virtualHosts;
}
];
remediationComponents.firewallBouncer = {
enable = true;
settings.prometheus = {
enabled = true;
listen_addr = "127.0.0.1";
listen_port = "60601";
};
};
};
}