Add central ASN address-group expander #2
Reference in New Issue
Block a user
Delete Branch "benvin/asn-expander"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
ASN-based rules (e.g.
net:+asn_cloudflare) need the source ASNs turned into concrete prefixes to match on. Expansion is centralized so one iplocate key is used and every device gets identical, consistent membership; devices never call the upstream provider.Changes
asnexpandpackage: anExpanderinterface, an endpoint-configurable, response-tolerant iplocate client, and a backgroundRefresherthat re-expands each asn group on its TTL (default 24h, per-group configurable viarefresh).resolved/resolved_atcolumns (migration 0002), verified against Postgres 17.TOMSWALLAPI_IPLOCATE_API_KEYis set; otherwise asn sets stay empty and inert with a warning.Note
iplocate's documented ASN data is returned per IP lookup, so the exact ASN→prefixes endpoint depends on the account/plan. The client is written to be pointed at the correct endpoint once the key is provided; it is tolerant of
prefixes/routes/cidrsresponse shapes.