[Feature Request] Graceful handling & stale-data fallback for HTTP data sources

Aperta
#4,259 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go

Direzione di ricerca

Start by tracing how remote source_url downloads, dest_file handling, and the cscli hub update/upgrade flow interact. The issue does not name files or tests, so locate those entry points and check how fetch failures affect reloads and notifications. Done means failed downloads use an available local copy, do not block updates or reloads, and notify administrators.

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

Descrizione

needs/kind needs/triage question
What would you like to be added?

Thanks a lot for the awesome project crowdsec.

Currently, when using a data source with a source_url in a parser or whitelist, a failure to fetch the remote file (e.g., 404, DNS issues, or timeout) causes the CrowdSec Hupupdate Service process to fail.
This is problematic for automated updates (cscli hub update && cscli hub upgrade), as it can leave the engine in an inconsistent state or prevent a restart.

Proposed Solution: I propose a more resilient approach for remote data sources:

  • Stale Data Fallback: If the HTTP download fails, CrowdSec should log a warning but continue to use the existing local version of the file (dest_file) if it exists.

  • Non-Blocking Update: The hub update or service reload should not return an error code if the failure is limited to a remote data source fetch and a local copy is available.

  • Notification Support: Trigger an alert (which can then be handled by the existing notification system, e.g., email, Slack, HTTP plugin) to inform the administrator that the data source update failed and stale data is being used.

Thanks a lot.

Why is this needed?

This is problematic for automated updates (cscli hub update && cscli hub upgrade), as it can leave the engine in an inconsistent state or prevent a restart.

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.