SecurityCenter API: Accept Risk Rule

/acceptRiskRule

Methods
GET

Gets the list of Accept Risk Rules across all reps, plugins and orgs, unless filters are provided.

Fields Parameter
Expand

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

    ?fields=<field>,...

Allowed Fields

*id
**repository
**organization
**user
**plugin
**hostType
**hostValue
**port
**protocol
**expires
**status
comments
createdTime
modifiedTime

Legend

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

Filters
Expand
repositoryIDs=<number>,... DEFAULT 0 (i.e. all Repositories)
pluginID=<number> | <string> "all" DEFAULT "all" (i.e. all Plugins)
port=<number> | <string> "all" DEFAULT "all" (i.e. all Ports)

Session User is role "1" (administrator)

organizationIDs=<number>,... | <string> "all" DEFAULT "all" (i.e. all Organizations)

Session User is not role "1" (administrator)

organizationIDs=<number>,... | <string> "all" DEFAULT :sessionOrgID:
Example Response
Expand
 {
	"type" : "regular",
	"response" : [
		{
			"id" : "3",
			"hostType" : "all",
			"hostValue" : "",
			"port" : "any",
			"protocol" : "any",
			"expires" : "-1",
			"status" : "0",
			"repository" : {
				"id" : "17",
				"name" : "New Fields Repo",
				"description" : ""
			},
			"organization" : {
				"id" : "8",
				"name" : "Org",
				"description" : "Testing for Policies with New Schema"
			},
			"user" : {
				"id" : "1",
				"username" : "head",
				"firstname" : "Security Manager",
				"lastname" : ""
			},
			"plugin" : {
				"id" : "0",
				"name" : "Open Port",
				"description" : ""
			}
		}
	],
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1410275054
}

POST

Adds an Accept Risk Rule to one repository.

Request Parameters
Expand
{
	"repositories" : [
		{
			"id" : <number>
		}...
	],
	"plugin" : {
		"id" : <number>
	},
	"hostType" : <string> "all" | "asset" | "ip" | "uuid",
	"port" : <number:1..65535> | <string> "any" DEFAULT "any",
	"protocol" : <number:1..> | <string> "any" DEFAULT "any",
	"comments" : <string> DEFAULT "",
	"expires" : <number> (integer >= -1) DEFAULT -1 (not set)
	...
}

hostType "asset"

The "hostValue" parameter should contain a usable, accessible Asset ID.

...
	"hostValue" : {
		"id" : <number>
	}
...

hostType "ip"

The "hostValue" parameter should contain a newline-separated and/or comma-separated list of IPs.

...
	"hostValue" : <string>
...

hostType "uuid"

The "hostValue" parameter should contain a newline-separated and/or comma-separated list of UUIDs.

...
	"hostValue" : <string>
...
Example Response
Expand
 {
	"type" : "regular",
	"response" : [
		{
			"id" : "3",
			"repID" : "17",
			"orgID" : "8",
			"userID" : "1",
			"pluginID" : "0",
			"hostType" : "all",
			"hostValue" : "",
			"port" : "any",
			"protocol" : "any",
			"comments" : "",
			"expires" : "-1",
			"status" : "0",
			"createdTime" : "1410275013",
			"modifiedTime" : "1410275013",
			"repository" : {
				"id" : "17",
				"name" : "New Fields Repo",
				"description" : ""
			},
			"organization" : {
				"id" : "8",
				"name" : "Org",
				"description" : "Testing for Policies with New Schema"
			},
			"user" : {
				"id" : "1",
				"username" : "head",
				"firstname" : "Security Manager",
				"lastname" : ""
			},
			"plugin" : {
				"id" : "0",
				"name" : "Open Port",
				"description" : ""
			}
		}
	],
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1410275013
}

/acceptRiskRule/{id}

Methods
GET

Gets the Accept Risk Rule 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
**repository
**organization
**user
**plugin
**hostType
**hostValue
**port
**protocol
**expires
**status
comments
createdTime
modifiedTime

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" : "3",
		"hostType" : "all",
		"hostValue" : "",
		"port" : "any",
		"protocol" : "any",
		"comments" : "",
		"expires" : "-1",
		"status" : "0",
		"createdTime" : "1410275013",
		"modifiedTime" : "1410275013",
		"repository" : {
			"id" : "17",
			"name" : "New Fields Repo",
			"description" : ""
		},
		"organization" : {
			"id" : "8",
			"name" : "Org",
			"description" : "Testing for Policies with New Schema"
		},
		"user" : {
			"id" : "1",
			"username" : "head",
			"firstname" : "Security Manager",
			"lastname" : ""
		},
		"plugin" : {
			"id" : "0",
			"name" : "Open Port",
			"description" : ""
		}
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1410275074
}

PATCH

Edits the Accept Risk Rule associated with {id}, changing only the passed in fields.

Request Parameters

(All fields are optional)

See /acceptRiskRule::POST for parameters.

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

DELETE

Deletes the Accept Risk Rule 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
}

/acceptRiskRule/apply

Methods
POST

Applies all rules for the given repository or all (id: 0)

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