BGP Ranking
BGP ranking is a free software to calculate the security ranking of Internet Service Providers. The system is gathering external datasources (e.g. dshield, shadowserver, Arbor ATLAS) in order to evaluate the ranking over time.
The purpose is to detect any malicious activities of a specific AS number fast and to validate the data sources used for security.
More details can be found in the latest presentation given at: the National CSIRT Meeting.
Source code and documention of the server are available at: https://github.com/CIRCL/bgp-ranking
You can find the Redis, python and Web APIs at this address: https://github.com/CIRCL/bgpranking-redis-api
The public interface of BGP Ranking is available at: http://bgpranking.circl.lu/
BGP Ranking API
BGP Ranking has a ReST JSON API that can be queried.
Python API
The BGP Ranking Python API is a simple Python library to query the BGP Ranking API.
If you want to install the library, you can do the following:
git clone https://github.com/CIRCL/bgpranking-redis-api.git
cd bgpranking-redis-api/example/api_web/client/
python setup.py build
sudo python setup.py install
Here is a sample usage of the BGP Ranking Python library:
import bgpranking_web
# To get the position of an ASN in CIRCL BGP Ranking - it returns the position and the total number of
# the ASNS. If you don't specify a date, it's the date of Today.
print (bgpranking_web.cached_position('6661'))
# [8309, 14940]
# To get the announce history a specific IP address.
print (bgpranking_web.ip_lookup('8.8.8.8'))
# {u'ip': u'8.8.8.8', u'history': [{u'timestamp': u'2010-12-22T23:26:46.191473', u'interval': [u'2014-01-01', u'2015-05-10'], u'asn': u'15169', u'block': u'8.8.8.0/24', u'descriptions': [[u'2014-03-29', u'GOOGLE - Google Inc.,US'], [u'2013-02-08', u'GOOGLE - Google Inc.']]}], u'ptrrecord': u'google-public-dns-a.google.com', u'days_limit': 750}
# To get all the CIRCL BGP Ranking for a specific ASN.
print (bgpranking_web.all_ranks_single_asn('6661'))
# {u'2015-05-09': {u'total': 3.228162091988131e-05, u'description': u'EPT-LU Entreprise des Postes et Telecommunications,LU'}, u'2015-05-08': {u'total': 3.575899480712167e-05, u'description': u'EPT-LU Entreprise des Postes et Telecommunications,LU'}, u'2015-05-10': {u'total': 3.4020307863501486e-05, u'description': u'EPT-LU Entreprise des Postes et Telecommunications,LU'}}