Bot Detection Signing Key Rotation triggers synchronous WASM reload causing CPU spikes every 5 minutes
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 38/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Go
- スター
- 15.1k
- フォーク
- 726
- 平均マージ
- 2日 51分
- マージ済み PR(30日)
- 18
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
crowdsecurity/crowdsec のほかの issue
-
[docker] Align build and debian release対応中かも @albundy83 が 2 日前に担当しました。 オープンkind/enhancement needs/triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
crowdsecurity/crowdsec#4803 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
Bucket queues preallocate all their slots when the bucket is created対応中かも @AdzerKI が 4 日前に担当しました。 オープンkind/bug needs/triage os/linux
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
crowdsecurity/crowdsec#4799 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
kind/bug needs/triage os/linux
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
crowdsecurity/crowdsec#4797 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
kind/bug needs/triage os/linux
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
crowdsecurity/crowdsec#4790 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Docker datasource accumulates hundreds of open log streams / file descriptors, leading to excessive dockerd memory usage and host OOM (v1.8.0)対応中かも @k4lleanka が 12 日前に担当しました。 オープンkind/bug needs/triage os/linux
難易度 4/5 1〜2日 初心者へのやさしさ 48/100
crowdsecurity/crowdsec#4781 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
crowdsecurity/crowdsec の issue をすべて見る
似ている issue
-
type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area/admin/user area/internationalization automated-triage issue/auto-triaged type/bug
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
grafana/grafana#137281 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
go good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mvanhorn/printing-press-library#2447 ·
メンテナーはふだん 1 日以内に返信