From cf3c3e6c7dd41d38490fee7025d298892dace58d Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 25 Oct 2024 02:44:57 +1100 Subject: [PATCH] [8.x] Security entity store host os fields (#197326) (#197655) # Backport This will backport the following commits from `main` to `8.x`: - [Security entity store host os fields (#197326)](https://github.com/elastic/kibana/pull/197326) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Jared Burgett <147995946+jaredburgettelastic@users.noreply.github.com> --- .../entity_types/host.ts | 2 ++ .../get_united_definition.test.ts | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/host.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/host.ts index e8d812d73ff27..db9266997743e 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/host.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/host.ts @@ -18,6 +18,8 @@ export const getHostUnitedDefinition: UnitedDefinitionBuilder = (fieldHistoryLen collect({ field: 'host.domain' }), collect({ field: 'host.hostname' }), collect({ field: 'host.id' }), + collect({ field: 'host.os.name' }), + collect({ field: 'host.os.type' }), collect({ field: 'host.ip', mapping: { diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.test.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.test.ts index 81a381bc91873..d9c54e1fcd288 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.test.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.test.ts @@ -59,6 +59,12 @@ describe('getUnitedEntityDefinition', () => { "host.name": Object { "type": "keyword", }, + "host.os.name": Object { + "type": "keyword", + }, + "host.os.type": Object { + "type": "keyword", + }, "host.risk.calculated_level": Object { "type": "keyword", }, @@ -95,6 +101,16 @@ describe('getUnitedEntityDefinition', () => { "maxLength": 10, "operation": "collect_values", }, + Object { + "field": "host.os.name", + "maxLength": 10, + "operation": "collect_values", + }, + Object { + "field": "host.os.type", + "maxLength": 10, + "operation": "collect_values", + }, Object { "field": "host.ip", "maxLength": 10, @@ -184,6 +200,22 @@ describe('getUnitedEntityDefinition', () => { "destination": "host.id", "source": "host.id", }, + Object { + "aggregation": Object { + "limit": 10, + "type": "terms", + }, + "destination": "host.os.name", + "source": "host.os.name", + }, + Object { + "aggregation": Object { + "limit": 10, + "type": "terms", + }, + "destination": "host.os.type", + "source": "host.os.type", + }, Object { "aggregation": Object { "limit": 10,