Tenable Security Center API: Scan Result

 

/scanResult

Methods
GET

Gets the list of Scan Results.

Fields Parameter
Expand

The fields parameter should be specified along the query string, and it takes the syntax

    ?fields=<field>,...

Allowed Fields

*id
**name
**description
**status
initiator
owner
ownerGroup
repository
scan
job
details
importStatus
importStart
importFinish
importDuration
downloadAvailable
downloadFormat
dataFormat
resultType
resultSource
running
errorDetails
importErrorDetails
totalIPs
scannedIPs
startTime
finishTime
scanDuration
completedIPs
completedChecks
totalChecks
agentScanUUID
agentScanContainerUUID
timeCompareField

Note: field "progress" not allowed. To get this field, you must specify a specific scanResult (id).  

Legend

* = always comes back

** = comes back if fields list not specified on GET all

Request Parameters
Expand

NOTE: The 'startTime' and 'endTime' parameters search against the 'createdTime' values. They do not consider or search against the 'finishTime' values.

{
	"startTime" : <number:epoch> DEFAULT {now-30 days},
	"endTime" : <number:epoch> DEFAULT {now}
}
Filter Parameters

usable - The response will be an object containing an array of usable Scan Results. By default, both usable and manageable objects are returned.
manageable - The response will be an object containing all manageable Scan Results. By default, both usable and manageable objects are returned.
running - Only Scan Results that are currently running will be returned. This is compatible with usable and/or manageable filters. By default, both running and completed Scan Results are returned.
completed - Only Scan Results that have completed will be returned. This is compatible with usable and/or manageable filters. By default, both running and completed Scan Results are returned.
optimizeCompletedScans- Skip retrieval of progress fields (completedIPs, completedChecks, totalChecks) for scans that are no longer in progress to optimize speed.
timeCompareField - Only support finishTime and createdTime

Example Response
Expand
{
	"type" : "regular",
	"response" : {
		"usable" : [
			{
				"id" : "1",
				"name" : "Test Scan",
				"description" : "",
				"status" : "Completed"
			}
		],
		"manageable" : [
			{
				"id" : "1",
				"name" : "Test Scan",
				"description" : "",
				"status" : "Completed"
			}
		]
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1407249641
}

/scanResult/{id}

Methods
GET

Gets the Scan Result associated with {id}.

Fields Parameter
Expand

The fields parameter should be specified along the query string, and it takes the syntax

    ?fields=<field>,...

Allowed Fields

*id
**name
**description
**status
initiator
owner
ownerGroup
repository
scan
job
details
importStatus
importStart
importFinish

importDuration?downloadAvailable

downloadFormat
dataFormat
resultType
resultSource
running
errorDetails
importErrorDetails
totalIPs
scannedIPs
startTime
finishTime

scanDuration?completedIPs

completedChecks
totalChecks

agentScanUUID
agentScanContainerUUID
progress


Legend

* = always comes back

** = comes back if fields list not specified on GET all

redFont =  field is a JSON object e.g. "repository" :{ "id" : <id>, "name" : <name> } )

Request Parameters

None

Example Response
Expand
{
	"type" : "regular",
	"response" : {
		"id" : "11",
		"name" : "Weekly Scan",
		"description" : "",
		"details" : "Policy 'Basic 1'",
		"status" : "Completed",
		"importStatus" : "Error",
		"importStart" : "1424815361",
		"importFinish" : "-1",
		"importDuration" : -1,
		"downloadAvailable" : "false",
		"downloadFormat" : "v2",
		"dataFormat" : "IPv4",
		"resultType" : "active",
		"resultSource" : "internal",
		"running" : "false",
		"errorDetails" : "",
		"importErrorDetails" : "Scan import error (code #139).",
		"totalIPs" : "200",
		"scannedIPs" : "200",
		"startTime" : "1424815208",
		"finishTime" : "1424815360",
		"scanDuration" : 152,
		"completedIPs" : "200",
		"completedChecks" : "10600",
		"totalChecks" : "10600",
		"agentScanUUID" : "",
		"agentScanContainerUUID" : "",
		"progress" : {
			"completedIPs" : "200",
			"completedChecks" : "10600",
			"totalChecks" : "10600",
			"checksPerHost" : "53",
			"totalIPs" : "200",
			"runState" : "Stopped",
			"scanningIPs" : "",
			"scanningSize" : 0,
			"scannedIPs" : "192.168.0.0",
			"scannedSize" : 29,
			"awaitingDownloadIPs" : "",
			"awaitingDownloadSize" : 0,
			"distributedSize" : 200,
			"status" : "Completed",
			"deadHostSize" : 171,
			"deadHostIPs" : "192.168.0.0",
			"scanners" : [
				{
					"id" : "12",
					"loadAvg" : "0.0",
					"chunkCompleted" : "120",
					"completedChecks" : "6360",
					"chunks" : [
						{
							"id" : "1",
							"name" : "fc136656-2ddd-58ab-bccc-78ad4c125567-130064/Chunk 1.",
							"ips" : "192.168.0.0",
							"size" : "1",
							"completedHosts" : "0",
							"completedChecks" : "1",
							"scanningIPs" : "192.168.0.0",
							"canningSize" : "1",
							"scannedIPs" : "",
							"scannedSize" : "0",
							"status" : "Running",
							"startTime" : "1455735612",
							"endTime" : "1455736826",
							"deadHostIPs" : "",
							"deadHostSize" : 0
						}
					],
					"scannedSize" : 11,
					"scannedIPs" : "192.168.0.0",
					"scanningSize" : 0,
					"scanningIPs" : "",
					"awaitingDownloadSize" : 0,
					"awaitingDownloadIPs" : "",
					"deadHostSize" : 109,
					"deadHostIPs" : "192.168.0.0",
					"distributedSize" : 120
				},
				{
					"id" : "15",
					"loadAvg" : "0.0",
					"chunkCompleted" : "80",
					"completedChecks" : "4240",
					"chunks" : [],
					"scannedSize" : 18,
					"scannedIPs" : "192.168.0.0",
					"scanningSize" : 0,
					"scanningIPs" : "",
					"awaitingDownloadSize" : 0,
					"awaitingDownloadIPs" : "",
					"deadHostSize" : 62,
					"deadHostIPs" : "192.168.0.0",
					"distributedSize" : 80
				}
			]
		},
		"initiator" : {
			"id" : "1",
			"username" : "head",
			"firstname" : "Security Manager",
			"lastname" : "",
			"uuid" : "96F2AD1B-1B83-462E-908A-84E6054F6B64"
		},
		"owner" : {
			"id" : "1",
			"username" : "head",
			"firstname" : "Security Manager",
			"lastname" : "",
			"uuid" : "96F2AD1B-1B83-462E-908A-84E6054F6B64"
		},
		"ownerGroup" : {
			"id" : "0",
			"name" : "Full Access",
			"description" : "Full Access group"
		},
		"scan" : {
			"id" : -1,
			"name" : "",
			"description" : "",
			"type" : ""
		},
		"repository" : {
			"id" : "38",
			"name" : "jm ipv4",
			"description" : "copied from 97",
			"type" : "Local",
			"dataFormat" : "IPv4",
			"uuid" : "A2FF7E13-2C0E-470E-A3C9-E077FE065A54"
		}
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1426878968
}

DELETE

Deletes the Scan Result associated with {id}, depending on access and permissions.

Request Parameters

None

Example Response
Expand
{
    "type" : "regular",
    "response" : "",
    "error_code" : 0,
    "error_msg" : "",
    "warnings" : [],
    "timestamp" : 1403100582
}

/scanResult/{id}/copy

Methods

POST

Copies the Scan Result associated with {id}, depending on access and permissions.

Request Parameters
Expand
{
	"users" : [
		{
			"id" : <number>
		}...
	]
}
Example Response
Expand
{
    "type" : "regular",
    "response" : {},
    "error_code" : 0,
    "error_msg" : "",
    "warnings" : [],
    "timestamp" : 1406924039
}

/scanResult/{id}/email

Methods

 

POST

Emails the Scan Result associated with {id}, depending on access and permissions.

Request Parameters
Expand
{
	"email" : <string> (valid email list)
}
Example Response
Expand
{
    "type" : "regular",
    "response" : {},
    "error_code" : 0,
    "error_msg" : "",
    "warnings" : [],
    "timestamp" : 1406924039
}

/scanResult/import

Methods
 
POST

Imports the Scan Result associated with the uploaded file, identified by filename.

Request Parameters
Expand
{
	"filename" : <string>,
	"repository" : {
		"id" : <number>
	},
	"classifyMitigatedAge" : <number> DEFAULT "0",
	"dhcpTracking" : <string> "false" | "true" DEFAULT "false",
	"scanningVirtualHosts" : <string> "false" | "true" DEFAULT "false"
}
Example Response
Expand
{
	"type" : "regular",
	"response" : "",
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1407268778
}

/scanResult/{id}/import

Methods
POST

Re-imports the Scan Result associated with {id}.

Request Parameters
Expand
{
	"classifyMitigatedAge" : <number> DEFAULT "0",
	"dhcpTracking" : <string> "false" | "true" DEFAULT "false",
	"scanningVirtualHosts" : <string> "false" | "true" DEFAULT "false"
}
Example Response
Expand
{
	"type" : "regular",
	"response" : "",
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1407268778
}

/scanResult/{id}/stop

Methods
POST

Stops the Scan Result associated with {id}.

NOTE: This endpoint is not applicable for Agent Sync Results, and it is disabled as such.

Request Parameters

None

Example Response
Expand
{
    "type" : "regular",
	"response" : {
		"id" : "86",
		"resultsSyncID" : "-1",
		"agentScanID" : "-1",
		"jobID" : "180641",
		"name" : "test scan",
		"description" : "",
		"details" : "BNS",
		"status" : "Running",
		"importStatus" : "No Results",
		"importStart" : "-1",
		"importFinish" : "-1",
		"diagnosticAvailable" : "false",
		"downloadAvailable" : "false",
		"downloadFormat" : "v2",
		"dataFormat" : "IPv4",
		"resultType" : "active",
		"resultSource" : "internal",
		"running" : "true",
		"errorDetails" : "",
		"importErrorDetails" : "",
		"totalIPs" : "256",
		"scannedIPs" : "0",
		"startTime" : "1554407208",
		"finishTime" : "-1",
		"createdTime" : "1554407202",
		"scanDuration" : "1008",
		"importDuration" : "-1",
		"completedIPs" : "20",
		"completedChecks" : "2008",
		"totalChecks" : "25600",
		"agentScanUUID" : "xxxx-xxxx-xxxx-xxxx",
		"agentScanContainerUUID" : "yyyy-yyyy-yyyy-yyyy",
		"canUse" : "true",
		"canManage" : "true",
		"initiator" : {
		    "id" : "1",
		    "username" : "test user",
		    "firstname" : "",
		    "lastname" : "",
			"uuid" : "96F2AD1B-1B83-462E-908A-84E6054F6B64"
		},
		"owner":{
		    "id" : "1",
		    "username" : "test user",
		    "firstname" : "",
		    "lastname" : "",
			"uuid" : "96F2AD1B-1B83-462E-908A-84E6054F6B64"
		},
		"scan" : {
		    "id" : "18",
		    "name" : "test scan",
		    "description" : "",
			"type" : "policy"
		},
		"repository":{
		    "id" : "516",
		    "name" : "repo1",
			"description" : "",
			"type" : "Local",
			"dataFormat" : "IPv4", 
			"uuid" : "A2FF7E13-2C0E-470E-A3C9-E077FE065A54"
		},
		"ownerGroup":{
			"id" : "0",
			"name" : "Full Access",
			"description" : "Full Access group"
		}
	},
    "error_code" : 0,
    "error_msg" : "",
    "warnings" : [],
    "timestamp" : 1406918252
}

/scanResult/{id}/pause

Methods
POST

Pauses the Scan Result associated with {id}.

NOTE: This endpoint is not applicable for Agent Results, and it is disabled as such.

Request Parameters

None

Example Response
Expand
{
	"type" : "regular",
	"response" : {
		"id" : "86",
		"resultsSyncID" : "-1",
		"agentScanID" : "-1",
		"jobID" : "180641",
		"name" : "test scan",
		"description" : "",
		"details" : "BNS",
		"status" : "Running",
		"importStatus" : "No Results",
		"importStart" : "-1",
		"importFinish" : "-1",
		"diagnosticAvailable" : "false",
		"downloadAvailable" : "false",
		"downloadFormat" : "v2",
		"dataFormat" : "IPv4",
		"resultType" : "active",
		"resultSource" : "internal",
		"running" : "true",
		"errorDetails" : "",
		"importErrorDetails" : "",
		"totalIPs" : "256",
		"scannedIPs" : "0",
		"startTime" : "1554407208",
		"finishTime" : "-1",
		"createdTime" : "1554407202",
		"scanDuration" : "794",
		"importDuration" : "-1",
		"completedIPs" : "0",
		"completedChecks" : "0",
		"totalChecks" : "25600",
		"agentScanUUID" : "",
		"agentScanContainerUUID" : "",
		"canUse" : "true",
		"canManage" : "true",
		"initiator" : {
		    "id" : "1",
		    "username" : "test user",
		    "firstname" : "",
		    "lastname" : "",
			"uuid" : "96F2AD1B-1B83-462E-908A-84E6054F6B64"
		},
		"owner" : {
		    "id" : "1",
		    "username" : "test user",
		    "firstname" : "",
		    "lastname" : "",
			"uuid" : "96F2AD1B-1B83-462E-908A-84E6054F6B64"
		},
		"scan" : {
		    "id" : "18",
		    "name" : "test scan",
		    "description" : "",
 			"type" : "policy"
		},
		"repository" : {
		    "id" : "516",
		    "name" : "repo1",
		    "description" : "",
			"type" : "Local",
			"dataFormat" : "IPv4", 
			"uuid" : "A2FF7E13-2C0E-470E-A3C9-E077FE065A54"
		},
		"ownerGroup" : {
		    "id" : "0",
			"name" : "Full Access",
			"description" : "Full Access group"
		}
    },
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1406917515
}

/scanResult/{id}/resume

Methods
POST

Resumes the Scan Result associated with {id}.

NOTE: This endpoint is not applicable for Agent Results, and it is disabled as such.

Request Parameters

None

Example Response
Expand
{
	"type" : "regular",
	"response" : {
		"id" : "86",
		"resultsSyncID" : "-1",
		"agentScanID" : "-1",
		"jobID" : "180641",
		"name" : "test scan",
		"description" : "",
		"details" : "BNS",
		"status" : "Paused",
		"importStatus" : "No Results",
		"importStart" : "-1",
		"importFinish" : "-1",
		"diagnosticAvailable" : "false",
		"downloadAvailable" : "false",
		"downloadFormat" : "v2",
		"dataFormat" : "IPv4",
		"resultType" : "active",
		"resultSource" : "internal",
		"running" : "true",
		"errorDetails" : "",
		"importErrorDetails" : "",
		"totalIPs" : "256",
		"scannedIPs" : "0",
		"startTime" : "1554407208",
		"finishTime" : "-1",
		"createdTime" : "1554407202",
		"scanDuration" : "794",
		"importDuration" : "-1",
		"completedIPs" : "0",
		"completedChecks" : "0",
		"totalChecks" : "25600",
		"agentScanUUID" : "",
		"agentScanContainerUUID" : ""
		"canUse" : "true",
		"canManage" : "true",
		"initiator" : {
		    "id" : "1",
		    "username" : "test user",
		    "firstname" : "",
		    "lastname" : "",
			"uuid" : "96F2AD1B-1B83-462E-908A-84E6054F6B64"
		},
		"owner" : {
		    "id" : "1",
		    "username" : "test user",
		    "firstname" : "",
		    "lastname" : "",
			"uuid" : "96F2AD1B-1B83-462E-908A-84E6054F6B64"
		},
		"scan" : {
		    "id" : "18",
		    "name" : "test scan",
		    "description" : "",
			"type" : "policy"
		},
		"repository" : {
		    "id" : "516",
		    "name" : "repo1",
		    "description" : "",
			"type" : "Local",
			"dataFormat" : "IPv4", 
			"uuid" : "A2FF7E13-2C0E-470E-A3C9-E077FE065A54"
		},
		"ownerGroup" : {
		    "id" : "0",
			"name" : "Full Access",
			"description" : "Full Access group"
		}
    },
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1406917515
}

/scanResult/{id}/download

Methods
POST

Downloads the Scan Result associated with {id}.

NOTE: A Scan Result of the requested downloadType must exist for the target Scan Result. For most Scans, only the v2 downloadType applies..

Request Parameters
Expand
{
	"downloadType" : <string> "diagnostic" | "oval" | "scap1_2" | "v2" DEFAULT "v2"
}
Example Response

None. The response is a downloaded file for the requested type.

  • For type "v2", the file is a Nessus file or a zip file containing a Nessus file.
  • For types "oval" and "scap1_2", the file is a zip file containing the oval or scap results.
  • For type "diagnostic", the file is a diagnostic database file.

/scanResult/{id}/attachment/{attachmentID}

GET

Downloads the attachment with the given {attachmentID} for the provided scan result.

Request Parameters

None

Example Response

None given. The response will be the downloaded file in binary or ascii format.