Giter VIP home page Giter VIP logo

netinfo's Introduction

NetInfo

NetInfo is a simple IP enrichment service to provide additional data related to an IP address. The primary utility of NetInfo is to serve as a API wrapper and management system for the PyASN and MaxMind GeoIP libraries. NetInfo will automatically seek and download new update files, ensuring the databases are always up-to-date. The local API queries the PyASN and GeoIP instance and returns back enrichment data for an IP address.

Getting Started

Grab the dependencies:

$ apt-get install redis-server rabbitmq-server

Check out netinfo to `/opt/`:

$ cd /opt && git clone https://github.com/9b/netinfo.git

Change directory to the netinfo working directory:

$ cd netinfo/

Setup the virtualenv:

$ virtualenv -p python3 venv3

Activate the virtualenv:

$ source venv3/bin/activate

Install the requirements:

$ (venv3) pip install -r requirements.txt

Install the services and start them.

See Services README.

Or start the Celery Daemon:

$ (venv3) /opt/netinfo/venv3/bin/celery worker -A worker.celery --loglevel=info -B

And start the server:

$ (venv3) /opt/netinfo/venv3/bin/uwsgi --ini wsgi.ini

You can then access the API through http://localhost:7777 for more details.

Sample Output

When calling http://localhost:7777/lookup?ip=74.96.192.82:

{
  "as_name": "UUNET - MCI Communications Services, Inc. d/b/a Verizon Business, US",
  "as_num": 701,
  "city": "Vienna",
  "country_iso": "US",
  "country_name": "United States",
  "ip": "74.96.192.82",
  "ip_hex": "0x4a60c052",
  "ip_version": 4,
  "latitude": 38.8977,
  "longitude": -77.288,
  "network": "74.96.0.0/16",
  "network_broadcast": "74.96.255.255",
  "network_hostmask": "0.0.255.255",
  "network_netmask": "255.255.0.0",
  "network_size": 65536,
  "postal_code": "22181",
  "region_iso": "VA",
  "region_name": "Virginia"
}

Unlike the standard PyASN library, NetInfo will add the AS name to the response, additional network data and the original IP address that was requested.

API Endpoints

The following endpoints are available within the NetInfo service.

/lookup?ip=8.8.8.8

Get back AS, network information and geolocation for an IP address.

/network-addresses?cidr=8.8.8.0/24

Get back all IP addresses as part of a network range.

/prefixes?asn=15169

Get back all prefixes advertised for a specific AS network.

/as-name?asn=15169

Get back the name of the AS network.

/geolocation?ip=8.8.8.8

Get back geolocation information for an IP address.

netinfo's People

Contributors

9b avatar foospidy avatar jalewis avatar kollee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

netinfo's Issues

Changes to GeoLite2 license and distribution require changes to how you download databases

The URL used to directly download GeoLite2 databases will no longer function after December 30th 2019.

Due to upcoming data privacy regulations, MaxMind are making significant changes to how users access free MaxMind GeoLite2 databases starting December 30, 2019. The databases will continue to be available without charge and for redistribution. However, you will be required to create an account and use a license key to download the databases, and agree to a new EULA that addresses applicable data privacy regulations.

Learn more on the MaxMind blog: https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/.

Mark Fowler
MaxMind

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.