security/crowdsec: blocklist aliases are silently not created when another (unrelated) alias fails model validation
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 58/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- PHP
- Stelle
- 1.2k
- Fork
- 926
- Merge medio
- 1g 10h
- PR unite (30g)
- 25
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di opnsense/plugins
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
opnsense/plugins#5976 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
net/haproxy: IPv6 literal in real server "Source address" generates an invalid `source` directiveApertaincomplete
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
opnsense/plugins#5973 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[dns/ddclient] Support hiding unused standard fields per service (optional_hiding)Forse già presa @bringha1 l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
q-feeds-connector: "error in configd communication" every update when the Unbound DNSBL rebuild takes longer than 120sForse già presa @mhatipog l’ha presa 9 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di opnsense/plugins
Issue simili
-
15.0
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
open-telemetry/opentelemetry-php-distro#176 ·
I maintainer di solito rispondono entro 2 giorni
-
No Code Attached Yet
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
joomla/joomla-cms#48941 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage Platform(Default)
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug new
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
moodle-an-hochschulen/moodle-theme_boost_union#1500 ·
I maintainer di solito rispondono entro 1 giorno