Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 1.31 KB

README.md

File metadata and controls

36 lines (26 loc) · 1.31 KB

ASN Resolver

Asn resolver provides grpc service for translating IP address to ASN.

Usage

Pull docker image

docker pull ghcr.io/flowguard/asn-resolver:latest

Run docker image with these env variables:

  • ASN_PROVIDER - Provider of the ASN database. At this time only geolite asn database source is supported
  • ASN_DB_REFRESH_RATE - ASN database refresh period eg. 24 hours
  • GEOLITE_API_KEY - Api key used for geolite db access
docker run -p 8090:8090 -e GEOLITE_API_KEY=<api-key> -e ASN_PROVIDER="geolite" -e ASN_DB_REFRESH_RATE="24 hours" ghcr.io/flowguard/asn-resolver:latest

Test it with grpcurl tool or with arbitrary grpc client

$ grpcurl -plaintext -d '{"ip_address": "1.1.1.1"}' localhost:8090 asnservice.AsnService.GetAsnNum                                                                   
{
  "asnNum": 13335,
  "asnName": "CLOUDFLARENET"
}

$ grpcurl -plaintext -d '{"ip_address": "192.168.1.1"}' localhost:8090 asnservice.AsnService.GetAsnNum                                                              
ERROR:
  Code: NotFound
  Message: ASN not found