|
| 1 | +/* |
| 2 | + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one |
| 3 | + * or more contributor license agreements. Licensed under the Elastic License |
| 4 | + * 2.0; you may not use this file except in compliance with the Elastic License |
| 5 | + * 2.0. |
| 6 | + */ |
| 7 | + |
| 8 | +import { DefendInsightStatus, DefendInsightType } from '@kbn/elastic-assistant-common'; |
| 9 | + |
| 10 | +import type { EsDefendInsightSchema } from '../lib/defend_insights/persistence/types'; |
| 11 | + |
| 12 | +export const getParsedDefendInsightsMock = (timestamp: string): EsDefendInsightSchema[] => [ |
| 13 | + { |
| 14 | + '@timestamp': timestamp, |
| 15 | + created_at: timestamp, |
| 16 | + updated_at: timestamp, |
| 17 | + last_viewed_at: timestamp, |
| 18 | + users: [ |
| 19 | + { |
| 20 | + id: 'u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0', |
| 21 | + name: 'elastic', |
| 22 | + }, |
| 23 | + ], |
| 24 | + status: DefendInsightStatus.Enum.succeeded, |
| 25 | + api_config: { |
| 26 | + action_type_id: '.bedrock', |
| 27 | + connector_id: 'ac4e19d1-e2e2-49af-bf4b-59428473101c', |
| 28 | + model: 'anthropic.claude-3-5-sonnet-20240620-v1:0', |
| 29 | + }, |
| 30 | + endpoint_ids: ['6e09ec1c-644c-4148-a02d-be451c35400d'], |
| 31 | + insight_type: DefendInsightType.Enum.incompatible_antivirus, |
| 32 | + insights: [ |
| 33 | + { |
| 34 | + group: 'windows_defenders', |
| 35 | + events: [], |
| 36 | + }, |
| 37 | + ], |
| 38 | + namespace: 'default', |
| 39 | + id: '655c52ec-49ee-4d20-87e5-7edd6d8f84e8', |
| 40 | + generation_intervals: [ |
| 41 | + { |
| 42 | + date: timestamp, |
| 43 | + duration_ms: 13113, |
| 44 | + }, |
| 45 | + ], |
| 46 | + average_interval_ms: 13113, |
| 47 | + events_context_count: 100, |
| 48 | + replacements: [ |
| 49 | + { |
| 50 | + uuid: '2009c67b-89b8-43d9-b502-2c32f71875a0', |
| 51 | + value: 'root', |
| 52 | + }, |
| 53 | + { |
| 54 | + uuid: '9f7f91b6-6853-48b7-bfb8-403f5efb2364', |
| 55 | + value: 'joey-dev-default-3539', |
| 56 | + }, |
| 57 | + ], |
| 58 | + }, |
| 59 | + { |
| 60 | + '@timestamp': timestamp, |
| 61 | + created_at: timestamp, |
| 62 | + updated_at: timestamp, |
| 63 | + last_viewed_at: timestamp, |
| 64 | + users: [ |
| 65 | + { |
| 66 | + id: '00468e82-e37f-4224-80c1-c62e594c74b1', |
| 67 | + name: 'ubuntu', |
| 68 | + }, |
| 69 | + ], |
| 70 | + status: DefendInsightStatus.Enum.succeeded, |
| 71 | + api_config: { |
| 72 | + action_type_id: '.bedrock', |
| 73 | + connector_id: 'bc5e19d1-e2e2-49af-bf4b-59428473101d', |
| 74 | + model: 'anthropic.claude-3-5-sonnet-20240620-v1:0', |
| 75 | + }, |
| 76 | + endpoint_ids: ['b557bb12-8206-44b6-b2a5-dbcce5b1e65e'], |
| 77 | + insight_type: DefendInsightType.Enum.noisy_process_tree, |
| 78 | + insights: [ |
| 79 | + { |
| 80 | + group: 'linux_security', |
| 81 | + events: [], |
| 82 | + }, |
| 83 | + ], |
| 84 | + namespace: 'default', |
| 85 | + id: '7a1b52ec-49ee-4d20-87e5-7edd6d8f84e9', |
| 86 | + generation_intervals: [ |
| 87 | + { |
| 88 | + date: timestamp, |
| 89 | + duration_ms: 13113, |
| 90 | + }, |
| 91 | + ], |
| 92 | + average_interval_ms: 13113, |
| 93 | + events_context_count: 100, |
| 94 | + replacements: [ |
| 95 | + { |
| 96 | + uuid: '3119c67b-89b8-43d9-b502-2c32f71875b1', |
| 97 | + value: 'ubuntu', |
| 98 | + }, |
| 99 | + { |
| 100 | + uuid: '8e7f91b6-6853-48b7-bfb8-403f5efb2365', |
| 101 | + value: 'ubuntu-dev-default-3540', |
| 102 | + }, |
| 103 | + ], |
| 104 | + }, |
| 105 | +]; |
| 106 | + |
| 107 | +export const getRawDefendInsightsMock = (timestamp: string) => |
| 108 | + JSON.stringify(getParsedDefendInsightsMock(timestamp)); |
0 commit comments