Tenable Security Center API: Agent Results Sync

 

/agentResultsSync

Methods
GET

Gets the list of Agent Results Syncs.

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
nessusManager
repository
scansGlob
dhcpTracking
emailOnLaunch
emailOnFinish
createdTime
modifiedTime
ownerGroup
creator
owner
reports
numDependents
schedule
lastDownloadSuccess
downloadResultsAfter


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

Expand Parameters

credentials

Filter Parameters

usable - The response will be an object containing an array of usable Agent Results Syncs. By default, both usable and manageable objects are returned.
manageable - The response will be an object containing all manageable Agent Results Syncs.. By default, both usable and manageable objects are returned. 

Example Response
Expand
{
	"type" : "regular",
	"response" : {
		"usable" : [
			{
				"id" : "2",
				"name" : "test",
				"description" : ""
			},
			{
				"id" : "3",
				"name" : "test2",
				"description" : ""
			},
			{
				"id" : "4",
				"name" : "POSTtest",
				"description" : "This is a test for POST"
			}
		],
		"manageable" : [
			{
				"id" : "2",
				"name" : "test",
				"description" : ""
			},
			{
				"id" : "3",
				"name" : "test2",
				"description" : ""
			},
			{
				"id" : "4",
				"name" : "POSTtest",
				"description" : "This is a test for POST"
			}
		]
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1406828340
}

POST

Adds an Agent Results Sync, depending on access and permissions.

NOTE: The field downloadResultsAfter is a timestamp used to determine the cut off point when synchronizing results from agents. Any results before that timestamp will not be imported. The field is ONLY accepted during POST (Not PATCH).


Request Parameters
Expand
{
	"name" : <string>,
	"type" : <string> "plugin" | "policy",
	"description" : <string> DEFAULT "",
	"nessusManager" : {
		"id" : <number>
	},
	"repository" : {
		"id" : <number>
	},
	"scansGlob" : <string> DEFAULT "*",
	"dhcpTracking" : <string> DEFAULT "false",
	"schedule" : {
		"type" : "ical" | "never" | "rollover" | "template" <string> DEFAULT "template",
	},
	"downloadResultsAfter" : <string> (Valid Unix Timestamp) DEFAULT "-1",
	"reports" : [
		{
			"id" : <number>,
			"reportSource" : <string> "cumulative" | "patched" | "individual" | "lce" | "archive" | "mobile"
		}...
	] DEFAULT [],
	"emailOnLaunch" : <string> "false" | "true" DEFAULT "false",
	"emailOnFinish" : <string> "false" | "true" DEFAULT "false"
}


schedule type is "ical"

...
	"schedule" : {
		"start" : <string> (This value takes the iCal format),
		"repeatRule" : <string> (This value takes the repeat rule format)
	}
...
Example Response
Expand
{	
	"type" : "regular",
	"response" : {	
		"id" : "4",
		"name" : "POSTtest",
		"description" : "This is a test for POST",
		"scansGlob" : "Agent*",
		"dhcpTracking" : "false",
		"emailOnLaunch" : "false",
		"emailOnFinish" : "false",
		"status" : "0",
		"createdTime" : "1406815242",
		"modifiedTime" : "1406815242",
		"reports" : [],
		"numDependents" : "0",
		"downloadResultsAfter" : -1,
		"lastDownloadSuccess" : -1,
        "schedule" : {
            "type" : "never",
            "start" : "",
            "repeatRule" : ""
        },
		"creator" : {	
			"id" : "1",
			"username" : "head3",
			"firstname" : "",
			"lastname" : "",
			"uuid" : "48F26F3B-6A79-4153-96DB-4C63D1BF3D46"
		},
		"owner" : {	
			"id" : "1",
			"username" : "head3",
			"firstname" : "",
			"lastname" : "",
			"uuid" : "48F26F3B-6A79-4153-96DB-4C63D1BF3D46"
		},
		"nessusManager" : {
			"id" : "1",
			"name" : "test manager",
			"description" : ""
		},
		"repository" : {
			"id" : "2",
			"name" : "test",
			"description" : "test",
			"type" : "Local" 
			"uuid" : "A2FF7E13-2C0E-470E-A3C9-E077FE065A54"
		},
		"ownerGroup" : {	
			"id" : "0",
			"name" : "Full Access",
			"description" : "Full Access group"
		}
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1406815242
}

/agentResultsSync/{id}

Methods
GET

Gets the Agent Results Sync 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
nessusManager
repository
scansGlob
dhcpTracking
emailOnLaunch
emailOnFinish
createdTime
modifiedTime
ownerGroup
creator
owner
reports
numDependents
schedule
lastDownloadSuccess
downloadResultsAfter

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

Expand Parameters

credentials

Example Response
Expand
{
	"type" : "regular",
	"response" : {
		"id" : "4",
		"name" : "POSTtest",
		"description" : "This is a test for POST",
		"scansGlob" : "Agent*",
		"dhcpTracking" : "false",
		"emailOnLaunch" : "false",
		"emailOnFinish" : "false",
		"status" : "0",
		"createdTime" : "1406815242",
		"modifiedTime" : "1406815242",
		"reports" : [],
		"numDependents" : "0",
		"lastDownloadSuccess" : -1,
		"schedule" : {
            "type" : "never",
            "start" : "",
            "repeatRule" : ""
        },
		"nessusManager" : {
			"id" : "1",
			"name" : "test manager",
			"description" : ""
		},
		"repository" : {
			"id" : "2",
			"name" : "test",
			"description" : "test",
			"type" : "Local" 
			"uuid" : "A2FF7E13-2C0E-470E-A3C9-E077FE065A54"
		},
		"ownerGroup" : {
			"id" : "0",
			"name" : "Full Access",
			"description" : "Full Access group"
		},
		"creator" : {
			"id" : "1",
			"username" : "head3",
			"firstname" : "",
			"lastname" : "",
			"uuid" : "48F26F3B-6A79-4153-96DB-4C63D1BF3D46"
		},
		"owner" : {
			"id" : "1",
			"username" : "head3",
			"firstname" : "",
			"lastname" : "",
			"uuid" : "48F26F3B-6A79-4153-96DB-4C63D1BF3D46"
		}
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1406828664
}

PATCH

Edits the Agent Results Sync associated with {id}, changing only the passed in fields.

Request Parameters

(All fields are optional)

See /agentResultsSync::POST for parameters.

Example Response
See /agentResultsSync/{id}::GET

DELETE

Deletes the Agent Results Sync associated with {id}, depending on access and permissions.

Request Parameters

None

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

/agentResultsSync/{id}/copy

Methods

POST

Copies the Agent Results Sync associated with {id}, depending on access and permissions.

Request Parameters
Expand
{
 	"name" : <string>,
	"targetUser" : {
		"id" : <number>
	}
}
Example Response
Expand
{
	"type" : "regular",
	"response" : {
		"resultsSync" : {
			"id" : "6",
			"name" : "Agents Scan Copy",
			"description" : "",
			"scansGlob" : "*",
			"dhcpTracking" : "true",
			"emailOnLaunch" : "false",
			"emailOnFinish" : "false",
			"status" : "0",
			"lastDownloadSuccess" : "-1",
			"createdTime" : "1442338982",
			"modifiedTime" : "1442338982",
			"reports" : [],
			"numDependents" : "0",
			"schedule" : {
				"id" : "98",
				"objectType" : "synchronizeAgentResults",
				"type" : "template",
				"start" : "",
				"repeatRule" : "",
				"nextRun" : 0
			},
			"nessusManager" : {
				"id" : "24",
				"name" : "DEV nessus 6.5 cloud with agent",
				"description" : "Chris Anderson's scanner, please do not enable zone"
			},
			"repository" : {
				"id" : "14",
				"name" : "John's Test IPv4 Rep",
				"description" : "",
				"type" : "Local" 
				"uuid" : "A2FF7E13-2C0E-470E-A3C9-E077FE065A54"
			},
			"ownerGroup" : {
				"id" : "0",
				"name" : "Full Access",
				"description" : "Full Access group"
			},
			"creator" : {
				"id" : "1",
				"username" : "sm",
				"firstname" : "Security",
				"lastname" : "Manager",
				"uuid" : "48F26F3B-6A79-4153-96DB-4C63D1BF3D46"
			},
			"owner" : {
				"id" : "2",
				"username" : "qahead",
				"firstname" : "",
				"lastname" : "",
				"uuid" : "48F26F3B-6A79-4153-96DB-4C63D1BF3D46"
			}
		}
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1442338982
}

/agentResultsSync/{id}/launch

Methods
POST

Launches the Agent Results Sync associated with {id}.

Request Parameters

None

Example Response
Expand
{
	"type" : "regular",
	"response" : {
		"resultsSyncID" : "1",
		"syncResult" : {
			"initiatorID" : "1",
			"ownerID" : "1",
			"ownerGID" : "0"
		},
		"scanID" : -1,
		"resultsSyncID" : "1",
		"repositoryID" : "14",
		"jobID" : "93484",
		"name" : "John's Agent Scan",
		"description" : "",
		"details" : "",
		"status" : "Queued",
		"importStatus" : "No Results",
		"downloadFormat" : "v2",
		"dataFormat" : "IPv4",
		"resultType" : "agents",
		"running" : false,
		"errorDetails" : "",
		"importErrorDetails" : "",
		"totalIPs" : -1,
		"scannedIPs" : 0,
		"startTime" : -1,
		"finishTime" : 0,
		"id" : "45"
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1442339263
}