Например, необходимо изменить параметры блокировки. Правим конфиг:
# /etc/crowdsec/scenarios/exim-bf.yaml
# было
leakspeed: "10s"
blackhole: 1m
# стало
leakspeed: "10m"
blackhole: 5h
Но тогда при эта коллекция будет помечена как tainted (испорчен)
cscli hub list
...
crowdsecurity/exim ⚠️ enabled,tainted 0.1 /etc/crowdsec/collections/exim.yaml
Чтобы увидеть что именно “испорченно” делаем так:
cscli collections inspect --diff crowdsecurity/exim
# Let's see why collections:crowdsecurity/exim is tainted.
-> scenarios:crowdsecurity/exim-bf
--- /etc/crowdsec/scenarios/exim-bf.yaml
+++ /tmp/cscli-diff-176304198
@@ -5,8 +5,8 @@
filter: "evt.Meta.log_type == 'exim_failed_auth'"
groupby: evt.Meta.source_ip
capacity: 5
-leakspeed: "10m"
-blackhole: 5h
+leakspeed: "10s"
+blackhole: 1m
labels:
confidence: 3
spoofable: 0
@@ -25,8 +25,8 @@
groupby: evt.Meta.source_ip
distinct: evt.Meta.username
capacity: 5
-leakspeed: "10m"
-blackhole: 5h
+leakspeed: "10s"
+blackhole: 1m
labels:
confidence: 3
spoofable: 0
Такая коллекция не будет обновляться, странно что нельзя переопределять параметры без того чтобы не поломать коллекцию.
И это нормально, вот что пишут на форуме:
Yes this is the right way. When you upgrade, nothing gets overwritten by default. You would need to use `--force` for that.
So to edit an existing scenario you have two options
1. edit the file directly and live with the hassle of upgrading
2. copy it, give it another name and use this one instead going forward.
То есть либо так и живите и имейте гемор с обновлением коллекции, либо сделайте копию коллекции..