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

オープン
#4,259 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
15.1k
フォーク
726
平均マージ
2日 51分
マージ済み PR(30日)
18

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

crowdsecurity/crowdsec のほかの issue

crowdsecurity/crowdsec の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。