security/crowdsec: blocklist aliases are silently not created when another (unrelated) alias fails model validation
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 58/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- PHP
- Star
- 1.2k
- Fork
- 926
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của opnsense/plugins
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
opnsense/plugins#5976 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
net/haproxy: IPv6 literal in real server "Source address" generates an invalid `source` directiveĐang mởincomplete
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
opnsense/plugins#5973 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[dns/ddclient] Support hiding unused standard fields per service (optional_hiding)Có thể đã có người làm @bringha1 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
q-feeds-connector: "error in configd communication" every update when the Unbound DNSBL rebuild takes longer than 120sCó thể đã có người làm @mhatipog đã nhận 9 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của opnsense/plugins
Issue tương tự
-
15.0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
open-telemetry/opentelemetry-php-distro#176 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
No Code Attached Yet
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
joomla/joomla-cms#48941 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage Platform(Default)
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug new
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
moodle-an-hochschulen/moodle-theme_boost_union#1500 ·
Maintainer thường phản hồi trong vòng 1 ngày