feat: Add crowdsec module

This commit is contained in:
Tristan Daniël Maat 2025-01-24 00:35:23 +08:00
parent 09198a416c
commit b81de99288
Signed by: tlater
GPG key ID: 49670FD774E43268
5 changed files with 335 additions and 2 deletions
configuration/services

View file

@ -0,0 +1,36 @@
{ pkgs, ... }:
{
services.crowdsec = {
enable = true;
settings.crowdsec_service.acquisition_path =
(pkgs.formats.yaml { }).generate "crowdsec-acquisitions.yaml"
{
source = "journalctl";
journalctl_filter = map (s: "_SYSTEMD_UNIT=${s}") [
"conduit.service"
"coturn.service"
"forgejo.service"
"foundryvtt.service"
"grafana.service"
"minecraft-server.service"
# Nextcloud?
"tlaternet-webserver.service"
"sshd.service"
# Wireguard?
];
labels.type = "syslog";
};
};
}
# db_config = {
# type = "postgresql";
# db_path = "/run/postgresql";
# user = "crowdsec";
# db_name = "crowdsec";
# flush = {
# max_items = 10000;
# max_age = "14d";
# };
# };