Bot Detection Signing Key Rotation triggers synchronous WASM reload causing CPU spikes every 5 minutes
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
Direzione di ricerca
Start by tracing the AppSec engine’s Bot Detection signing-key rotation timer and the synchronous WASM reload it triggers; the issue does not name specific files or tests. Confirm the reload’s timing and CPU impact, then determine which proposed direction fits the project. Done means rotation no longer causes the reported recurring CPU spike while preserving key rotation behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
When CrowdSec AppSec Bot Detection is enabled, the Signing Key Rotation mechanism triggers a synchronous WASM module reload every 5 minutes (default rotation_interval=5m0s). This causes a predictable CPU spike lasting 4-5 seconds on small-instance deployments, during which the WASM runtime consumes 100% of a single core. On 2-core machines under concurrent load, this can cause request latency degradation or brief service unavailability.
The CPU spike is traffic-independent — it occurs at fixed intervals regardless of request volume, confirming it is an internal timer-driven operation rather than a response to incoming traffic.
Cause Analysis
The CPU spike is caused by the Bot Detection Signing Key Rotation timer (rotation_interval=5m0s), which triggers a synchronous WASM module reload in the AppSec engine. Key evidence:
- Spike timing aligns exactly with
rotation_interval(not with traffic patterns or cron jobs) - CrowdSec log shows:
WAF challenge runtime initialized ... rotation_interval=5m0s - Memory profile shows full WASM module deallocation + reallocation cycle
- The operation is single-threaded and blocks the AppSec runner during reload
- Multiple signing keys would make this WORSE (more frequent reloads), not better
Suggested Improvements
- Async WASM hot-reload: Perform signing key rotation and WASM module swap in a background goroutine, swapping the active module atomically after preparation completes
- Configurable rotation interval: Allow users to tune
rotation_intervalbased on their security/performance tradeoff (e.g., 15m or 30m for small instances) - Lazy rotation: Only rotate when the current key has been used for N challenges, rather than on a fixed timer
- WASM module pooling: Pre-allocate the new WASM instance before tearing down the old one to reduce memory allocation pressure
- Lingua principale
- Go
- Stelle
- 15.1k
- Fork
- 726
- Merge medio
- 2g 51m
- PR unite (30g)
- 18
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di crowdsecurity/crowdsec
-
[docker] Align build and debian releaseForse già presa @albundy83 l’ha presa 1 giorno fa. Apertakind/enhancement needs/triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
crowdsecurity/crowdsec#4803 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Bucket queues preallocate all their slots when the bucket is createdForse già presa @AdzerKI l’ha presa 3 giorni fa. Apertakind/bug needs/triage os/linux
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
crowdsecurity/crowdsec#4799 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
kind/bug needs/triage os/linux
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
crowdsecurity/crowdsec#4797 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
kind/bug needs/triage os/linux
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
crowdsecurity/crowdsec#4790 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Docker datasource accumulates hundreds of open log streams / file descriptors, leading to excessive dockerd memory usage and host OOM (v1.8.0)Forse già presa @k4lleanka l’ha presa 11 giorni fa. Apertakind/bug needs/triage os/linux
Difficoltà 4/5 1-2 giorni Idoneità per principianti 48/100
crowdsecurity/crowdsec#4781 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di crowdsecurity/crowdsec
Issue simili
-
component/mesheryctl kind/bug language/go
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
meshery/meshery#22993 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
frontend size:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
shukiv/jabali-panel#2423 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100