-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Entity Analytics] Add Asset Criticality public API docs (#5660)
* add asset criticality API docs * fix crititcality_level * remove unused schema * Editorial review * change list API to GET * Update docs/advanced-entity-analytics/api/asset-criticality-api-list.asciidoc * Update asset-criticality-api-bulk-upsert.asciidoc --------- Co-authored-by: natasha-moore-elastic <[email protected]> Co-authored-by: natasha-moore-elastic <[email protected]>
- Loading branch information
1 parent
db80fb2
commit 01c5ab5
Showing
9 changed files
with
345 additions
and
1 deletion.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
docs/advanced-entity-analytics/api/asset-criticality-api-bulk-upsert.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
[[asset-criticality-api-bulk-upsert]] | ||
=== Bulk upsert (create or update) asset criticality records | ||
|
||
Create or update asset criticality records for multiple entities. | ||
|
||
If asset criticality records already exist for the entities specified in the request, this API overwrites those records with the specified values. | ||
|
||
If asset criticality records don't exist for the specified entities, new records are created. | ||
|
||
==== Request URL | ||
|
||
`POST <kibana host>:<port>/api/asset_criticality/bulk` | ||
|
||
==== Request body | ||
|
||
A JSON object defining the asset criticality records. | ||
|
||
[width="100%",options="header"] | ||
|============================================== | ||
|Name |Type |Description |Required | ||
|`records` |Array |Array of asset criticality records to be created or updated. The maximum number of records is 1000. | ||
|Yes | ||
|`records.id_field` |String |The field that contains the entity ID. This must be either `user.name` or `host.name`. | ||
|Yes | ||
|`records.id_value` |String |The ID (host name or user name) of the entity specified in the `records.id_field` field. | ||
|Yes | ||
|`records.criticality_level` |String a|The asset criticality level to assign, which must be one of the following: | ||
|
||
* `low_impact` | ||
* `medium_impact` | ||
* `high_impact` | ||
* `extreme_impact` | ||
|
||
For example, you can assign `extreme_impact` to business-critical entities, or `low_impact` to entities that pose minimal risk to your security posture. | ||
|Yes | ||
|============================================== | ||
|
||
===== Example requests | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
POST /api/asset_criticality/bulk | ||
{ | ||
"records": [ | ||
{ | ||
"id_field": "host.name", | ||
"id_value": "my_host", | ||
"criticality_level": "medium_impact" | ||
}, | ||
{ | ||
"id_field": "host.name", | ||
"id_value": "my_other_host", | ||
"criticality_level": "low_impact" | ||
} | ||
] | ||
} | ||
-------------------------------------------------- | ||
|
||
==== Response code | ||
|
||
`200`:: | ||
Indicates a successful call. | ||
|
||
==== Example response | ||
|
||
Successful response | ||
|
||
[source,json] | ||
-------------------------------------------------- | ||
{ | ||
"errors": [], | ||
"stats": { | ||
"successful": 2, | ||
"failed": 0, | ||
"total": 2 | ||
} | ||
} | ||
-------------------------------------------------- |
64 changes: 64 additions & 0 deletions
64
docs/advanced-entity-analytics/api/asset-criticality-api-delete.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
[[delete-criticality-api-delete]] | ||
=== Delete asset criticality record | ||
|
||
Delete a single asset criticality record by ID field and ID value. | ||
|
||
==== Request URL | ||
|
||
`DELETE <kibana host>:<port>/api/asset_criticality` | ||
|
||
==== URL query parameters | ||
|
||
[width="100%",options="header"] | ||
|============================================== | ||
|Name |Type |Description |Required | ||
|
||
|`id_field` |String |The field that contains the entity ID. This must be either `user.name` or `host.name`. | ||
|Yes | ||
|`id_value` |String |The ID (host name or user name) of the entity specified in the `id_field` field. | ||
|Yes | ||
|
||
|============================================== | ||
|
||
===== Example requests | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
DELETE /api/asset_criticality?id_field=host.name&id_value=my_host | ||
-------------------------------------------------- | ||
|
||
==== Response code | ||
|
||
`200`:: | ||
Indicates a successful call. Check the response body to see if the record was deleted. | ||
|
||
==== Example responses | ||
|
||
*Example 1* | ||
|
||
If the record was deleted. | ||
|
||
[source,json] | ||
-------------------------------------------------- | ||
{ | ||
"deleted": true, | ||
"record": { | ||
"id_field": "host.name", | ||
"id_value": "my_host", | ||
"criticality_level": "medium_impact", | ||
"@timestamp": "2024-08-05T09:42:11.240Z" | ||
} | ||
} | ||
-------------------------------------------------- | ||
|
||
*Example 2* | ||
|
||
If the record was not found and could not be deleted. | ||
|
||
[source,json] | ||
-------------------------------------------------- | ||
{ | ||
"deleted": false | ||
} | ||
-------------------------------------------------- |
48 changes: 48 additions & 0 deletions
48
docs/advanced-entity-analytics/api/asset-criticality-api-get.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[[asset-criticality-api-get]] | ||
=== Get asset criticality record | ||
|
||
Retrieve a single asset criticality record by ID field and ID value. | ||
|
||
==== Request URL | ||
|
||
`GET <kibana host>:<port>/api/asset_criticality` | ||
|
||
==== URL query parameters | ||
|
||
[width="100%",options="header"] | ||
|============================================== | ||
|Name |Type |Description |Required | ||
|
||
|`id_field` |String |The field that contains the entity ID. This must be either `user.name` or `host.name`. | ||
|Yes | ||
|`id_value` |String |The ID (host name or user name) of the entity specified in the `id_field` field. | ||
|Yes | ||
|
||
|============================================== | ||
|
||
===== Example requests | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
GET /api/asset_criticality?id_field=host.name&id_value=my_host | ||
-------------------------------------------------- | ||
|
||
==== Response code | ||
|
||
`200`:: | ||
Indicates a successful call. | ||
`404`:: | ||
Indicates the criticality record was not found. | ||
|
||
==== Example response | ||
|
||
[source,json] | ||
-------------------------------------------------- | ||
{ | ||
"id_field": "host.name", | ||
"id_value": "my_host", | ||
"criticality_level": "high_impact", | ||
"@timestamp": "2024-08-02T11:15:34.290Z" | ||
} | ||
-------------------------------------------------- |
11 changes: 11 additions & 0 deletions
11
docs/advanced-entity-analytics/api/asset-criticality-api-index.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
include::asset-criticality-api-overview.asciidoc[] | ||
|
||
include::asset-criticality-api-upsert.asciidoc[] | ||
|
||
include::asset-criticality-api-bulk-upsert.asciidoc[] | ||
|
||
include::asset-criticality-api-get.asciidoc[] | ||
|
||
include::asset-criticality-api-list.asciidoc[] | ||
|
||
include::asset-criticality-api-delete.asciidoc[] |
72 changes: 72 additions & 0 deletions
72
docs/advanced-entity-analytics/api/asset-criticality-api-list.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[[asset-criticality-api-list]] | ||
=== List asset criticality records | ||
|
||
Retrieve a list of asset criticality records. | ||
|
||
Use the query parameters to filter and sort the results as needed. By default, the first page is returned, with 10 results per page. | ||
|
||
==== Request URL | ||
|
||
`GET <kibana host>:<port>/api/asset_criticality/list` | ||
|
||
==== URL query parameters | ||
|
||
[width="100%",options="header"] | ||
|============================================== | ||
|Name |Type |Description |Required | ||
|
||
|`sort_field` |String a|The field to sort the results by, which must be one of the following: | ||
|
||
* `id_value` | ||
* `id_field` | ||
* `criticality_level` | ||
* `@timestamp` | ||
|
||
|No | ||
|`sort_direction` |String |The order to sort the results in, which must be either `asc` or `desc`. | ||
|No | ||
|`page` |Number | The page number to return, which must be at least 1. Defaults to `1`. | ||
|No | ||
|`per_page` |Number |The number of results to return per page, which must be between 1 and 1000. Defaults to `10`. | ||
|No | ||
|`kuery` |String a|A KQL query to filter results by, for example `criticality_level:low_impact OR criticality_level:medium_impact` | ||
|No | ||
|============================================== | ||
|
||
===== Example requests | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
GET api/asset_criticality/list?kuery=criticality_level:high_impact%20OR%20criticality_level:medium_impact | ||
-------------------------------------------------- | ||
|
||
==== Response code | ||
|
||
`200`:: | ||
Indicates a successful call. | ||
|
||
==== Example response | ||
|
||
[source,json] | ||
-------------------------------------------------- | ||
{ | ||
"records": [ | ||
{ | ||
"id_field": "host.name", | ||
"id_value": "my_other_host", | ||
"criticality_level": "medium_impact", | ||
"@timestamp": "2024-08-02T14:40:35.705Z" | ||
}, | ||
{ | ||
"id_field": "host.name", | ||
"id_value": "my_host", | ||
"criticality_level": "high_impact", | ||
"@timestamp": "2024-08-02T11:15:34.290Z" | ||
} | ||
], | ||
"total": 2, | ||
"page": 1, | ||
"per_page": 10 | ||
} | ||
-------------------------------------------------- |
5 changes: 5 additions & 0 deletions
5
docs/advanced-entity-analytics/api/asset-criticality-api-overview.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[[asset-criticality-api-overview]] | ||
[role="xpack"] | ||
== Asset criticality API | ||
|
||
You can manage <<asset-criticality, asset criticality>> records through the API. To use this API, you must first turn on the `securitySolution:enableAssetCriticality` <<enable-asset-criticality, advanced setting>>. |
63 changes: 63 additions & 0 deletions
63
docs/advanced-entity-analytics/api/asset-criticality-api-upsert.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
[[asset-criticality-api-upsert]] | ||
=== Upsert (create or update) asset criticality record | ||
|
||
Create or update an asset criticality record. | ||
|
||
If an asset criticality record already exists for the entity specified in the request, this API overwrites that record with the specified value. | ||
|
||
If an asset criticality record doesn't exist for the specified entity, a new record is created. | ||
|
||
==== Request URL | ||
|
||
`POST <kibana host>:<port>/api/asset_criticality` | ||
|
||
==== Request body | ||
|
||
A JSON object defining the asset criticality record. | ||
|
||
[width="100%",options="header"] | ||
|============================================== | ||
|Name |Type |Description |Required | ||
|`id_field` |String |The field that contains the entity ID. This must be either `user.name` or `host.name`. | ||
|Yes | ||
|`id_value` |String |The ID (host name or user name) of the entity specified in the `id_field` field. | ||
|Yes | ||
|`criticality_level` |String a|The asset criticality level to assign, which must be one of the following: | ||
|
||
* `low_impact` | ||
* `medium_impact` | ||
* `high_impact` | ||
* `extreme_impact` | ||
|
||
For example, you can assign `extreme_impact` to business-critical entities, or `low_impact` to entities that pose minimal risk to your security posture. | ||
|Yes | ||
|============================================== | ||
|
||
===== Example requests | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
POST /api/asset_criticality | ||
{ | ||
"id_field": "host.name", | ||
"id_value": "my_host", | ||
"criticality_level": "high_impact" | ||
} | ||
-------------------------------------------------- | ||
|
||
==== Response code | ||
|
||
`200`:: | ||
Indicates a successful call. | ||
|
||
==== Example response | ||
|
||
[source,json] | ||
-------------------------------------------------- | ||
{ | ||
"id_field": "host.name", | ||
"id_value": "my_host", | ||
"criticality_level": "high_impact", | ||
"@timestamp": "2024-08-02T11:15:34.290Z" | ||
} | ||
-------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters