Asn resolver provides grpc service for translating IP address to ASN.
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 onlygeolite
asn database source is supportedASN_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