How to capture Nmap output in the Tidal Migrations API

You can send the output generated by Nmap to the Tidal Migrations API in two ways. First, by using Tidal Tools Instructions and second, by sending the data to the API by using a service like Postman. You can find detailed instructions for how to use Postman for authentication and CRUD operations here.

A downside of this approach is that you will have to create the expected JSON payload required by the API to handle the request.

Once you are authenticated and set up, you can use this API endpoint to capture your Nmap output.

POST /nmap

This is the shape of the expected payload.

{
 "nmap_output": {
   "hosts": [
     {
       "ip_address" : "32.199.2.33",
	      “ptr_record”: “abc-32-199-2-33.cloudfront.net”,
        "ports": [
          {
            "port": 22,
            "protocol": "tcp",
            "status": "open",
            "service": {
              "name": "openssh"              
            }
          }
        ]
      }
    ]
  }
}

You could also use cURL, a request would look similar to this:

export API_TOKEN=PUT_YOUR_TOKEN_HERE
export SUBDOMAIN=PUT_YOUR_SUBDOMAIN_HERE
 
curl -H "Authorization: Bearer $API_TOKEN"  --header "Content-Type: application/json" \
--request POST \
--data nmap_out.json \
"https://$SUBDOMAIN.tidalmg.com/api/v1/nmap"