Passive Scanner REST Reference

/passivescanner

Methods
GET

Gets the list of Passive Scanners.

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

ip
port
useProxy
enabled
verifyHost
authType
cert
username
password
version
webVersion
admin
uptime
pluginSet
loadedPluginSet
lastReportTime
createdTime
modifiedTime
repositories

Legend

* = always comes back

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

None

Example Response
 Expand
{
	"type" : "regular",
	"response" : [
		{
			"id" : "1",
			"name" : "My Passive Scanner",
			"description" : "",
			"ip" : "192.168.1.190",
			"port" : "8835",
			"useProxy" : "false",
			"enabled" : "true",
			"verifyHost" : "true",
			"authType" : "password",
			"cert" : null,
			"username" : "nonadmin",
			"password" : "SET",
			"version" : null,
			"webVersion" : null,
			"admin" : "false",
			"uptime" : -1,
			"status" : "8",
			"pluginSet" : null,
			"loadedPluginSet" : null,
			"lastReportTime" : "0",
			"lastCommunication" : "0",
			"createdTime" : "1402434305",
			"modifiedTime" : "1402434804",
			"repositories" : [
				{
					"id" : "100",
					"name" : "Test Repo 192.168.1.0\/16",
					"description" : "",
					"dataFormat" : "IPv4"
				},
			]
		}
	],
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1402434305
}

POST

Adds a Passive Scanner.

Request Parameters
 Expand
{
	"name" : <string>,
	"description" : <string> DEFAULT "",
	"authType" : <string> "certificate" | "password" DEFAULT "password",
	"ip" : <string>,
	"port" : <number>,
	"useProxy" : <string> "true" | "false" DEFAULT "false",
	"verifyHost" : <string> "true" | "false" DEFAULT "true",
	"enabled" : <string> "true" | "false" DEFAULT "true",
	"repositories" : [
		{
			"id" : <number>
		}
	] DEFAULT []
...
}

authType "certificate"

...
	"cert" : <string>,
	"password" : <string> DEFAULT ""
...

authType "password"

...
	"username" : <string>,
	"password" : <string>
...
Example Response
 Expand
{
	"type" : "regular",
	"response" : {
		"id" : "1",
		"name" : "My Passive Scanner",
		"description" : "",
		"ip" : "192.168.1.190",
		"port" : "8835",
		"useProxy" : "false",
		"enabled" : "true",
		"verifyHost" : "true",
		"authType" : "password",
		"cert" : null,
		"username" : "nonadmin",
		"password" : "SET",
		"version" : null,
		"webVersion" : null,
		"admin" : "false",
		"uptime" : -1,
		"status" : "8",
		"pluginSet" : null,
		"loadedPluginSet" : null,
		"lastReportTime" : "0",
		"lastCommunication" : "0",
		"createdTime" : "1402434305",
		"modifiedTime" : "1402434804",
		"repositories" : [
			{
				"id" : "100",
				"name" : "Test Repo 192.168.1.0\/16",
				"description" : "",
				"dataFormat" : "IPv4"
			},
		]
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1401827513
}

/passivescanner/{id}

Methods
GET

Gets the Passive Scanner 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

ip
port
useProxy
enabled
verifyHost
authType
cert
username
password
version
webVersion
admin
uptime
pluginSet
loadedPluginSet
lastReportTime
createdTime
modifiedTime
repositories

Legend

* = always comes back

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

None

Example Response
 Expand
{
	"type" : "regular",
	"response" : {
		"id" : "1",
		"name" : "My Passive Scanner",
		"description" : "",
		"ip" : "192.168.1.190",
		"port" : "8835",
		"useProxy" : "false",
		"enabled" : "true",
		"verifyHost" : "true",
		"authType" : "password",
		"cert" : null,
		"username" : "nonadmin",
		"password" : "SET",
		"version" : null,
		"webVersion" : null,
		"admin" : "false",
		"uptime" : -1,
		"status" : "8",
		"pluginSet" : null,
		"loadedPluginSet" : null,
		"lastReportTime" : "0",
		"lastCommunication" : "0",
		"createdTime" : "1402434305",
		"modifiedTime" : "1402434804",
		"repositories" : [
			{
				"id" : "100",
				"name" : "Test Repo 192.168.1.0\/16",
				"description" : "",
				"dataFormat" : "IPv4"
			},
		]
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1401834305
}


PATCH

Edits the Passive Scanner associated with {id}, changing only the passed in fields.

Request Parameters

(All fields are optional)

Example Response

DELETE

Deletes the Passive Scanner associated with {id}, depending on access and permissions.

Request Parameters

None

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

/passivescanner/updateStatus

POST

Starts an on-demand scanner status update for all Passive Scanners.

Request Parameters

None.

Example Response
 Expand

TODO – Rethink what is returned because the status here is not reflective of any updates since the call was made. We may want to return nothing for "response".

{
	"type" : "regular",
	"response" : [
		{
			"id" : "1",
			"name" : "My Passive Scanner",
			"description" : "",
			"status" : "8200"
		}
	],
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1402435137
}