feat: Add crowdsec to replace fail2ban
This commit is contained in:
parent
fd9938af04
commit
af76e7fe52
3 changed files with 29 additions and 0 deletions
configuration/services
27
configuration/services/crowdsec.nix
Normal file
27
configuration/services/crowdsec.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
security.crowdsec = {
|
||||
enable = true;
|
||||
remediationComponents.firewallBouncer.enable = true;
|
||||
|
||||
parserWhitelist = [
|
||||
"1.64.239.213"
|
||||
];
|
||||
|
||||
settings.crowdsec_service.acquisition_path = pkgs.writeText "crowdsec-acquisitions.yaml" ''
|
||||
---
|
||||
source: journalctl
|
||||
journalctl_filter:
|
||||
- "SYSLOG_IDENTIFIER=Nextcloud"
|
||||
labels:
|
||||
type: syslog
|
||||
---
|
||||
source: journalctl
|
||||
journalctl_filter:
|
||||
- "SYSLOG_IDENTIFIER=sshd-session"
|
||||
labels:
|
||||
type: syslog
|
||||
---
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue