Bot Detection Signing Key Rotation triggers synchronous WASM reload causing CPU spikes every 5 minutes
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 38/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Go
- Estrellas
- 15.1k
- Forks
- 726
- Merge medio
- 2 d 51 min
- PR fusionados (30 d)
- 18
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de crowdsecurity/crowdsec
-
[docker] Align build and debian releasePosiblemente ocupada @albundy83 la tomó hace 2 días. Abiertokind/enhancement needs/triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
crowdsecurity/crowdsec#4803 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
Bucket queues preallocate all their slots when the bucket is createdPosiblemente ocupada @AdzerKI la tomó hace 4 días. Abiertokind/bug needs/triage os/linux
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
crowdsecurity/crowdsec#4799 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
kind/bug needs/triage os/linux
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
crowdsecurity/crowdsec#4797 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
kind/bug needs/triage os/linux
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
crowdsecurity/crowdsec#4790 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Docker datasource accumulates hundreds of open log streams / file descriptors, leading to excessive dockerd memory usage and host OOM (v1.8.0)Posiblemente ocupada @k4lleanka la tomó hace 12 días. Abiertokind/bug needs/triage os/linux
Dificultad 4/5 1-2 días Aptitud para principiantes 48/100
crowdsecurity/crowdsec#4781 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
Todos los issues de crowdsecurity/crowdsec
Issues similares
-
type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area/admin/user area/internationalization automated-triage issue/auto-triaged type/bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
grafana/grafana#137281 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
go good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mvanhorn/printing-press-library#2447 ·
Los mantenedores suelen responder en 1 día