You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

github.com/abhisek/asn-search-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/abhisek/asn-search-api


Version published

Readme

Source

ASN Search API

A Golang API over MaxMind ASN database

CircleCI

  • The API server requires a pre-built database in data/asn.db
  • The API server listens on 0.0.0.0:8000 by default (Customize with HOST and PORT environment variable)
  • Building database requires MaxMind ASN CSV

Getting Started

docker run -p 8000:8000 abh1sek/asn-search-api

Use

curl -s http://localhost:8000/domain/example.com
curl -s http://localhost:8000/org/example+technologies

OrgName should be URL Encoded

Build

Ensure go tool chain is setup correctly

make

Generate ASN Database

  1. Download MaxMind ASN Database in CSV Format
  2. Use asn-search-api tool to create indexed database
./asn-search-api -mode mkdb \
  -db data/asn.db \
  -type ipv4 \
  -file GeoLite2-ASN-CSV_20190101/GeoLite2-ASN-Blocks-IPv4.csv 

./asn-search-api -mode mkdb \
  -db data/asn.db \
  -type ipv6 \
  -file GeoLite2-ASN-CSV_20190101/GeoLite2-ASN-Blocks-IPv6.csv 

Deploy

Google Cloud Run

gcloud run deploy \
  asn-search-api \
  --platform=managed \
  --image=gcr.io/<projectName>/asn-search-api:latest \
  --memory=512Mi \
  --timeout=30s \
  --labels=app=asn-search-api \
  --allow-unauthenticated \
  --region=us-central1

TODO

  • Extract ASN DB ops from main.go and create its own package
  • Test cases

FAQs

Package last updated on 19 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc