fix: security event notifications reach only Discord providers

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

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

@Wikid82 がすでに取り組んでいます。

2026年12月3日 から。

評価

この issue はまだ評価されていません。

説明

backend crowdsec medium security

What

The notification provider form offers WAF, access list, rate limit and CrowdSec events for every provider type, but security events are dispatched only to Discord providers:

  • EnhancedSecurityNotificationService.SendViaProviders keeps only discord providers (backend/internal/services/enhanced_security_notification_service.go:494-550, type filter at :506-516; dispatchToProvider at :554-561 refuses any other type).
  • The Discord send posts the raw security event JSON (sendWebhook, :565-598), not a Discord message body.
  • Dispatch runs only when the setting feature.notifications.security_provider_events.enabled is true (backend/internal/cerberus/cerberus.go:306-322). It defaults to false in production (backend/internal/api/handlers/feature_flags_handler.go:59, enhanced_security_notification_service.go:622-650) and the UI has no switch for it.
  • The GET /notifications/settings/security aggregation lists six provider types (:93-100) while nine are supported.

Unused code in the same area: the securityNotifySvc field (cerberus.go:31,54, never read), Cerberus.NotifySecurityEvent (cerberus.go:236-242, no caller) and the older backend/internal/services/security_notification_service.go.

Severity

Medium (security-adjacent: administrators who tick security events on a Gotify, Slack, Telegram, Email or other non-Discord provider receive nothing).

Suggested approach

Route security events through NotificationService.SendExternal, which already maps security_waf, security_acl, security_rate_limit and security_crowdsec to the provider preferences (notification_service.go:256-263) and picks the security email template (:405-406). Decide the default for the feature setting (or remove it), send in the background with grouping per event type, align the GET aggregation with the supported types, and remove the unused code. Add tests per provider type.

Found while planning the notification delivery fix (#2103, #2104, #2101). Scheduled as its own PR right after that one.

主要言語
Go
スター
17
フォーク
2
平均マージ
1時間 42分
マージ済み PR(30日)
173

環境構築

はじめの一歩

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

Wikid82/Charon のほかの issue

Wikid82/Charon の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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