Skip to content

Instantly share code, notes, and snippets.

View joergbattermann's full-sized avatar
🤔
But why?

Jörg Battermann joergbattermann

🤔
But why?
View GitHub Profile
@johannrichard
johannrichard / asn.js
Last active November 20, 2021 15:11
Serverless Worker Function for ASN prefix parsing for OPNsense and pfSense
/***
* Worker Function for ASN prefix parsing
* Will query the BigIP API for a given ASN and return a plain-text representation of the ASN prefixes
* (IP ranges) that can be used in either OPNsense or pfSense URL Tables (Firewall alias).
*
* See https://docs.opnsense.org/manual/aliases.html (OPNsense) and https://docs.netgate.com/pfsense/en/latest/firewall/aliases.html (pfSense) for details of their use.
*
* You can deploy this worker for example on the free tier of CloudFlare (Up to 100'000 requests a day) or
* any other serverless platform that supports JavaScript
*