Address Analyzer provides a simple API to query multiple endpoints to retrieve information about a domain, or an IP address. This service is divided into microservices, each of which are responsible for communicating with the intended service that it is retrieving data for.
The main AddressAnalyzer.Api project is responsible for
aggregating this data, and returning it to the caller
in JSON format. The API allows for selecting a set of
services that the caller wants to retrieve data from,
or a simple HTTP GET
endpoint that will retrieve
data from a predefined set of services — Ping and RDAP.
There are a few endpoints that are of note.
GET /api/v1/heartbeat
-> Returns a string indicating connectivity to the API.
-
GET /api/v1/analyze/{address}
-> Returns JSON from the default set of services.Parameter -
address
- Type
{string}
- IP Address or Domain- Example:
8.8.8.8
orgoogle.com
- Example:
- Type
-
GET /api/v1/analyze/{servicelist}/{address}
-> Returns JSON from the specified set of services in theservicelist
parameter.Parameter -
servicelist
- Type
{string}
- Comma separated list of strings-
Accepatable Values:
vt
- Virus Totalrdap
- RDAPrdns
- Reverse DNSping
- Pinggeo
- GeoIP
-
Example:
vt,rdap,geo
-
Parameter -
address
- Type
{string}
- IP Address or Domain- Example:
8.8.8.8
orgoogle.com
- Example:
- Type
When using the analyze endpoint, if you specify a service list, and you include Virus Total as one of the services you will query, then you must include your VT API key along with the request in the request headers.
The request header name must be X-VT-Key
.
As an example:
X-VT-Key: <your api key here>
- .NET Core SDK 2.2
- Visual Studio
cd <project root dir>
dotnet build
You can build from the VS GUI.
cd <project root dir>
dotnet test
You can run Unit Tests from the VS GUI.
To run the app in docker, you can run the following commands.
docker build -t <your tag name> .
docker run -p 8080:80 <your tag name>
After you've run the image, you can now
open a browser, or a Postman session, and
navigate to http://localhost:8080/api/v1/heartbeat
.
You can find the Swagger specification, and the hosted application in a Heroku application.
This application runs on an autodeployment
process using the Travis CI pipeline that is
configured for this project. Heroku will
automatically deploy the latest code from master
when a pipeline has succeeded.