Write A Caddy Plugin For ASN Based Whitelist

in Open Genie28 days ago

I'm looking for someone who can write a Caddy plugin that can implement blocking by ASN.

ASNs are Autonomous System Numbers and you can find out more info about them here: https://www.arin.net/resources/guide/asn/.

The general way that this system should function:

Upon startup of caddy(and on a refresh interval) all the IPs announced by a particular ASN should get refreshed. BGP.Tools has an api which can get this data, but being able to support multiple ways to get this data would be great.

curl https://bgp.tools/table.jsonl -A "Your Name <[email protected]> Thanks for BPG.Tools :)" -s | grep 400587

Here we are looking for ips originated by AS400587. The ASN should be configurable. If the incoming request comes from an IP that's not on the list, the request should be dropped.

Configuration via caddyfile is a must, and via the JSON API on caddy would be a nice to have.

For caddyfile we would like something like the following for allowing access:

allow_asn 400587 395887

With multiple ASNs allowed. Feel free to ask more in the comments.

This is a post created on the open genie platform you can view it best on this user interface: https://genie.peakd.com/@rishi556/write-a-caddy-plugin-for-asn-based-whitelist-1715725805525

Sort:  

Congratulations @rishi556! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You distributed more than 74000 upvotes.
Your next target is to reach 75000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP