[Bot detection] Regenerate challenge only if served

Aperta
#4,692 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, javascript
Ambito
security

Direzione di ricerca

Start by tracing the bot-detection challenge lifecycle: find where the per-epoch signing-key rotation and JavaScript re-obfuscation run, and where a challenge is served to a client. Check how the existing key_rotation_interval change in PR #4674 fits into that flow. Done means rotation and re-obfuscation are skipped when the current epoch's challenge has not been served, while still occurring after it has been served.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area/bot-detection kind/enhancement needs/triage
What would you like to be added?

Hey, I just activated the bot detection in my setup and saw the cpu spikes from the regeneration of the challenge. I found that https://github.com/crowdsecurity/crowdsec/pull/4674 is already addressing this and with the key_rotation_interval I could bring down CPU usage even more.

One more idea though: Skip the per-epoch signing-key rotation and JS re-obfuscation pass if the
current epoch's challenge has never been served to a client.

Why is this needed?

On an instance where the challenge is scoped to a few hosts (e.g. in homelabs), the rotation runs on a fixed schedule regardless of whether any client was ever challenged. On my system, each pass costs a full CPU core for several seconds, which dominates the process's total CPU usage on an otherwise quiet machine.

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di crowdsecurity/crowdsec

Tutte le issue di crowdsecurity/crowdsec

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.