security/crowdsec: blocklist aliases are silently not created when another (unrelated) alias fails model validation
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with security/crowdsec/src/etc/inc/plugins.inc.d/crowdsec.inc and inspect add_alias_if_not_exist() and its Alias model save path. Reproduce with an invalid unrelated alias, then check how validation failures are exposed or logged. Done means CrowdSec aliases are created despite the unrelated invalid alias, or the failure clearly identifies the blocking alias.
索引モデルが issue の本文から書いたものです。
説明
Important notices
- I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- The title contains the plugin to which this issue belongs
Describe the bug
When the firewall bouncer is enabled, add_alias_if_not_exist() in /usr/local/etc/inc/plugins.inc.d/crowdsec.inc adds the plugin's external aliases (crowdsec_blocklists, crowdsec6_blocklists) through the Alias model and calls $model->serializeToConfig().
On my system the config already contained an unrelated, invalid alias (type port, empty content — a leftover from an older configuration, not created by the CrowdSec plugin). Saving the Alias model then failed, the CrowdSec aliases were never created, and the bouncer kept failing with:
table crowdsec_blocklists doesn't exist
Nothing in the plugin or the GUI pointed to the real cause (the unrelated alias). After we deleted that alias and pressed Apply on the CrowdSec page, the aliases were created and the bouncer started populating the table immediately (≈2,300 entries from the community blocklist).
To Reproduce
- Have an alias that does not pass validation, e.g. type
portwith empty content (cannot be created from the GUI, but can exist after a config restore/migration). - Enable the CrowdSec agent and firewall bouncer, press Apply.
- The aliases
crowdsec_blocklists/crowdsec6_blocklistsare not created; the bouncer logstable crowdsec_blocklists doesn't exist. - Delete the invalid alias, Apply again → aliases created, bouncer works.
Expected behavior
Either the plugin's aliases are created regardless of unrelated invalid aliases, or the failure is reported clearly (syslog / GUI), e.g. "crowdsec: unable to create alias crowdsec_blocklists: alias model validation failed (alias 'X': ...)".
Suggested fix
Wrap the save in add_alias_if_not_exist() in a try/catch and log the validation messages, so the administrator sees which alias blocks the save. We are happy to submit a PR if this approach is acceptable.
Relevant log files
crowdsec-firewall-bouncer: table crowdsec_blocklists doesn't exist
Environment
OPNsense 26.7.x (amd64), os-crowdsec 1.0.12, crowdsec 1.8.1
- 主要言語
- PHP
- スター
- 1.2k
- フォーク
- 926
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
opnsense/plugins のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
opnsense/plugins#5976 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
net/haproxy: IPv6 literal in real server "Source address" generates an invalid `source` directiveオープンincomplete
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
opnsense/plugins#5973 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[dns/ddclient] Support hiding unused standard fields per service (optional_hiding)対応中かも @bringha1 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
q-feeds-connector: "error in configd communication" every update when the Unbound DNSBL rebuild takes longer than 120s対応中かも @mhatipog が 9 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
opnsense/plugins の issue をすべて見る
似ている issue
-
15.0
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
open-telemetry/opentelemetry-php-distro#176 ·
メンテナーはふだん 2 日以内に返信
-
No Code Attached Yet
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
joomla/joomla-cms#48941 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage Platform(Default)
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug new
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
moodle-an-hochschulen/moodle-theme_boost_union#1500 ·
メンテナーはふだん 1 日以内に返信