Merge pull request #197 from outis1one/claude/asterisk-digital-ocean-w22kk8

Fix fatal CrowdSec crash-loop in ASN-exempt Asterisk scenarios
This commit is contained in:
Outis
2026-07-21 08:58:01 -04:00
committed by GitHub
+7 -1
View File
@@ -207,8 +207,14 @@ labels:
local ASN_LIST=""
prompt_text " ASN numbers to exempt, space-separated:" "21928 14593" ASN_LIST
if [ -n "$ASN_LIST" ]; then
# ASNNumber is a string field internally (like IsoCode in the
# geo-allowlist scenario above) even though it prints as a bare
# number in cscli/explain output. Confirmed live: unquoted
# integer literals here made CrowdSec fatal-crash-loop at
# startup with "cannot use string as type int in array" —
# every ASN must be quoted as a string to match.
local _asn_expr
_asn_expr="$(printf "%s, " $ASN_LIST)"
_asn_expr="$(printf "'%s', " $ASN_LIST)"
_asn_expr="${_asn_expr%, }"
sudo mkdir -p /etc/crowdsec/scenarios