Get data from CIRCL's BGP Ranking
vaclavbartos opened this issue · comments
Add a new module to NERD which adds attribute circl_bgprank
to asn
entities. The value will be taken from CIRCL's public BGP ranking service (https://www.circl.lu/projects/bgpranking/) via its REST API.
Use bgpranking_web
library for querying (available on pypi, just add it to requirements.txt). Function cache_get_daily_rank
will be probably needed (full API documentation: http://circl.github.io/bgpranking-redis-api/code/API.html).
The function querying and setting the rank will be registered on asn:!NEW
and asn:!every1d
events (i.e. the rank will be queried when a new ASN is added and then refreshed every day). It will simply set attribute circl_bgprank
to the value received from API.
Done, works fine.
The only problem is, that the bgpranking_web
package is not compatible with Python 3 out of the box (relative import in __init__.py
must be changed). I created a pull request to the package repository, hopefully they'll accept it and create a new version. Otherwise we would need to hack it somehow in deployment scripts.