Integrate with Quick Connect API

The Quick Connect API allows you to easily access your data within Fortra VM, and perform tasks such as requesting data to use for reporting or integration with other security solutions.

The following instructions will help you construct your own scripts to interact with Fortra VM vulnerability data, asset data, and the vulnerability dictionary through its REST API.

NOTE: For assistance with using the Fortra VM API, contact Fortra Technical Support or a VM Pro-Analyst.

Authentication

You must send each request with the API Key to authenticate your account. Additionally, each key will be valid only with the specific Fortra VM region that the account is using.

Keep this key secure as it carries the same privileges as your Fortra VM password. Do not share your secret API keys on unrestricted public areas (for example, client-side code or code repositories such as GitHub).

Generate a Fortra VM API Key

  1. Log in to Fortra VM.

  2. In the site header, select your name and then select My profile.

  3. On the API Tokens tab, select Create new token.

  4. In the Add New Token dialog, enter the token name and then select OK.

  5. Below your token name, selecting Click to show key displays your API Key.

IMPORTANT: An API Key is equivalent to a user’s password. Do not use a key with more than one product integration. If you believe a key is compromised, delete the token from Fortra VM immediately by selecting the Delete button and resulting check-mark to confirm.

API URL

After generating your API key, determine the appropriate regional URL your key is associated with. This defines the base URL for all of your requests with this key. This is done by sending a request to the router endpoint.

The base URL may periodically change, so check the route upon each session initiation at the beginning of your script.

Copy

GET https://api.frontline.cloud/api/router/

$ curl -X GET https://api.frontline.cloud/api/router/  -H
"Authorization: Token YOUR_API_TOKEN" 



                  
{
       "vm" : {,
       "product" : "vm",
       "url" : "https://vm.us.frontline.cloud/api/"
   },
   "was" : {
      "product" : "was",
      "url" : "https://was.us.frontline.cloud/api/"
   }
}

Basic API Usage

All Fortra VM API requests begin with the regional base URL that you determined above.

The next segment of the URL path depends on the resource.

For example, if your regional base URL is https://vm.frontline.cloud/api/, then use https://vm.frontline.cloud/api/scanresults/active/vulnerabilities/ to access Active View vulnerability data.

In addition to using the HTTPS protocol, all requests must include your secret API Key.

Data Format

The Fortra VM API returns data in JSON format.

Pagination

Making calls to the Fortra VM API will usually return many results. To use resources efficiently, nearly all results are paginated.

The Fortra VM API implements pagination using the optional parameters count and page. Both are returned in the results as next and previous name/value pairs when applicable.

Optional Pagination Parameters

Parameter Description
count
  • The integer number of records you wish to retrieve per request.
  • Recommended minimum value is 1000.

  • Recommended maximum value is 5000.

  • Do not confuse this with the count name / value pair returned in your results.

  • Default value: 25

page
  • The integer page number to which you want to navigate. Only needed if you want to start on a different page other than 1.

  • Default value: 1

Paginated results will include the following three name/value pairs:

Paginated Results Name/Value Pairs

Name Value
count An integer value of the total number of records available. Do not confuse this with the count parameter.
next The full URL string for the next page of results, if applicable, otherwise set to null.
previous The full URL string for the previous page of results, if applicable, otherwise set to null.

 

Copy

GET https://vm.frontline.cloud/api/scanresults/active/vulnerabilities/?count=500

{
   "count" : 1768,
   "next" : "https://vm.frontline.cloud/api/scanresults/active/vulnerabilities/?count=500&page=2",
   "previous" : null,
   "results" : [
      ...
      ...
   ]
}

Using Optional Parameters

The Fortra VM API offers a rich set of optional parameters that allow you to tailor your requests. This gives you the flexibility to filter your results for specific data sets, sort your results, or use pagination as described above.

Filtering

Filter parameters must be prefixed with a count using the format of _x_. Query strings from different parameter groups can all begin with 0 (zero).

Example:

&_0_iexact_host_os_type=server&_0_eq_host_rating_ddi=F

Parameters from the same parameter set must increment their count.

Example:

&_0_iin_host_os_type=server&_1_iin_host_os_type=device&_0_eq_host_rating_ddi=F

Sorting

Use the ordering parameter to sort your results. By default, the results are in ascending order by the parameter value used. Prefix the parameter’s value with a minus sign to sort descending. For example, sort ascending by title, ordering=title and sort descending by title ordering=-title.

Python Example of Pulling Data

The Python script demonstrates how to pull vulnerabilities and their associated asset data from your account.

Copy
#!/env/python
import urllib2
import json

fvmUrl = "https://vm.frontline.cloud/"
apiToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

haveAllHosts = False
vulnData = []
requestStr = fvmUrl + "api/scanresults/active/vulnerabilities/?digest=0&count=100"

while not haveAllHosts:
        # include the API token in every request you make
        request = urllib2.Request( requestStr, headers = {'Authorization': 'Token ' + apiToken} )
                                        
        # request the data with GET
        opener = urllib2.build_opener()
        response = opener.open(request)
        currentData = json.loads( response.read() )
        vulnData.extend( currentData['results'] )
        print "Have " + str(len(vulnData)) + " results of " + str(currentData['count']) + " total"

         # at the top level, the "next" variable, if present,
         # gives you a complete URL where you can find the continuation
         # of your request results.
        if( currentData['next'] != None ):
            requestStr = currentData['next']
            
        else:
            haveAllHosts = True

print json.dumps(vulnData, indent=4,sort_keys=True)

Active View Assets

Use this API path to get information about assets reconciled into Fortra VM’s Active View.

Active View Vulnerabilities

Use this API path to get information about vulnerabilities reconciled into Fortra VM’s Active View.

Scan Activity

Use this API path to get information about current scan activity.

Scheduled Scans

Use this API path to get information about scans that are scheduled.

General Scans

Use this API path to automate the creation of scans.

Scan Policies

Reports

Use this API path to get information about report history.

Vulnerability Dictionary

Use this API path to get information about known vulnerabilities.

System

Use these API paths to get information about various system info related to your account.

Filters

Fortra VM API filters give you great flexibility in tailoring your result set.