Host isolation exceptions

edit

Create, retrieve, update, and delete endpoint host isolation exceptions via API. Host isolation exceptions are managed via the Exceptions API using a static container id (list_id) of endpoint_host_isolation_exceptions, which must be created prior to adding the host isolation exceptions. Access to these APIs requires that a user has authorization to manage endpoints.

Create host isolation exceptions container

edit

POST <kibana host>:<port>/api/exception_lists

Request body

edit

A JSON object containing the fields listed below. The request must have the following:

  • The list_id value must be endpoint_host_isolation_exceptions.
  • The namespace_type value must be agnostic.
  • The type value must be endpoint.
Name Type Description Required

description

String

Describes the host isolation exceptions container.

Yes

list_id

String

Must be set to endpoint_host_isolation_exceptions.

Yes

meta

Object

Placeholder for metadata about the list container.

No

name

String

The host isolation exceptions container’s name.

Yes

namespace_type

String

Must be set to agnostic.

Yes

tags

String[]

String array containing words and phrases to help categorize the host isolation exceptions container.

No

type

String

Must be set to endpoint.

Yes

Example request

edit
POST api/exception_lists
{
  "description": "Endpoint and Cloud Security Host Isolation Exceptions List",
  "name": "Endpoint and Cloud Security Host Isolation Exceptions List",
  "list_id": "endpoint_host_isolation_exceptions",
  "type": "endpoint",
  "namespace_type": "agnostic"
}

Response code

edit
200
Indicates a successful call.

Response payload

edit
{
	"_version": "WzIxMTgsMV0=",
	"created_at": "2022-03-03T13:55:32.176Z",
	"created_by": "elastic",
	"description": "Endpoint and Cloud Security Host Isolation Exceptions List",
	"id": "978cbd00-9af9-11ec-94b1-fd7e90cc2a08",
	"immutable": false,
	"list_id": "endpoint_host_isolation_exceptions",
	"name": "Endpoint and Cloud Security Host Isolation Exceptions List",
	"namespace_type": "agnostic",
	"os_types": [],
	"tags": [],
	"tie_breaker_id": "9894ae5c-2ce0-47dc-8c52-784ca2219fc3",
	"type": "endpoint",
	"updated_at": "2022-03-03T13:55:32.178Z",
	"updated_by": "elastic",
	"version": 1
}

Create host isolation exception

edit

POST <kibana host>:<port>/api/exception_lists/items

Request body

edit

A JSON object containing the fields listed below. The request must have the following:

  • The list_id value must be endpoint_host_isolation_exceptions.
  • The namespace_type value must be agnostic.
  • The type value must be simple.
  • os_types must be an array with all os_types values
Name Type Description Required

comments

comment[]

Array of comment objects.

No, defaults to empty array.

description

String

Describes the host isolation exception item.

Yes

entries

entry[]

Array containing the host isolation exception query conditions. See entry object schema for more details.

Yes.

list_id

String

Must be set to endpoint_host_isolation_exceptions.

Yes

item_id

String

Unique identifier of the exception item.

No, automatically created when it is not provided.

meta

Object

Placeholder for metadata about the exception item.

No

name

String

The host isolation exception name.

Yes

namespace_type

String

Must be set to agnostic for endpoint artifacts.

Yes

os_types

os_type[]

Array of os_type values.

Yes

tags

String[]

An array of strings containing words and phrases to help categorize exception items. Tags can also be used to define the host isolation exception as either globally applicable to all policies or assigned to one or more policies (per policy). See Scope assignment for more details.

No

type

String

Must be set to simple.

Yes

Example request
edit
POST api/exception_lists/items
{
  "description": "some description about this entry",
  "entries": [
      {
          "field": "destination.ip",
          "value": "10.10.0.1",
          "type": "match",
          "operator": "included"
      }
  ],
  "list_id": "endpoint_host_isolation_exceptions",
  "name": "Some name for this item",
  "namespace_type": "agnostic",
  "os_types": [
    "linux",
    "macos",
    "windows"
  ],
  "tags": [
      "policy:all"
  ],
  "type": "simple"
}

Response code

edit
200
Indicates a successful call.

Response payload

edit
{
	"_version": "WzIxNDcsMV0=",
	"created_at": "2022-03-03T14:04:00.496Z",
	"created_by": "elastic",
	"description": "some description about this entry",
	"entries": [
		{
			"field": "destination.ip",
			"value": "10.10.0.1",
			"type": "match",
			"operator": "included"
		}
	],
	"id": "c6883700-9afa-11ec-94b1-fd7e90cc2a08",
	"item_id": "1342081d-66ad-4b03-b554-131195ce404b",
	"list_id": "endpoint_host_isolation_exceptions",
	"name": "Host Isolation Exception - Created with API",
	"namespace_type": "agnostic",
	"os_types": [
		"linux",
		"macos",
		"windows"
	],
	"tags": [
		"policy:all"
	],
	"tie_breaker_id": "b65843e1-07b8-46d2-9e2b-5f0586dc364a",
	"type": "simple",
	"updated_at": "2022-03-03T14:04:00.498Z",
	"updated_by": "elastic"
}

Update host isolation exception

edit

PUT <kibana host>:<port>/api/exception_lists/items

Request body

edit

A JSON object containing the fields listed below. The request must have the following:

  • The list_id value must be endpoint_host_isolation_exceptions.
  • The namespace_type value must be agnostic.
  • The type value must be simple.
  • os_types must be an array with all os_types values
Name Type Description Required

comments

comment[]

Array of comment objects.

No, defaults to empty array.

description

String

Describes the host isolation exception.

Yes

entries

entry[]

Array containing the host isolation exception query conditions. See entry object schema for more details.

Yes.

id

String

The item’s unique identifier.

Yes, when the item’s item_id field is not used.

item_id

String

The item_id of the item you are updating.

Yes, when the item’s id field is not used.

meta

Object

Placeholder for metadata about the exception item.

No

name

String

The host isolation exception name.

Yes

namespace_type

String

Must be set to agnostic.

Yes

os_types

os_type[]

Array of os_type values.

Yes

tags

String[]

An array of strings containing words and phrases to help categorize exception items. Tags can also be used to define the host isolation exception as either globally applicable to all policies or assigned to one or more policies (per policy). See Scope assignment for more details.

No

type

String

Must be simple.

Yes

_version

String

The version id, normally returned by the API when the item was retrieved. Use it ensure updates are done against the latest version.

No

Example request
edit

Updates the entries:

PUT api/exception_lists/items
{
	"description": "via API",
	"entries": [
		{
			"field": "destination.ip",
			"type": "match",
			"value": "10.10.0.15",
			"operator": "included"
		}
	],
	"id": "c6883700-9afa-11ec-94b1-fd7e90cc2a08",
	"item_id": "1342081d-66ad-4b03-b554-131195ce404b",
	"name": "Host Isolation Exception - Created with API",
	"namespace_type": "agnostic",
	"os_types": [
		"linux",
		"macos",
		"windows"
	],
	"type": "simple"
}

Response code

edit
200
Indicates a successful call.

Response payload

edit
{
	"_version": "WzIyMDIsMV0=",
	"created_at": "2022-03-03T14:04:00.496Z",
	"created_by": "elastic",
	"description": "via API",
	"entries": [
		{
			"field": "destination.ip",
			"type": "match",
			"value": "10.10.0.15",
			"operator": "included"
		}
	],
	"id": "c6883700-9afa-11ec-94b1-fd7e90cc2a08",
	"item_id": "1342081d-66ad-4b03-b554-131195ce404b",
	"list_id": "endpoint_host_isolation_exceptions",
	"name": "HIE via API",
	"namespace_type": "agnostic",
	"os_types": [
		"linux",
		"macos",
		"windows"
	],
	"tags": [],
	"tie_breaker_id": "b65843e1-07b8-46d2-9e2b-5f0586dc364a",
	"type": "simple",
	"updated_at": "2022-03-03T14:22:08.345Z",
	"updated_by": "elastic"
}

Delete host isolation exception

edit

DELETE <kibana host>:<port>/api/exception_lists/items

URL query parameters

edit

The URL query must include one of the following:

  • id - the id of the item, or
  • item_id - the item_id of the item

In addition to the above, namespace_type URL query parameter is also required with a value of agnostic.

Example request
edit

Deletes the host isolation exception with item_id of 1342081d-66ad-4b03-b554-131195ce404b:

DELETE api/exception_lists/items?item_id=1342081d-66ad-4b03-b554-131195ce404b&namespace_type=agnostic

Response code

edit
200
Indicates a successful call.

Response payload

edit

The item that was deleted:

{
	"_version": "WzIyNDksMV0=",
	"comments": [],
	"created_at": "2022-03-04T12:42:41.797Z",
	"created_by": "elastic",
	"description": "some description about this entry",
	"entries": [
		{
			"field": "destination.ip",
			"value": "10.10.0.1",
			"type": "match",
			"operator": "included"
		}
	],
	"id": "c6883700-9afa-11ec-94b1-fd7e90cc2a08",
	"item_id": "1342081d-66ad-4b03-b554-131195ce404b",
	"list_id": "endpoint_host_isolation_exceptions",
	"name": "Host Isolation Exception via API",
	"namespace_type": "agnostic",
	"os_types": [
		"linux",
		"macos",
		"windows"
	],
	"tags": [
		"policy:all"
	],
	"tie_breaker_id": "c0401075-7bd5-47e2-bd6c-4f7e088aa348",
	"type": "simple",
	"updated_at": "2022-03-04T12:42:41.802Z",
	"updated_by": "elastic"
}

Retrieve single host isolation exception

edit

GET <kibana host>:<port>/api/exception_lists/items

URL query parameters

edit

The URL query must include one of the following:

  • id - the id of the item, or
  • item_id - the item_id of the item

In addition to the above, namespace_type URL query parameter is also required with a value of agnostic.

Example request
edit
GET api/exception_lists/items?item_id=1342081d-66ad-4b03-b554-131195ce404b&namespace_type=agnostic

Response code

edit
200
Indicates a successful call.

Response payload

edit
{
  "_version": "WzEzNjcsMV0=",
  "created_at": "2022-03-01T16:24:39.471Z",
  "created_by": "elastic",
  "description": "Host Isolation Exception item via API",
  "entries": [
    {
      "field": "destination.ip",
      "type": "match",
      "value": "10.10.0.15",
      "operator": "included"
    }
  ],
  "id": "c6883700-9afa-11ec-94b1-fd7e90cc2a08",
	"item_id": "1342081d-66ad-4b03-b554-131195ce404b",
  "list_id": "endpoint_host_isolation_exceptions",
  "name": "Host Isolation Exception via API",
  "namespace_type": "agnostic",
  "os_types": [
		"linux",
		"macos",
		"windows"
	],
  "tags": [
    "policy:all"
  ],
  "tie_breaker_id": "97fe9d23-c8b8-4dc1-97e1-16444c8d863a",
  "type": "simple",
  "updated_at": "2022-03-01T17:21:07.273Z",
  "updated_by": "elastic"
}

Find host isolation exceptions

edit

GET <kibana host>:<port>/api/exception_lists/items/_find

URL query parameters

edit
Name Type Description Required

list_id

String

Must be set to endpoint_host_isolation_exceptions.

Yes

namespace_type

String

Must be set to agnostic.

Yes

page

Integer

The page number to return.

No

per_page

Integer

The number of items to return per page.

No

sort_field

String

Determines which field is used to sort the results.

No

sort_order

String

Determines the sort order, which can be desc or asc.

No

filter

String

A Kibana Query Language (KQL) string to filter the results down.

No

Example request
edit
GET api/exception_lists/items/_find?page=1&per_page=10&sort_field=name&sort_order=asc&list_id=endpoint_host_isolation_exceptions&namespace_type=agnostic

Response code

edit
200
Indicates a successful call.

Response payload

edit
{
  "data": [
    {
      "_version": "WzEzNjcsMV0=",
      "created_at": "2022-03-01T16:24:39.471Z",
      "created_by": "elastic",
      "description": "Host Isolation Exception item via API",
      "entries": [
        {
          "field": "destination.ip",
          "type": "match",
          "value": "10.10.0.15",
          "operator": "included"
        }
      ],
      "id": "4e0e4e10-9af8-11ec-94b1-fd7e90cc2a08",
      "item_id": "6555a6ed-b31c-4c74-b1a1-f2c5d9fb7d4a",
      "list_id": "endpoint_host_isolation_exceptions",
      "name": "Host Isolation Exception via API",
      "namespace_type": "agnostic",
      "os_types": [
        "linux",
        "macos",
        "windows"
      ],
      "tags": [
        "policy:all"
      ],
      "tie_breaker_id": "97fe9d23-c8b8-4dc1-97e1-16444c8d863a",
      "type": "simple",
      "updated_at": "2022-03-01T17:21:07.273Z",
      "updated_by": "elastic"
    }
  ],
  "page": 1,
  "per_page": 10,
  "total": 1
}

Value types

edit

The following describes the types that can be defined when using the create or update host isolation exceptions APIs:

comment object schema

edit

Comments are JSON objects containing the following structure:

{
    "comment": "some comment here"
}

When used with the update API, existing comments can be updated by using their associated id, while any comment without the id attribute will be added as a new comment:

{
    "comment": "some comment here - updated",
    "id": "1078cf59-5893-4143-acf7-40a40af16bee"
}

os_types values

edit

The following are the valid OS types that can be used when creating host isolation exceptions:

  • windows
  • linux
  • macos

Scope assignment

edit

Host isolation exceptions can be assigned globally across all endpoint policies, or assigned to specific policies. You can assign the host isolation exception by defining one or more tags with a prefix of policy:. Note that the host isolation exception can be either global or per policy, but not both. The following tags are available for use in order to control the assignment scope:

  • policy:all : Host isolation exception is global to all policies. If used, no other policy: tag is allowed.
  • policy:<endpoint-policy-id> : Host isolation exception is assigned to a policy. Multiple per policy tags can be used to associate the host isolation exception to multiple policies.

entry object schema

edit

Host isolation exceptions allow for at most 1 condition to be defined. The following entry is supported by host isolation exceptions:

Destination IPs
edit

Destination IPs are supported by all OS types. A destination IP entry has the following structure:

{
  "field": "destination.ip",
  "value": "192.168.1.1",
  "type": "match",
  "operator": "included"
}
  • field : destination.ip.
  • value : A valid IPv4 address with optional CIDR associated with the field.
  • type : Must be match.
  • operator : Must be included.