({
matches: false,
media: query,
onchange: null,
- addListener: jest.fn(),
- removeListener: jest.fn(),
+ addListener: jest.fn(), // deprecated
+ removeListener: jest.fn(), // deprecated
+ addEventListener: jest.fn(),
+ removeEventListener: jest.fn(),
}));
diff --git a/x-pack/plugins/cases/public/components/all_cases/columns_popover.test.tsx b/x-pack/plugins/cases/public/components/all_cases/columns_popover.test.tsx
index c32bed8fb84f7..c6278187d960c 100644
--- a/x-pack/plugins/cases/public/components/all_cases/columns_popover.test.tsx
+++ b/x-pack/plugins/cases/public/components/all_cases/columns_popover.test.tsx
@@ -13,10 +13,7 @@ import type { AppMockRenderer } from '../../common/mock';
import { createAppMockRenderer } from '../../common/mock';
import { ColumnsPopover } from './columns_popover';
-// FLAKY: https://github.com/elastic/kibana/issues/174682
-// FLAKY: https://github.com/elastic/kibana/issues/174683
-// FLAKY: https://github.com/elastic/kibana/issues/174684
-describe.skip('ColumnsPopover', () => {
+describe('ColumnsPopover', () => {
let appMockRenderer: AppMockRenderer;
beforeEach(() => {
@@ -85,7 +82,13 @@ describe.skip('ColumnsPopover', () => {
);
userEvent.click(await screen.findByTestId('column-selection-popover-button'));
- userEvent.click(await screen.findByTestId('column-selection-popover-show-all-button'));
+ userEvent.click(
+ await screen.findByTestId('column-selection-popover-show-all-button'),
+ undefined,
+ {
+ skipPointerEventsCheck: true,
+ }
+ );
const onSelectedColumnsChangeCallParams = selectedColumns.map((column) => ({
...column,
@@ -108,7 +111,13 @@ describe.skip('ColumnsPopover', () => {
);
userEvent.click(await screen.findByTestId('column-selection-popover-button'));
- userEvent.click(await screen.findByTestId('column-selection-popover-hide-all-button'));
+ userEvent.click(
+ await screen.findByTestId('column-selection-popover-hide-all-button'),
+ undefined,
+ {
+ skipPointerEventsCheck: true,
+ }
+ );
await waitFor(() => {
expect(onSelectedColumnsChange).toHaveBeenCalledWith(
diff --git a/x-pack/plugins/cases/public/components/user_actions/property_actions/user_comment_property_actions.test.tsx b/x-pack/plugins/cases/public/components/user_actions/property_actions/user_comment_property_actions.test.tsx
index 643662dfbc3f7..79f1c7ffc29d7 100644
--- a/x-pack/plugins/cases/public/components/user_actions/property_actions/user_comment_property_actions.test.tsx
+++ b/x-pack/plugins/cases/public/components/user_actions/property_actions/user_comment_property_actions.test.tsx
@@ -17,7 +17,12 @@ import {
import { UserCommentPropertyActions } from './user_comment_property_actions';
import { waitFor } from '@testing-library/react';
-describe('UserCommentPropertyActions', () => {
+// FLAKY: https://github.com/elastic/kibana/issues/175310
+// FLAKY: https://github.com/elastic/kibana/issues/175311
+// FLAKY: https://github.com/elastic/kibana/issues/175312
+// FLAKY: https://github.com/elastic/kibana/issues/175313
+// FLAKY: https://github.com/elastic/kibana/issues/175314
+describe.skip('UserCommentPropertyActions', () => {
let appMock: AppMockRenderer;
const props = {
diff --git a/x-pack/plugins/cases/server/telemetry/queries/configuration.test.ts b/x-pack/plugins/cases/server/telemetry/queries/configuration.test.ts
index 6fd1da4903ed6..57c7c067a13cf 100644
--- a/x-pack/plugins/cases/server/telemetry/queries/configuration.test.ts
+++ b/x-pack/plugins/cases/server/telemetry/queries/configuration.test.ts
@@ -6,6 +6,7 @@
*/
import { loggingSystemMock, savedObjectsRepositoryMock } from '@kbn/core/server/mocks';
+import { CustomFieldTypes } from '../../../common/types/domain';
import { getConfigurationTelemetryData } from './configuration';
describe('configuration', () => {
@@ -15,7 +16,7 @@ describe('configuration', () => {
savedObjectsClient.find.mockResolvedValue({
total: 5,
saved_objects: [],
- per_page: 1,
+ per_page: 5,
page: 1,
aggregations: {
closureType: {
@@ -26,6 +27,39 @@ describe('configuration', () => {
},
},
});
+ const customFieldsMock = [
+ {
+ key: 'foobar1',
+ label: 'foobar1',
+ type: CustomFieldTypes.TEXT,
+ required: false,
+ },
+ {
+ key: 'foobar2',
+ label: 'foobar2',
+ type: CustomFieldTypes.TOGGLE,
+ required: true,
+ },
+ {
+ key: 'foobar3',
+ label: 'foobar3',
+ type: 'foo',
+ required: true,
+ },
+ {
+ key: 'foobar4',
+ label: 'foobar4',
+ type: CustomFieldTypes.TOGGLE,
+ required: true,
+ },
+ ];
+ const emptyCustomFieldsMock = {
+ customFields: {
+ required: 0,
+ totals: 0,
+ totalsByType: {},
+ },
+ };
beforeEach(() => {
jest.clearAllMocks();
@@ -39,7 +73,11 @@ describe('configuration', () => {
manually: 1,
automatic: 2,
},
+ ...emptyCustomFieldsMock,
},
+ sec: { ...emptyCustomFieldsMock },
+ obs: { ...emptyCustomFieldsMock },
+ main: { ...emptyCustomFieldsMock },
});
});
@@ -54,10 +92,150 @@ describe('configuration', () => {
},
},
filter: undefined,
- page: 0,
- perPage: 0,
+ page: 1,
+ perPage: 5,
type: 'cases-configure',
});
});
+
+ it('returns correct res with customFields', async () => {
+ savedObjectsClient.find.mockResolvedValue({
+ total: 5,
+ saved_objects: [
+ {
+ score: 1,
+ id: 'test',
+ references: [],
+ type: 'cases',
+ attributes: {
+ owner: 'cases',
+ customFields: customFieldsMock,
+ },
+ },
+ {
+ score: 1,
+ id: 'test1',
+ references: [],
+ type: 'cases',
+ attributes: {
+ owner: 'observability',
+ customFields: customFieldsMock,
+ },
+ },
+ ],
+ per_page: 5,
+ page: 1,
+ aggregations: {
+ closureType: {
+ buckets: [
+ { doc_count: 1, key: 'close-by-user' },
+ { doc_count: 2, key: 'close-by-pushing' },
+ ],
+ },
+ },
+ });
+
+ const res = await getConfigurationTelemetryData({ savedObjectsClient, logger });
+ expect(res).toEqual({
+ all: {
+ closure: {
+ manually: 1,
+ automatic: 2,
+ },
+ customFields: {
+ totals: 8,
+ required: 6,
+ totalsByType: {
+ text: 2,
+ toggle: 4,
+ foo: 2,
+ },
+ },
+ },
+ sec: { ...emptyCustomFieldsMock },
+ obs: {
+ customFields: {
+ totals: 4,
+ required: 3,
+ totalsByType: {
+ text: 1,
+ toggle: 2,
+ foo: 1,
+ },
+ },
+ },
+ main: {
+ customFields: {
+ totals: 4,
+ required: 3,
+ totalsByType: {
+ text: 1,
+ toggle: 2,
+ foo: 1,
+ },
+ },
+ },
+ });
+ });
+
+ it('returns correct res with securitySolution customFields', async () => {
+ savedObjectsClient.find.mockResolvedValue({
+ total: 5,
+ saved_objects: [
+ {
+ score: 1,
+ id: 'test',
+ references: [],
+ type: 'cases',
+ attributes: {
+ owner: 'securitySolution',
+ customFields: customFieldsMock,
+ },
+ },
+ ],
+ per_page: 5,
+ page: 1,
+ aggregations: {
+ closureType: {
+ buckets: [
+ { doc_count: 1, key: 'close-by-user' },
+ { doc_count: 2, key: 'close-by-pushing' },
+ ],
+ },
+ },
+ });
+
+ const res = await getConfigurationTelemetryData({ savedObjectsClient, logger });
+ expect(res).toEqual({
+ all: {
+ closure: {
+ manually: 1,
+ automatic: 2,
+ },
+ customFields: {
+ totals: 4,
+ required: 3,
+ totalsByType: {
+ text: 1,
+ toggle: 2,
+ foo: 1,
+ },
+ },
+ },
+ sec: {
+ customFields: {
+ totals: 4,
+ required: 3,
+ totalsByType: {
+ text: 1,
+ toggle: 2,
+ foo: 1,
+ },
+ },
+ },
+ obs: { ...emptyCustomFieldsMock },
+ main: { ...emptyCustomFieldsMock },
+ });
+ });
});
});
diff --git a/x-pack/plugins/cases/server/telemetry/queries/configuration.ts b/x-pack/plugins/cases/server/telemetry/queries/configuration.ts
index 9a5b2bfe97f6a..e3aff3216f5d5 100644
--- a/x-pack/plugins/cases/server/telemetry/queries/configuration.ts
+++ b/x-pack/plugins/cases/server/telemetry/queries/configuration.ts
@@ -5,21 +5,28 @@
* 2.0.
*/
-import { CASE_CONFIGURE_SAVED_OBJECT } from '../../../common/constants';
+import type { Owner } from '../../../common/constants/types';
+import {
+ CASE_CONFIGURE_SAVED_OBJECT,
+ GENERAL_CASES_OWNER,
+ OBSERVABILITY_OWNER,
+ SECURITY_SOLUTION_OWNER,
+} from '../../../common/constants';
import type { Buckets, CasesTelemetry, CollectTelemetryDataParams } from '../types';
-import { findValueInBuckets } from './utils';
+import type { ConfigurationPersistedAttributes } from '../../common/types/configure';
+import { findValueInBuckets, getCustomFieldsTelemetry } from './utils';
export const getConfigurationTelemetryData = async ({
savedObjectsClient,
}: CollectTelemetryDataParams): Promise
=> {
const res = await savedObjectsClient.find<
- unknown,
+ { customFields: ConfigurationPersistedAttributes['customFields']; owner: Owner },
{
closureType: Buckets;
}
>({
- page: 0,
- perPage: 0,
+ page: 1,
+ perPage: 5,
type: CASE_CONFIGURE_SAVED_OBJECT,
aggs: {
closureType: {
@@ -30,12 +37,38 @@ export const getConfigurationTelemetryData = async ({
const closureBuckets = res.aggregations?.closureType?.buckets ?? [];
+ const allCustomFields = res.saved_objects
+ .map((sObj) => sObj.attributes.customFields)
+ .flat()
+ .filter(Boolean);
+
+ const getCustomFieldsPerOwner = (owner: Owner) =>
+ res.saved_objects.find((secSO) => secSO.attributes.owner === owner)?.attributes.customFields;
+
+ const secCustomFields = getCustomFieldsPerOwner(SECURITY_SOLUTION_OWNER);
+
+ const obsCustomFields = getCustomFieldsPerOwner(OBSERVABILITY_OWNER);
+
+ const mainCustomFields = getCustomFieldsPerOwner(GENERAL_CASES_OWNER);
+
return {
all: {
closure: {
manually: findValueInBuckets(closureBuckets, 'close-by-user'),
automatic: findValueInBuckets(closureBuckets, 'close-by-pushing'),
},
+ customFields: getCustomFieldsTelemetry(
+ allCustomFields as ConfigurationPersistedAttributes['customFields']
+ ),
+ },
+ sec: {
+ customFields: getCustomFieldsTelemetry(secCustomFields),
+ },
+ obs: {
+ customFields: getCustomFieldsTelemetry(obsCustomFields),
+ },
+ main: {
+ customFields: getCustomFieldsTelemetry(mainCustomFields),
},
};
};
diff --git a/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts b/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts
index 50b5b142fd319..bf975b84f46c5 100644
--- a/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts
+++ b/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts
@@ -6,6 +6,7 @@
*/
import { savedObjectsRepositoryMock } from '@kbn/core/server/mocks';
+import { CustomFieldTypes } from '../../../common/types/domain';
import type {
AttachmentAggregationResult,
AttachmentFrameworkAggsResult,
@@ -21,6 +22,7 @@ import {
getCountsAggregationQuery,
getCountsAndMaxData,
getCountsFromBuckets,
+ getCustomFieldsTelemetry,
getMaxBucketOnCaseAggregationQuery,
getOnlyAlertsCommentsFilter,
getOnlyConnectorsFilter,
@@ -1200,4 +1202,61 @@ describe('utils', () => {
});
});
});
+
+ describe('getCustomFieldsTelemetry', () => {
+ const customFieldsMock = [
+ {
+ key: 'foobar1',
+ label: 'foobar1',
+ type: CustomFieldTypes.TEXT,
+ required: false,
+ },
+ {
+ key: 'foobar2',
+ label: 'foobar2',
+ type: CustomFieldTypes.TOGGLE,
+ required: true,
+ },
+ {
+ key: 'foobar3',
+ label: 'foobar3',
+ type: 'foo',
+ required: true,
+ },
+ {
+ key: 'foobar4',
+ label: 'foobar4',
+ type: CustomFieldTypes.TOGGLE,
+ required: true,
+ },
+ ];
+
+ it('returns customFields telemetry correctly', () => {
+ expect(getCustomFieldsTelemetry(customFieldsMock)).toEqual({
+ totalsByType: {
+ text: 1,
+ toggle: 2,
+ foo: 1,
+ },
+ totals: 4,
+ required: 3,
+ });
+ });
+
+ it('returns correctly when customFields undefined', () => {
+ expect(getCustomFieldsTelemetry(undefined)).toEqual({
+ totalsByType: {},
+ totals: 0,
+ required: 0,
+ });
+ });
+
+ it('returns correctly when customFields empty', () => {
+ expect(getCustomFieldsTelemetry([])).toEqual({
+ totalsByType: {},
+ totals: 0,
+ required: 0,
+ });
+ });
+ });
});
diff --git a/x-pack/plugins/cases/server/telemetry/queries/utils.ts b/x-pack/plugins/cases/server/telemetry/queries/utils.ts
index 9c8d528f58e2b..ff785077d74ac 100644
--- a/x-pack/plugins/cases/server/telemetry/queries/utils.ts
+++ b/x-pack/plugins/cases/server/telemetry/queries/utils.ts
@@ -27,9 +27,11 @@ import type {
FileAttachmentAggregationResults,
FileAttachmentAggsResult,
AttachmentFrameworkAggsResult,
+ CustomFieldsTelemetry,
} from '../types';
import { buildFilter } from '../../client/utils';
import type { Owner } from '../../../common/constants/types';
+import type { ConfigurationPersistedAttributes } from '../../common/types/configure';
export const getCountsAggregationQuery = (savedObjectType: string) => ({
counts: {
@@ -199,6 +201,28 @@ export const getSolutionValues = ({
};
};
+export const getCustomFieldsTelemetry = (
+ customFields?: ConfigurationPersistedAttributes['customFields']
+): CustomFieldsTelemetry => {
+ const customFiledTypes: Record = {};
+
+ const totalsByType = customFields?.reduce((a, c) => {
+ if (c?.type) {
+ Object.assign(customFiledTypes, { [c.type]: (customFiledTypes[c.type] ?? 0) + 1 });
+ }
+
+ return customFiledTypes;
+ }, {});
+
+ const allRequiredCustomFields = customFields?.filter((field) => field?.required).length;
+
+ return {
+ totalsByType: totalsByType ?? {},
+ totals: customFields?.length ?? 0,
+ required: allRequiredCustomFields ?? 0,
+ };
+};
+
export const findValueInBuckets = (buckets: Buckets['buckets'], value: string | number): number =>
buckets.find(({ key }) => key === value)?.doc_count ?? 0;
diff --git a/x-pack/plugins/cases/server/telemetry/schema.ts b/x-pack/plugins/cases/server/telemetry/schema.ts
index 33d44101c5a6d..e5222d2f1a909 100644
--- a/x-pack/plugins/cases/server/telemetry/schema.ts
+++ b/x-pack/plugins/cases/server/telemetry/schema.ts
@@ -16,6 +16,7 @@ import type {
AssigneesSchema,
AttachmentFrameworkSchema,
AttachmentItemsSchema,
+ CustomFieldsSolutionTelemetrySchema,
} from './types';
const long: TypeLong = { type: 'long' };
@@ -73,6 +74,16 @@ const solutionTelemetry: SolutionTelemetrySchema = {
attachmentFramework: attachmentFrameworkSchema,
};
+const customFieldsSolutionTelemetrySchema: CustomFieldsSolutionTelemetrySchema = {
+ customFields: {
+ totalsByType: {
+ DYNAMIC_KEY: long,
+ },
+ totals: long,
+ required: long,
+ },
+};
+
const statusSchema: StatusSchema = {
open: long,
inProgress: long,
@@ -128,6 +139,10 @@ export const casesSchema: CasesTelemetrySchema = {
manually: long,
automatic: long,
},
+ ...customFieldsSolutionTelemetrySchema,
},
+ sec: customFieldsSolutionTelemetrySchema,
+ obs: customFieldsSolutionTelemetrySchema,
+ main: customFieldsSolutionTelemetrySchema,
},
};
diff --git a/x-pack/plugins/cases/server/telemetry/types.ts b/x-pack/plugins/cases/server/telemetry/types.ts
index a68ed0a36b7d5..4cfcb2d275a04 100644
--- a/x-pack/plugins/cases/server/telemetry/types.ts
+++ b/x-pack/plugins/cases/server/telemetry/types.ts
@@ -155,6 +155,16 @@ export interface LatestDates {
closedAt: string;
}
+export interface CustomFieldsTelemetry {
+ totalsByType: Record;
+ totals: number;
+ required: number;
+}
+
+export interface CustomFieldsSolutionTelemetry {
+ customFields: CustomFieldsTelemetry;
+}
+
export interface CasesTelemetry {
cases: {
all: Count &
@@ -197,7 +207,11 @@ export interface CasesTelemetry {
manually: number;
automatic: number;
};
+ customFields: CustomFieldsTelemetry;
};
+ sec: CustomFieldsSolutionTelemetry;
+ obs: CustomFieldsSolutionTelemetry;
+ main: CustomFieldsSolutionTelemetry;
};
}
@@ -209,3 +223,4 @@ export type AssigneesSchema = MakeSchemaFrom;
export type AttachmentFrameworkSchema = MakeSchemaFrom;
export type AttachmentItemsSchema = MakeSchemaFrom;
export type SolutionTelemetrySchema = MakeSchemaFrom;
+export type CustomFieldsSolutionTelemetrySchema = MakeSchemaFrom;
diff --git a/x-pack/plugins/cloud_defend/public/components/control_yaml_view/hooks/use_config_model.ts b/x-pack/plugins/cloud_defend/public/components/control_yaml_view/hooks/use_config_model.ts
index 42154a6fe13e7..ad3d6eb46a32f 100644
--- a/x-pack/plugins/cloud_defend/public/components/control_yaml_view/hooks/use_config_model.ts
+++ b/x-pack/plugins/cloud_defend/public/components/control_yaml_view/hooks/use_config_model.ts
@@ -4,13 +4,12 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { useMemo } from 'react';
-import { setDiagnosticsOptions } from 'monaco-yaml';
-import { monaco } from '@kbn/monaco';
+import { useMemo, useState, useEffect } from 'react';
+import { monaco, configureMonacoYamlSchema, YAML_LANG_ID } from '@kbn/monaco';
import { getSelectorsAndResponsesFromYaml } from '../../../../common/utils/helpers';
/**
- * In order to keep this json in sync with https://github.com/elastic/cloud-defend/blob/main/modules/service/policy-schema.json
+ * In order to keep this json in sync with https://github.com/elastic/cloud-defend/blob/main/modules/config/policy-schema.json
* Do NOT commit edits to policy_schema.json as part of a PR. Please make the changes in the cloud-defend repo.
* Buildkite will take care of creating a PR in kibana.
*/
@@ -22,13 +21,15 @@ const SCHEMA_URI = 'http://elastic.co/cloud_defend.json';
const modelUri = Uri.parse(SCHEMA_URI);
export const useConfigModel = (configuration: string) => {
- return useMemo(() => {
+ const [configModel, setConfigModel] = useState(null);
+
+ const schema = useMemo(() => {
+ const _schema: any = { ...policySchemaJson };
const { selectors } = getSelectorsAndResponsesFromYaml(configuration);
- const schema: any = { ...policySchemaJson };
// dynamically setting enum values for response match and exclude properties.
- if (schema.$defs.fileResponse.properties.match.items) {
- const responseProps = schema.$defs.fileResponse.properties;
+ if (_schema.$defs.fileResponse.properties.match.items) {
+ const responseProps = _schema.$defs.fileResponse.properties;
const selectorEnum = {
enum: selectors
.filter((selector) => selector.type === 'file')
@@ -38,8 +39,8 @@ export const useConfigModel = (configuration: string) => {
responseProps.exclude.items = selectorEnum;
}
- if (schema.$defs.processResponse.properties.match.items) {
- const responseProps = schema.$defs.processResponse.properties;
+ if (_schema.$defs.processResponse.properties.match.items) {
+ const responseProps = _schema.$defs.processResponse.properties;
const selectorEnum = {
enum: selectors
.filter((selector) => selector.type === 'process')
@@ -49,25 +50,32 @@ export const useConfigModel = (configuration: string) => {
responseProps.exclude.items = selectorEnum;
}
- setDiagnosticsOptions({
- validate: true,
- completion: true,
- hover: true,
- schemas: [
- {
- uri: SCHEMA_URI,
- fileMatch: [String(modelUri)],
- schema,
- },
- ],
- });
+ return _schema;
+ }, [configuration]);
+
+ useEffect(() => {
+ async function configureMonacoYaml(...args: Parameters) {
+ const { dispose } = await configureMonacoYamlSchema(...args);
+
+ let model = editor.getModel(modelUri);
- let model = editor.getModel(modelUri);
+ if (model === null) {
+ model = editor.createModel('', YAML_LANG_ID, modelUri);
+ }
- if (model === null) {
- model = editor.createModel('', 'yaml', modelUri);
+ setConfigModel(model);
+
+ return () => dispose();
}
- return model;
- }, [configuration]);
+ configureMonacoYaml([
+ {
+ uri: SCHEMA_URI,
+ fileMatch: [String(modelUri)],
+ schema,
+ },
+ ]);
+ }, [schema]);
+
+ return configModel;
};
diff --git a/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts b/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts
index 0dc376b19f179..cbeb334e2aa61 100644
--- a/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts
+++ b/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts
@@ -190,18 +190,37 @@ export const getBenchmarkCisName = (benchmarkId: BenchmarksCisId) => {
}
};
+const CLOUD_PROVIDER_NAMES = {
+ AWS: 'Amazon Web Services',
+ AZURE: 'Microsoft Azure',
+ GCP: 'Google Cloud Platform',
+};
+
export const getBenchmarkApplicableTo = (benchmarkId: BenchmarksCisId) => {
switch (benchmarkId) {
case 'cis_k8s':
return 'Kubernetes';
case 'cis_azure':
- return 'Microsoft Azure';
+ return CLOUD_PROVIDER_NAMES.AZURE;
case 'cis_aws':
- return 'Amazon Web Services';
+ return CLOUD_PROVIDER_NAMES.AWS;
case 'cis_eks':
return 'Amazon Elastic Kubernetes Service';
case 'cis_gcp':
- return 'Google Cloud Provider';
+ return CLOUD_PROVIDER_NAMES.GCP;
+ }
+};
+
+export const getCloudProviderNameFromAbbreviation = (cloudProvider: string) => {
+ switch (cloudProvider) {
+ case 'azure':
+ return CLOUD_PROVIDER_NAMES.AZURE;
+ case 'aws':
+ return CLOUD_PROVIDER_NAMES.AWS;
+ case 'gcp':
+ return CLOUD_PROVIDER_NAMES.GCP;
+ default:
+ return cloudProvider;
}
};
diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_provider_icon.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_provider_icon.tsx
new file mode 100644
index 0000000000000..b6acdac0ee1b1
--- /dev/null
+++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_provider_icon.tsx
@@ -0,0 +1,47 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+import { EuiIcon, EuiToolTip, IconSize } from '@elastic/eui';
+import { CSSInterpolation } from '@emotion/serialize';
+import { getCloudProviderNameFromAbbreviation } from '../../common/utils/helpers';
+import googleCloudLogo from '../assets/icons/google_cloud_logo.svg';
+
+interface Props {
+ cloudProvider: string;
+ style?: CSSInterpolation;
+ size?: IconSize;
+}
+
+const getCloudProviderIcon = (cloudProvider: string) => {
+ switch (cloudProvider) {
+ case 'azure':
+ return 'logoAzure';
+ case 'aws':
+ return 'logoAWS';
+ case 'gcp':
+ return googleCloudLogo;
+ default:
+ return undefined;
+ }
+};
+
+export const CloudProviderIcon = ({ cloudProvider, size, style }: Props) => {
+ const iconType = getCloudProviderIcon(cloudProvider);
+
+ if (!iconType) {
+ return null;
+ }
+
+ const name = getCloudProviderNameFromAbbreviation(cloudProvider);
+
+ return (
+
+
+
+ );
+};
diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx
index 4ec3d3578a541..9e6e88ee0cbbb 100644
--- a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx
+++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx
@@ -22,13 +22,15 @@ interface CloudSecurityGroupingProps {
onChangeGroupsPage: (index: number) => void;
selectedGroup: string;
isGroupLoading?: boolean;
+ groupingLevel?: number;
+ groupSelectorComponent?: JSX.Element;
}
/**
* This component is used to render the loading state of the CloudSecurityGrouping component
* It's used to avoid the flickering of the table when the data is loading
*/
-const CloudSecurityGroupingLoading = ({
+export const CloudSecurityGroupingLoading = ({
grouping,
pageSize,
}: Pick) => {
@@ -63,15 +65,18 @@ export const CloudSecurityGrouping = ({
onChangeGroupsItemsPerPage,
onChangeGroupsPage,
selectedGroup,
- isGroupLoading,
+ groupingLevel = 0,
+ groupSelectorComponent,
}: CloudSecurityGroupingProps) => {
- if (isGroupLoading) {
+ if (!data || isFetching) {
return ;
}
+
return (
.euiFlexItem:last-child {
display: none;
}
@@ -81,20 +86,43 @@ export const CloudSecurityGrouping = ({
}
`}
>
- {grouping.getGrouping({
- activePage: activePageIndex,
- data,
- groupingLevel: 0,
- inspectButton: undefined,
- isLoading: isFetching,
- itemsPerPage: pageSize,
- onChangeGroupsItemsPerPage,
- onChangeGroupsPage,
- renderChildComponent,
- onGroupClose: () => {},
- selectedGroup,
- takeActionItems: () => [],
- })}
+ {groupSelectorComponent && (
+
+ {groupSelectorComponent}
+
+ )}
+
+ {grouping.getGrouping({
+ activePage: activePageIndex,
+ data,
+ groupingLevel,
+ selectedGroup,
+ inspectButton: undefined,
+ isLoading: isFetching,
+ itemsPerPage: pageSize,
+ onChangeGroupsItemsPerPage,
+ onChangeGroupsPage,
+ renderChildComponent,
+ onGroupClose: () => {},
+ takeActionItems: () => [],
+ })}
+
);
};
diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts
index 23fd8267e5d76..05dc555bc3f7d 100644
--- a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts
+++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts
@@ -13,13 +13,14 @@ import {
GroupPanelRenderer,
GroupStatsRenderer,
} from '@kbn/securitysolution-grouping/src';
+
import { useUrlQuery } from '../../common/hooks/use_url_query';
import { FindingsBaseURLQuery } from '../../common/types';
import { useBaseEsQuery, usePersistedQuery } from '../../common/hooks/use_cloud_posture_data_table';
const DEFAULT_PAGE_SIZE = 10;
-const MAX_GROUPING_LEVELS = 1;
+const DEFAULT_MAX_GROUPING_LEVELS = 3;
/*
Utility hook to handle the grouping logic of the cloud security components
@@ -32,7 +33,9 @@ export const useCloudSecurityGrouping = ({
unit,
groupPanelRenderer,
groupStatsRenderer,
+ groupingLevel,
groupingLocalStorageKey,
+ maxGroupingLevels = DEFAULT_MAX_GROUPING_LEVELS,
}: {
dataView: DataView;
groupingTitle: string;
@@ -41,7 +44,9 @@ export const useCloudSecurityGrouping = ({
unit: (count: number) => string;
groupPanelRenderer?: GroupPanelRenderer;
groupStatsRenderer?: GroupStatsRenderer;
+ groupingLevel?: number;
groupingLocalStorageKey: string;
+ maxGroupingLevels?: number;
}) => {
const getPersistedDefaultQuery = usePersistedQuery(getDefaultQuery);
const { urlQuery, setUrlQuery } = useUrlQuery(getPersistedDefaultQuery);
@@ -53,14 +58,6 @@ export const useCloudSecurityGrouping = ({
query: urlQuery.query,
});
- /**
- * Reset the active page when the filters or query change
- * This is needed because the active page is not automatically reset when the filters or query change
- */
- useEffect(() => {
- setActivePageIndex(0);
- }, [urlQuery.filters, urlQuery.query]);
-
const grouping = useGrouping({
componentProps: {
unit,
@@ -70,14 +67,23 @@ export const useCloudSecurityGrouping = ({
defaultGroupingOptions,
fields: dataView.fields,
groupingId: groupingLocalStorageKey,
- maxGroupingLevels: MAX_GROUPING_LEVELS,
+ maxGroupingLevels,
title: groupingTitle,
onGroupChange: () => {
setActivePageIndex(0);
},
});
- const selectedGroup = grouping.selectedGroups[0];
+ const selectedGroup = groupingLevel
+ ? grouping.selectedGroups[groupingLevel]
+ : grouping.selectedGroups[0];
+ /**
+ * Reset the active page when the filters or query change
+ * This is needed because the active page is not automatically reset when the filters or query change
+ */
+ useEffect(() => {
+ setActivePageIndex(0);
+ }, [urlQuery.filters, urlQuery.query]);
// This is recommended by the grouping component to cover an edge case
// where the selectedGroup has multiple values
@@ -104,6 +110,7 @@ export const useCloudSecurityGrouping = ({
return {
activePageIndex,
+ setActivePageIndex,
grouping,
pageSize,
query,
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_by_resource/severity_map.tsx b/x-pack/plugins/cloud_security_posture/public/components/vulnerability_severity_map.tsx
similarity index 89%
rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_by_resource/severity_map.tsx
rename to x-pack/plugins/cloud_security_posture/public/components/vulnerability_severity_map.tsx
index 78e5513271441..b22846b624b9c 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_by_resource/severity_map.tsx
+++ b/x-pack/plugins/cloud_security_posture/public/components/vulnerability_severity_map.tsx
@@ -16,9 +16,9 @@ import {
} from '@elastic/eui';
import { PaletteColorStop } from '@elastic/eui/src/components/color_picker/color_palette_picker';
import { i18n } from '@kbn/i18n';
-import { getSeverityStatusColor } from '../../../common/utils/get_vulnerability_colors';
-import { VulnSeverity } from '../../../../common/types_old';
-import { SeverityStatusBadge } from '../../../components/vulnerability_badges';
+import { getSeverityStatusColor } from '../common/utils/get_vulnerability_colors';
+import { VulnSeverity } from '../../common/types_old';
+import { SeverityStatusBadge } from './vulnerability_badges';
interface Props {
total: number;
@@ -50,7 +50,7 @@ const formatPercentage = (percentage: number) => {
return `${percentage.toFixed(1)}%`;
};
-export const SeverityMap = ({ severityMap, total }: Props) => {
+export const VulnerabilitySeverityMap = ({ severityMap, total }: Props) => {
const { euiTheme } = useEuiTheme();
const severityMapPallet: PaletteColorStop[] = [];
@@ -87,10 +87,7 @@ export const SeverityMap = ({ severityMap, total }: Props) => {
width: 256px;
`}
anchorClassName={css`
- height: ${euiTheme.size.xl};
- flex-grow: 1;
- display: flex;
- align-items: center;
+ margin-left: ${euiTheme.size.xs};
`}
position="left"
title={i18n.translate('xpack.csp.vulnerabilitiesByResource.severityMap.tooltipTitle', {
@@ -102,7 +99,8 @@ export const SeverityMap = ({ severityMap, total }: Props) => {
type="fixed"
palette={severityMapPallet}
className={css`
- width: 100%;
+ width: 80px;
+ height: 6px;
`}
/>
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx
index 11c60718b29f8..673dc5df24315 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx
+++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx
@@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import React from 'react';
+import React, { useEffect } from 'react';
import { Filter } from '@kbn/es-query';
import { EuiSpacer } from '@elastic/eui';
import { DEFAULT_GROUPING_TABLE_HEIGHT } from '../../../common/constants';
@@ -14,39 +14,134 @@ import { FindingsSearchBar } from '../layout/findings_search_bar';
import { useLatestFindingsGrouping } from './use_latest_findings_grouping';
import { LatestFindingsTable } from './latest_findings_table';
import { groupPanelRenderer, groupStatsRenderer } from './latest_findings_group_renderer';
-import { FindingsDistributionBar } from '../layout/findings_distribution_bar';
import { ErrorCallout } from '../layout/error_callout';
-export const LatestFindingsContainer = () => {
- const renderChildComponent = (groupFilters: Filter[]) => {
- return (
-
- );
- };
-
+const SubGrouping = ({
+ renderChildComponent,
+ groupingLevel,
+ parentGroupFilters,
+ selectedGroup,
+ groupSelectorComponent,
+}: {
+ renderChildComponent: (groupFilters: Filter[]) => JSX.Element;
+ groupingLevel: number;
+ parentGroupFilters?: string;
+ selectedGroup: string;
+ groupSelectorComponent?: JSX.Element;
+}) => {
const {
- isGroupSelected,
groupData,
grouping,
isFetching,
activePageIndex,
pageSize,
- selectedGroup,
onChangeGroupsItemsPerPage,
onChangeGroupsPage,
- setUrlQuery,
isGroupLoading,
- onResetFilters,
- error,
- totalPassedFindings,
- onDistributionBarClick,
- totalFailedFindings,
- isEmptyResults,
- } = useLatestFindingsGrouping({ groupPanelRenderer, groupStatsRenderer });
+ setActivePageIndex,
+ } = useLatestFindingsGrouping({
+ groupPanelRenderer,
+ groupStatsRenderer,
+ groupingLevel,
+ selectedGroup,
+ groupFilters: parentGroupFilters ? JSON.parse(parentGroupFilters) : [],
+ });
+
+ /**
+ * This is used to reset the active page index when the selected group changes
+ * It is needed because the grouping number of pages can change according to the selected group
+ */
+ useEffect(() => {
+ setActivePageIndex(0);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [selectedGroup]);
+
+ return (
+
+ );
+};
+
+export const LatestFindingsContainer = () => {
+ const { grouping, isFetching, setUrlQuery, onResetFilters, error, isEmptyResults } =
+ useLatestFindingsGrouping({ groupPanelRenderer, groupStatsRenderer });
+
+ const renderChildComponent = ({
+ level,
+ currentSelectedGroup,
+ selectedGroupOptions,
+ parentGroupFilters,
+ groupSelectorComponent,
+ }: {
+ level: number;
+ currentSelectedGroup: string;
+ selectedGroupOptions: string[];
+ parentGroupFilters?: string;
+ groupSelectorComponent?: JSX.Element;
+ }) => {
+ let getChildComponent;
+
+ if (currentSelectedGroup === 'none') {
+ return (
+
+ );
+ }
+
+ if (level < selectedGroupOptions.length - 1 && !selectedGroupOptions.includes('none')) {
+ getChildComponent = (currentGroupFilters: Filter[]) => {
+ const nextGroupingLevel = level + 1;
+ return renderChildComponent({
+ level: nextGroupingLevel,
+ currentSelectedGroup: selectedGroupOptions[nextGroupingLevel],
+ selectedGroupOptions,
+ parentGroupFilters: JSON.stringify([
+ ...currentGroupFilters,
+ ...(parentGroupFilters ? JSON.parse(parentGroupFilters) : []),
+ ]),
+ groupSelectorComponent,
+ });
+ };
+ } else {
+ getChildComponent = (currentGroupFilters: Filter[]) => {
+ return (
+
+ );
+ };
+ }
+ return (
+
+ );
+ };
if (error || isEmptyResults) {
return (
@@ -58,38 +153,18 @@ export const LatestFindingsContainer = () => {
>
);
}
- if (isGroupSelected) {
- return (
- <>
-
-
-
-
-
-
- >
- );
- }
return (
<>
-
+
+ {renderChildComponent({
+ level: 0,
+ currentSelectedGroup: grouping.selectedGroups[0],
+ selectedGroupOptions: grouping.selectedGroups,
+ groupSelectorComponent: grouping.groupSelector,
+ })}
+
>
);
};
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_table.tsx b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_table.tsx
index 7f215c4d49f99..4f584028cc55d 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_table.tsx
+++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_table.tsx
@@ -5,11 +5,11 @@
* 2.0.
*/
+import React from 'react';
import { Filter } from '@kbn/es-query';
import { DataTableRecord } from '@kbn/discover-utils/types';
import { i18n } from '@kbn/i18n';
import { EuiDataGridCellValueElementProps, EuiFlexItem, EuiSpacer } from '@elastic/eui';
-import React from 'react';
import * as TEST_SUBJECTS from '../test_subjects';
import { FindingsDistributionBar } from '../layout/findings_distribution_bar';
import { ErrorCallout } from '../layout/error_callout';
@@ -27,7 +27,6 @@ interface LatestFindingsTableProps {
showDistributionBar?: boolean;
nonPersistedFilters?: Filter[];
}
-
/**
* Type Guard for checking if the given source is a CspFinding
*/
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx
index d2386bbdd3493..74efd68b5378b 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx
+++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx
@@ -14,6 +14,7 @@ import {
parseGroupingQuery,
} from '@kbn/securitysolution-grouping/src';
import { useMemo } from 'react';
+import { buildEsQuery, Filter } from '@kbn/es-query';
import { LOCAL_STORAGE_FINDINGS_GROUPING_KEY } from '../../../common/constants';
import { useDataViewContext } from '../../../common/contexts/data_view_context';
import { Evaluation } from '../../../../common/types_old';
@@ -127,9 +128,15 @@ export const isFindingsRootGroupingAggregation = (
export const useLatestFindingsGrouping = ({
groupPanelRenderer,
groupStatsRenderer,
+ groupingLevel = 0,
+ groupFilters = [],
+ selectedGroup,
}: {
groupPanelRenderer?: GroupPanelRenderer;
groupStatsRenderer?: GroupStatsRenderer;
+ groupingLevel?: number;
+ groupFilters?: Filter[];
+ selectedGroup?: string;
}) => {
const { dataView } = useDataViewContext();
@@ -138,7 +145,6 @@ export const useLatestFindingsGrouping = ({
grouping,
pageSize,
query,
- selectedGroup,
onChangeGroupsItemsPerPage,
onChangeGroupsPage,
setUrlQuery,
@@ -147,6 +153,7 @@ export const useLatestFindingsGrouping = ({
onResetFilters,
error,
filters,
+ setActivePageIndex,
} = useCloudSecurityGrouping({
dataView,
groupingTitle,
@@ -156,21 +163,25 @@ export const useLatestFindingsGrouping = ({
groupPanelRenderer,
groupStatsRenderer,
groupingLocalStorageKey: LOCAL_STORAGE_FINDINGS_GROUPING_KEY,
+ groupingLevel,
});
+ const additionalFilters = buildEsQuery(dataView, [], groupFilters);
+ const currentSelectedGroup = selectedGroup || grouping.selectedGroups[0];
+
const { data: rulesStates } = useGetCspBenchmarkRulesStatesApi();
const mutedRulesFilterQuery = rulesStates ? buildMutedRulesFilter(rulesStates) : [];
const groupingQuery = getGroupingQuery({
- additionalFilters: query ? [query] : [],
- groupByField: selectedGroup,
+ additionalFilters: query ? [query, additionalFilters] : [additionalFilters],
+ groupByField: currentSelectedGroup,
uniqueValue,
from: `now-${LATEST_FINDINGS_RETENTION_POLICY}`,
to: 'now',
pageNumber: activePageIndex * pageSize,
size: pageSize,
sort: [{ groupByField: { order: 'desc' } }, { complianceScore: { order: 'asc' } }],
- statsAggregations: getAggregationsByGroupField(selectedGroup),
+ statsAggregations: getAggregationsByGroupField(currentSelectedGroup),
rootAggregations: [
{
failedFindings: {
@@ -207,11 +218,11 @@ export const useLatestFindingsGrouping = ({
const groupData = useMemo(
() =>
parseGroupingQuery(
- selectedGroup,
+ currentSelectedGroup,
uniqueValue,
data as GroupingAggregation
),
- [data, selectedGroup, uniqueValue]
+ [data, currentSelectedGroup, uniqueValue]
);
const totalPassedFindings = isFindingsRootGroupingAggregation(groupData)
@@ -241,6 +252,7 @@ export const useLatestFindingsGrouping = ({
grouping,
isFetching,
activePageIndex,
+ setActivePageIndex,
pageSize,
selectedGroup,
onChangeGroupsItemsPerPage,
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/constants.ts b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/constants.ts
index 52361bb9b2c6b..9ad49296dd0dc 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/constants.ts
+++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/constants.ts
@@ -19,10 +19,15 @@ export const VULNERABILITY_FIELDS = {
PACKAGE_NAME: 'package.name',
PACKAGE_VERSION: 'package.version',
PACKAGE_FIXED_VERSION: 'package.fixed_version',
+ CLOUD_ACCOUNT_NAME: 'cloud.account.name',
+ CLOUD_PROVIDER: 'cloud.provider',
+ DESCRIPTION: 'vulnerability.description',
} as const;
export const GROUPING_OPTIONS = {
RESOURCE_NAME: VULNERABILITY_FIELDS.RESOURCE_NAME,
+ CLOUD_ACCOUNT_NAME: VULNERABILITY_FIELDS.CLOUD_ACCOUNT_NAME,
+ CVE: VULNERABILITY_FIELDS.VULNERABILITY_ID,
};
export const defaultGroupingOptions: GroupOption[] = [
@@ -30,6 +35,14 @@ export const defaultGroupingOptions: GroupOption[] = [
label: GROUPING_LABELS.RESOURCE_NAME,
key: GROUPING_OPTIONS.RESOURCE_NAME,
},
+ {
+ label: GROUPING_LABELS.CLOUD_ACCOUNT_NAME,
+ key: GROUPING_OPTIONS.CLOUD_ACCOUNT_NAME,
+ },
+ {
+ label: 'CVE',
+ key: GROUPING_OPTIONS.CVE,
+ },
];
export const getDefaultQuery = ({
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx
index fda12c4b06d41..371ab2fa038c0 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx
+++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx
@@ -34,6 +34,21 @@ export interface VulnerabilitiesGroupingAggregation {
buckets?: GenericBuckets[];
};
isLoading?: boolean;
+ critical?: {
+ doc_count?: NumberOrNull;
+ };
+ high?: {
+ doc_count?: NumberOrNull;
+ };
+ medium?: {
+ doc_count?: NumberOrNull;
+ };
+ low?: {
+ doc_count?: NumberOrNull;
+ };
+ cloudProvider?: {
+ buckets?: GenericBuckets[];
+ };
}
export type VulnerabilitiesRootGroupingAggregation =
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_by_resource.ts b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_by_resource.ts
deleted file mode 100644
index 3aa152d427143..0000000000000
--- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_by_resource.ts
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-import { useQuery } from '@tanstack/react-query';
-import { lastValueFrom } from 'rxjs';
-import type { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common';
-import {
- SearchRequest,
- SearchResponse,
- AggregationsCardinalityAggregate,
- AggregationsMultiBucketAggregateBase,
- AggregationsSingleBucketAggregateBase,
- AggregationsStringRareTermsBucketKeys,
- AggregationsStringTermsBucketKeys,
- SortOrder,
-} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
-import {
- LATEST_VULNERABILITIES_INDEX_PATTERN,
- VULNERABILITIES_SEVERITY,
-} from '../../../../common/constants';
-
-import { MAX_FINDINGS_TO_LOAD } from '../../../common/constants';
-import { useKibana } from '../../../common/hooks/use_kibana';
-import { showErrorToast } from '../../../common/utils/show_error_toast';
-import { FindingsBaseEsQuery } from '../../../common/types';
-
-type LatestFindingsRequest = IKibanaSearchRequest;
-type LatestFindingsResponse = IKibanaSearchResponse>;
-
-interface VulnerabilitiesAggs {
- count: AggregationsMultiBucketAggregateBase;
- total: AggregationsCardinalityAggregate;
- resources: AggregationsMultiBucketAggregateBase;
-}
-
-interface FindingsAggBucket extends AggregationsStringRareTermsBucketKeys {
- name: AggregationsMultiBucketAggregateBase;
- region: AggregationsMultiBucketAggregateBase;
- critical: AggregationsSingleBucketAggregateBase;
- high: AggregationsSingleBucketAggregateBase;
- medium: AggregationsSingleBucketAggregateBase;
- low: AggregationsSingleBucketAggregateBase;
-}
-
-interface VulnerabilitiesQuery extends FindingsBaseEsQuery {
- sortOrder: SortOrder;
- enabled: boolean;
- pageIndex: number;
- pageSize: number;
-}
-
-export const getQuery = ({
- query,
- sortOrder = 'desc',
- pageIndex,
- pageSize,
-}: VulnerabilitiesQuery) => ({
- index: LATEST_VULNERABILITIES_INDEX_PATTERN,
- query,
- aggs: {
- total: { cardinality: { field: 'resource.id' } },
- resources: {
- terms: {
- field: 'resource.id',
- size: MAX_FINDINGS_TO_LOAD * 3,
- // in case there are more resources then size, ensuring resources with more vulnerabilities
- // will be included first, and then vulnerabilities with critical and high severity
- order: [{ _count: sortOrder }, { critical: 'desc' }, { high: 'desc' }, { medium: 'desc' }],
- },
- aggs: {
- vulnerabilitiesCountBucketSort: {
- bucket_sort: {
- sort: [{ _count: { order: sortOrder } }],
- from: pageIndex * pageSize,
- size: pageSize,
- },
- },
- name: {
- terms: { field: 'resource.name', size: 1 },
- },
- region: {
- terms: { field: 'cloud.region', size: 1 },
- },
- critical: {
- filter: {
- term: {
- 'vulnerability.severity': { value: VULNERABILITIES_SEVERITY.CRITICAL },
- },
- },
- },
- high: {
- filter: {
- term: {
- 'vulnerability.severity': { value: VULNERABILITIES_SEVERITY.HIGH },
- },
- },
- },
- medium: {
- filter: {
- term: {
- 'vulnerability.severity': { value: VULNERABILITIES_SEVERITY.MEDIUM },
- },
- },
- },
- low: {
- filter: {
- term: { 'vulnerability.severity': { value: VULNERABILITIES_SEVERITY.LOW } },
- },
- },
- },
- },
- },
- size: 0,
-});
-const getFirstKey = (
- buckets: AggregationsMultiBucketAggregateBase['buckets']
-) => {
- return !!Array.isArray(buckets) && !!buckets.length ? (buckets[0].key as string) : '';
-};
-const createVulnerabilitiesByResource = (resource: FindingsAggBucket) => ({
- resource: {
- id: resource.key,
- name: getFirstKey(resource.name.buckets),
- },
- cloud: {
- region: getFirstKey(resource.region.buckets),
- },
- vulnerabilities_count: resource.doc_count,
- severity_map: {
- critical: resource.critical.doc_count,
- high: resource.high.doc_count,
- medium: resource.medium.doc_count,
- low: resource.low.doc_count,
- },
-});
-
-export const useLatestVulnerabilitiesByResource = (options: VulnerabilitiesQuery) => {
- const {
- data,
- notifications: { toasts },
- } = useKibana().services;
- return useQuery(
- [LATEST_VULNERABILITIES_INDEX_PATTERN, 'resource', options],
- async () => {
- const {
- rawResponse: { hits, aggregations },
- } = await lastValueFrom(
- data.search.search({
- params: getQuery(options),
- })
- );
-
- if (!aggregations) throw new Error('Failed to aggregate by resource');
-
- if (!Array.isArray(aggregations.resources.buckets))
- throw new Error('Failed to group by, missing resource id');
-
- return {
- page: aggregations.resources.buckets.map(createVulnerabilitiesByResource),
- total: aggregations.total.value,
- total_vulnerabilities: hits.total as number,
- };
- },
- {
- staleTime: 5000,
- keepPreviousData: true,
- enabled: options.enabled,
- onError: (err: Error) => showErrorToast(toasts, err),
- }
- );
-};
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx
index 45fdc5c71a342..f70da5fa27740 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx
+++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx
@@ -16,7 +16,10 @@ import {
import { useMemo } from 'react';
import { LOCAL_STORAGE_VULNERABILITIES_GROUPING_KEY } from '../../../common/constants';
import { useDataViewContext } from '../../../common/contexts/data_view_context';
-import { LATEST_VULNERABILITIES_RETENTION_POLICY } from '../../../../common/constants';
+import {
+ LATEST_VULNERABILITIES_RETENTION_POLICY,
+ VULNERABILITIES_SEVERITY,
+} from '../../../../common/constants';
import {
VulnerabilitiesGroupingAggregation,
VulnerabilitiesRootGroupingAggregation,
@@ -48,12 +51,45 @@ const getAggregationsByGroupField = (field: string): NamedAggregation[] => {
field,
},
},
+ critical: {
+ filter: {
+ term: {
+ 'vulnerability.severity': { value: VULNERABILITIES_SEVERITY.CRITICAL },
+ },
+ },
+ },
+ high: {
+ filter: {
+ term: {
+ 'vulnerability.severity': { value: VULNERABILITIES_SEVERITY.HIGH },
+ },
+ },
+ },
+ medium: {
+ filter: {
+ term: {
+ 'vulnerability.severity': { value: VULNERABILITIES_SEVERITY.MEDIUM },
+ },
+ },
+ },
+ low: {
+ filter: {
+ term: { 'vulnerability.severity': { value: VULNERABILITIES_SEVERITY.LOW } },
+ },
+ },
},
];
switch (field) {
case GROUPING_OPTIONS.RESOURCE_NAME:
return [...aggMetrics, getTermAggregation('resourceId', VULNERABILITY_FIELDS.RESOURCE_ID)];
+ case GROUPING_OPTIONS.CLOUD_ACCOUNT_NAME:
+ return [
+ ...aggMetrics,
+ getTermAggregation('cloudProvider', VULNERABILITY_FIELDS.CLOUD_PROVIDER),
+ ];
+ case GROUPING_OPTIONS.CVE:
+ return [...aggMetrics, getTermAggregation('description', VULNERABILITY_FIELDS.DESCRIPTION)];
}
return aggMetrics;
};
@@ -103,6 +139,7 @@ export const useLatestVulnerabilitiesGrouping = ({
groupPanelRenderer,
groupStatsRenderer,
groupingLocalStorageKey: LOCAL_STORAGE_VULNERABILITIES_GROUPING_KEY,
+ maxGroupingLevels: 1,
});
const groupingQuery = getGroupingQuery({
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx
index 82626fd684513..7de747b458b06 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx
+++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx
@@ -16,12 +16,20 @@ import {
import { css } from '@emotion/react';
import { GroupPanelRenderer, RawBucket, StatRenderer } from '@kbn/securitysolution-grouping/src';
import React from 'react';
+import { FormattedMessage } from '@kbn/i18n-react';
+import { getCloudProviderNameFromAbbreviation } from '../../../common/utils/helpers';
import { VulnerabilitiesGroupingAggregation } from './hooks/use_grouped_vulnerabilities';
import { GROUPING_OPTIONS } from './constants';
import { VULNERABILITIES_GROUPING_COUNTER } from './test_subjects';
import { NULL_GROUPING_MESSAGES, NULL_GROUPING_UNIT, VULNERABILITIES } from './translations';
import { getAbbreviatedNumber } from '../../common/utils/get_abbreviated_number';
-import { LoadingGroup, NullGroup } from '../../components/cloud_security_grouping';
+import {
+ firstNonNullValue,
+ LoadingGroup,
+ NullGroup,
+} from '../../components/cloud_security_grouping';
+import { VulnerabilitySeverityMap } from '../../components/vulnerability_severity_map';
+import { CloudProviderIcon } from '../../components/cloud_provider_icon';
export const groupPanelRenderer: GroupPanelRenderer = (
selectedGroup,
@@ -37,6 +45,12 @@ export const groupPanelRenderer: GroupPanelRenderer
);
+ const cloudProvider = firstNonNullValue(bucket.cloudProvider?.buckets?.[0]?.key);
+ const description = firstNonNullValue(bucket.description?.buckets?.[0]?.key);
+ const cloudProviderName = cloudProvider
+ ? getCloudProviderNameFromAbbreviation(cloudProvider)
+ : '';
+
switch (selectedGroup) {
case GROUPING_OPTIONS.RESOURCE_NAME:
return nullGroupMessage ? (
@@ -66,6 +80,32 @@ export const groupPanelRenderer: GroupPanelRenderer
);
+ case GROUPING_OPTIONS.CLOUD_ACCOUNT_NAME:
+ return nullGroupMessage ? (
+ renderNullGroup(NULL_GROUPING_MESSAGES.CLOUD_ACCOUNT_NAME)
+ ) : (
+
+ {cloudProvider && (
+
+
+
+ )}
+
+
+
+
+ {bucket.key_as_string}
+
+
+
+
+ {cloudProviderName}
+
+
+
+
+
+ );
default:
return nullGroupMessage ? (
renderNullGroup(NULL_GROUPING_MESSAGES.DEFAULT)
@@ -78,6 +118,20 @@ export const groupPanelRenderer: GroupPanelRenderer{bucket.key_as_string}
+ {description && (
+
+
+
+ {description}
+
+
+
+ )}
@@ -109,6 +163,35 @@ const VulnerabilitiesCountComponent = ({
const VulnerabilitiesCount = React.memo(VulnerabilitiesCountComponent);
+const SeverityStatsComponent = ({
+ bucket,
+}: {
+ bucket: RawBucket;
+}) => {
+ const severityMap = {
+ critical: bucket.critical?.doc_count ?? 0,
+ high: bucket.high?.doc_count ?? 0,
+ medium: bucket.medium?.doc_count ?? 0,
+ low: bucket.low?.doc_count ?? 0,
+ };
+
+ return (
+
+
+
+
+
+
+
+
+ );
+};
+
+const SeverityStats = React.memo(SeverityStatsComponent);
+
export const groupStatsRenderer = (
selectedGroup: string,
bucket: RawBucket
@@ -118,6 +201,10 @@ export const groupStatsRenderer = (
title: VULNERABILITIES,
renderer: ,
},
+ {
+ title: '',
+ renderer: ,
+ },
];
return defaultBadges;
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/translations.ts b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/translations.ts
index 65ca61056f612..f7d88f396f5c6 100644
--- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/translations.ts
+++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/translations.ts
@@ -40,17 +40,26 @@ export const NULL_GROUPING_MESSAGES = {
RESOURCE_NAME: i18n.translate('xpack.csp.vulnerabilities.grouping.resource.nullGroupTitle', {
defaultMessage: 'No resource',
}),
+ CLOUD_ACCOUNT_NAME: i18n.translate(
+ 'xpack.csp.vulnerabilities.grouping.cloudAccount.nullGroupTitle',
+ {
+ defaultMessage: 'No cloud account',
+ }
+ ),
DEFAULT: i18n.translate('xpack.csp.vulnerabilities.grouping.default.nullGroupTitle', {
defaultMessage: 'No grouping',
}),
};
export const GROUPING_LABELS = {
- RESOURCE_NAME: i18n.translate('xpack.csp.findings.latestFindings.groupByResource', {
+ RESOURCE_NAME: i18n.translate('xpack.csp.vulnerabilities.groupBy.resource', {
defaultMessage: 'Resource',
}),
+ CLOUD_ACCOUNT_NAME: i18n.translate('xpack.csp.vulnerabilities.groupBy.cloudAccount', {
+ defaultMessage: 'Cloud account',
+ }),
};
-export const groupingTitle = i18n.translate('xpack.csp.vulnerabilities.latestFindings.groupBy', {
+export const groupingTitle = i18n.translate('xpack.csp.vulnerabilities.groupBy', {
defaultMessage: 'Group vulnerabilities by',
});
diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/vulnerabilities_pathname_handler.ts b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/vulnerabilities_pathname_handler.ts
deleted file mode 100644
index 0d9e0b660f1f8..0000000000000
--- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/vulnerabilities_pathname_handler.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { EuiComboBoxOptionOption } from '@elastic/eui';
-import { findingsNavigation } from '../../../common/navigation/constants';
-import { FindingsGroupByKind } from '../../../common/types';
-
-export const vulnerabilitiesPathnameHandler = (
- opts: Array>
-) => {
- const [firstOption] = opts;
-
- switch (firstOption?.value) {
- case 'resource':
- return findingsNavigation.vulnerabilities_by_resource.path;
- case 'default':
- default:
- return findingsNavigation.vulnerabilities.path;
- }
-};
diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx
index 70dd55f40ad4b..f57f8ba4942f0 100644
--- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx
@@ -110,6 +110,7 @@ export const CrawlRequestsTable: React.FC = () => {
noItemsMessage={
{i18n.translate(
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_overview_panels.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_overview_panels.tsx
index 52b3c0881e15d..e6a9ed3962879 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_overview_panels.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/connector_overview_panels.tsx
@@ -31,7 +31,7 @@ import { SearchIndexTabId } from '../search_index';
const StatusPanel: React.FC<{ ingestionStatus: IngestionStatus }> = ({ ingestionStatus }) => (
{
{
return (
<>
{isModalVisible && }
-
+
-
-
+
+
{i18n.translate(
'xpack.enterpriseSearch.content.indices.configurationConnector.nativeConnector.convertConnector.title',
{
defaultMessage: 'Self-manage this connector',
}
)}
-
+
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/native_connector_configuration/native_connector_configuration.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/native_connector_configuration/native_connector_configuration.tsx
index 252a135f44a55..fce32710a580d 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/native_connector_configuration/native_connector_configuration.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/native_connector_configuration/native_connector_configuration.tsx
@@ -94,8 +94,8 @@ export const NativeConnectorConfiguration: React.FC = () => {
)}
-
- {nativeConnector?.name ?? index.connector.name}
+
+ {nativeConnector?.name ?? index.connector.name}
@@ -187,20 +187,20 @@ export const NativeConnectorConfiguration: React.FC = () => {
-
+
-
-
+
+
{i18n.translate(
'xpack.enterpriseSearch.content.indices.configurationConnector.nativeConnector.schedulingReminder.title',
{
defaultMessage: 'Configurable sync schedule',
}
)}
-
+
@@ -218,20 +218,20 @@ export const NativeConnectorConfiguration: React.FC = () => {
-
+
-
-
+
+
{i18n.translate(
'xpack.enterpriseSearch.content.indices.configurationConnector.nativeConnector.securityReminder.title',
{
defaultMessage: 'Document level security',
}
)}
-
+
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/sync_rules/connector_rules.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/sync_rules/connector_rules.tsx
index c28b65bffb70d..033ec1d92fd43 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/sync_rules/connector_rules.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/sync_rules/connector_rules.tsx
@@ -72,11 +72,11 @@ export const ConnectorSyncRules: React.FC = () => {
-
+
{i18n.translate('xpack.enterpriseSearch.index.connector.syncRules.title', {
defaultMessage: 'Sync rules ',
})}
-
+
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector_total_stats.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector_total_stats.tsx
index 4150d409ed49d..fc3fde9dea549 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector_total_stats.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector_total_stats.tsx
@@ -87,7 +87,7 @@ export const ConnectorTotalStats: React.FC = () => {
{stats.map((item, index) => (
-
+
))}
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler.tsx
index bb909c80687ec..df0475d5a730a 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/automatic_crawl_scheduler/automatic_crawl_scheduler.tsx
@@ -60,7 +60,7 @@ export const AutomaticCrawlScheduler: React.FC = () => {
return (
<>
-
+
{i18n.translate('xpack.enterpriseSearch.automaticCrawlSchedule.title', {
defaultMessage: 'Crawl frequency',
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawl_requests_panel/crawl_requests_table.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawl_requests_panel/crawl_requests_table.tsx
index 66c11b32d6d16..8be59e67d9a10 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawl_requests_panel/crawl_requests_table.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawl_requests_panel/crawl_requests_table.tsx
@@ -97,6 +97,7 @@ export const CrawlRequestsTable: React.FC = () => {
noItemsMessage={
{i18n.translate(
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawler_configuration/crawler_configuration.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawler_configuration/crawler_configuration.tsx
index 129d56dd1b72c..0f566f39b6547 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawler_configuration/crawler_configuration.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawler_configuration/crawler_configuration.tsx
@@ -39,12 +39,12 @@ export const CrawlerConfiguration: React.FC = () => {
-
+
{i18n.translate(
'xpack.enterpriseSearch.content.crawler.crawlerConfiguration.extractHTML.title',
{ defaultMessage: 'Store full HTML' }
)}
-
+
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler_total_stats.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler_total_stats.tsx
index 8bf7b407d591b..f5a72ac475fd9 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler_total_stats.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler_total_stats.tsx
@@ -77,7 +77,7 @@ export const CrawlerTotalStats: React.FC = () => {
{stats.map((item, index) => (
-
+
))}
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/name_and_description_stats.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/name_and_description_stats.tsx
index 53d15f1431195..c7bdd0d95d379 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/name_and_description_stats.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/name_and_description_stats.tsx
@@ -72,7 +72,7 @@ export const NameAndDescriptionStats: React.FC = () => {
{stats.map((item, index) => (
-
+
))}
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_errors.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_errors.tsx
index 554c7d1162d0d..5ed312c8cd386 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_errors.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_errors.tsx
@@ -63,12 +63,12 @@ export const InferenceErrors: React.FC = () => {
hasBorder
iconType="documents"
title={
-
+
{i18n.translate(
'xpack.enterpriseSearch.content.indices.pipelines.tabs.pipelineInferenceLogs.title',
{ defaultMessage: 'Inference errors' }
)}
-
+
}
>
{isLoading ? (
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history.tsx
index 9b33a1a0df0e6..67d70166acfe8 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history.tsx
@@ -51,12 +51,12 @@ export const InferenceHistory: React.FC = () => {
hasBorder
iconType="compute"
title={
-
+
{i18n.translate(
'xpack.enterpriseSearch.content.indices.pipelines.tabs.inferenceHistory.title',
{ defaultMessage: 'Historical inference processors' }
)}
-
+
}
subtitle={i18n.translate(
'xpack.enterpriseSearch.content.indices.pipelines.tabs.inferenceHistory.subtitle',
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.test.tsx
index 62ac53004a773..ff234eacb77e4 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.test.tsx
@@ -16,6 +16,7 @@ import { EuiButtonEmpty, EuiPanel, EuiText, EuiTitle } from '@elastic/eui';
import { InferencePipeline, TrainedModelState } from '../../../../../../common/types/pipelines';
import { InferencePipelineCard, TrainedModelHealthPopover } from './inference_pipeline_card';
+import { MODEL_REDACTED_VALUE } from './ml_inference/utils';
import { MLModelTypeBadge } from './ml_model_type_badge';
export const DEFAULT_VALUES: InferencePipeline = {
@@ -61,12 +62,30 @@ describe('InferencePipelineCard', () => {
const subtitle = wrapper.find(EuiText).at(0).children();
expect(subtitle.text()).toBe(DEFAULT_VALUES.modelId);
});
+ it("renders message about redaction instead of model ID if it's redacted", () => {
+ const values = {
+ ...DEFAULT_VALUES,
+ modelId: '',
+ };
+ const wrapper = shallow();
+ expect(wrapper.find(EuiText)).toHaveLength(1);
+ const subtitle = wrapper.find(EuiText).at(0).children();
+ expect(subtitle.text()).toBe(MODEL_REDACTED_VALUE);
+ });
it('renders model type as badge', () => {
const wrapper = shallow();
expect(wrapper.find(MLModelTypeBadge)).toHaveLength(1);
const badge = wrapper.find(MLModelTypeBadge).render();
expect(badge.text()).toBe('ner');
});
+ it('does not render model type if model ID is redacted', () => {
+ const values = {
+ ...DEFAULT_VALUES,
+ modelId: '',
+ };
+ const wrapper = shallow();
+ expect(wrapper.find(MLModelTypeBadge)).toHaveLength(0);
+ });
});
describe('TrainedModelHealthPopover', () => {
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx
index 342d05c398878..22047858c79da 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx
@@ -33,6 +33,7 @@ import { IndexNameLogic } from '../index_name_logic';
import { IndexViewLogic } from '../index_view_logic';
import { DeleteInferencePipelineButton } from './delete_inference_pipeline_button';
+import { MODEL_REDACTED_VALUE } from './ml_inference/utils';
import { TrainedModelHealth } from './ml_model_health';
import { MLModelTypeBadge } from './ml_model_type_badge';
import { PipelinesLogic } from './pipelines_logic';
@@ -188,6 +189,7 @@ export const TrainedModelHealthPopover: React.FC = (pipeline)
export const InferencePipelineCard: React.FC = (pipeline) => {
const { modelId, pipelineName, types: modelTypes } = pipeline;
+ const modelIdDisplay = modelId && modelId.length > 0 ? modelId : MODEL_REDACTED_VALUE;
const modelType = getMLType(modelTypes);
const modelTitle = getModelDisplayTitle(modelType);
const isSmallScreen = useIsWithinMaxBreakpoint('s');
@@ -207,14 +209,16 @@ export const InferencePipelineCard: React.FC = (pipeline) =>
- {modelId}
+ {modelIdDisplay}
-
-
-
-
-
+ {modelId && modelId.length > 0 && (
+
+
+
+
+
+ )}
)}
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines.tsx
index 800c1fc0abbf1..90d97ed512bd0 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines.tsx
@@ -135,14 +135,14 @@ export const SearchIndexPipelines: React.FC = () => {
}
title={
-
+
{i18n.translate(
'xpack.enterpriseSearch.content.indices.pipelines.ingestionPipeline.title',
{
defaultMessage: 'Ingest Pipelines',
}
)}
-
+
}
subtitle={
apiIndex
@@ -203,14 +203,14 @@ export const SearchIndexPipelines: React.FC = () => {
}
title={
-
+
{i18n.translate(
'xpack.enterpriseSearch.content.indices.pipelines.mlInferencePipelines.title',
{
defaultMessage: 'Machine Learning Inference Pipelines',
}
)}
-
+
}
subtitle={
apiIndex && hasIndexIngestionPipeline
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/rtl_helpers.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/rtl_helpers.tsx
index 618ae0203d6a1..a38cddbda450e 100644
--- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/rtl_helpers.tsx
+++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/rtl_helpers.tsx
@@ -30,6 +30,7 @@ import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks';
import { casesPluginMock } from '@kbn/cases-plugin/public/mocks';
import { DataViewSpec } from '@kbn/data-views-plugin/public';
import { settingsServiceMock } from '@kbn/core-ui-settings-browser-mocks';
+import * as useValuesListHook from '@kbn/observability-shared-plugin/public/hooks/use_values_list';
import { rumFieldFormats } from './configurations/rum/field_formats';
import { ExploratoryViewPublicPluginsStart } from '../../../plugin';
import * as useAppDataViewHook from './hooks/use_app_data_view';
@@ -42,12 +43,10 @@ import {
} from './hooks/use_series_storage';
import * as useSeriesFilterHook from './hooks/use_series_filters';
-import * as useValuesListHook from '../../../hooks/use_values_list';
import dataViewData from './configurations/test_data/test_data_view.json';
import { AppDataType, SeriesUrl, UrlFilter } from './types';
-import { ListItem } from '../../../hooks/use_values_list';
import { TRANSACTION_DURATION } from './configurations/constants/elasticsearch_fieldnames';
import { dataTypes, obsvReportConfigMap, reportTypesList } from './obsv_exploratory_view';
import { ExploratoryViewContextProvider } from './contexts/exploratory_view_config';
@@ -258,7 +257,12 @@ export const mockAppDataView = (props?: Partial) => {
return { spy, loadDataView };
};
-export const mockUseValuesList = (values?: ListItem[]) => {
+export const mockUseValuesList = (
+ values?: Array<{
+ label: string;
+ count: number;
+ }>
+) => {
const onRefreshTimeRange = jest.fn();
const spy = jest.spyOn(useValuesListHook, 'useValuesList').mockReturnValue({
values: values ?? [],
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx
index d821e65afae04..a4f796bc4b1c7 100644
--- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx
+++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx
@@ -16,6 +16,10 @@ describe('FilterExpanded', function () {
const mockSeries = { ...mockUxSeries, filters };
+ beforeEach(() => {
+ jest.clearAllMocks();
+ });
+
it('render', async () => {
const initSeries = { filters };
mockAppDataView();
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.test.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.test.tsx
index 66f52875cfc74..2532d48a3d036 100644
--- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.test.tsx
+++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.test.tsx
@@ -161,7 +161,7 @@ describe('FilterValueButton', function () {
);
await waitFor(() => {
- expect(spy).toHaveBeenCalledTimes(2);
+ expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toBeCalledWith(
expect.objectContaining({
filters: [
@@ -195,7 +195,7 @@ describe('FilterValueButton', function () {
);
await waitFor(() => {
- expect(spy).toHaveBeenCalledTimes(6);
+ expect(spy).toHaveBeenCalledTimes(5);
expect(spy).toBeCalledWith(
expect.objectContaining({
filters: [
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx
index a1dd68f65c3e7..8ab4f791f785e 100644
--- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx
+++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx
@@ -5,13 +5,12 @@
* 2.0.
*/
import { i18n } from '@kbn/i18n';
-
import React, { useMemo } from 'react';
import { EuiFilterButton, hexToRgb } from '@elastic/eui';
import { euiStyled } from '@kbn/kibana-react-plugin/common';
+import { FieldValueSuggestions } from '@kbn/observability-shared-plugin/public';
import { useAppDataViewContext } from '../../hooks/use_app_data_view';
import { useSeriesFilters } from '../../hooks/use_series_filters';
-import FieldValueSuggestions from '../../../field_value_suggestions';
import { SeriesUrl } from '../../types';
import { NestedFilterOpen } from './filter_expanded';
@@ -95,7 +94,10 @@ export function FilterValueButton({
return nestedField && forceOpenNested ? (
;
field: string;
query: string;
loading?: boolean;
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts
index 8a6653dd62c1b..e7d70b742a727 100644
--- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts
+++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts
@@ -8,7 +8,7 @@ import { ExistsFilter, isExistsFilter } from '@kbn/es-query';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { ESFilter } from '@kbn/es-types';
import { PersistableFilter } from '@kbn/lens-plugin/common';
-import { useValuesList } from '../../../../hooks/use_values_list';
+import { useValuesList } from '@kbn/observability-shared-plugin/public';
import { FilterProps } from './columns/filter_expanded';
import { useAppDataViewContext } from '../hooks/use_app_data_view';
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/index.tsx b/x-pack/plugins/exploratory_view/public/components/shared/index.tsx
index 90aad912eb01b..54ec0d731b3f6 100644
--- a/x-pack/plugins/exploratory_view/public/components/shared/index.tsx
+++ b/x-pack/plugins/exploratory_view/public/components/shared/index.tsx
@@ -7,38 +7,12 @@
import React, { lazy, Suspense } from 'react';
import { EuiLoadingSpinner } from '@elastic/eui';
-import type {
- FieldValueSuggestionsProps,
- FieldValueSelectionProps,
-} from './field_value_suggestions/types';
import type { DatePickerProps } from './date_picker';
import type { FilterValueLabelProps } from './filter_value_label/filter_value_label';
import type { SelectableUrlListProps } from './exploratory_view/components/url_search/selectable_url_list';
import type { ExploratoryViewPageProps } from './exploratory_view';
export type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
-const FieldValueSelectionLazy = lazy(
- () => import('./field_value_suggestions/field_value_selection')
-);
-
-export function FieldValueSelection(props: FieldValueSelectionProps) {
- return (
-
-
-
- );
-}
-
-const FieldValueSuggestionsLazy = lazy(() => import('./field_value_suggestions'));
-
-export function FieldValueSuggestions(props: FieldValueSuggestionsProps) {
- return (
-
-
-
- );
-}
-
const FilterValueLabelLazy = lazy(() => import('./filter_value_label/filter_value_label'));
export function FilterValueLabel(props: FilterValueLabelProps) {
diff --git a/x-pack/plugins/exploratory_view/public/index.ts b/x-pack/plugins/exploratory_view/public/index.ts
index e18d34e7af29f..bd3016315da4c 100644
--- a/x-pack/plugins/exploratory_view/public/index.ts
+++ b/x-pack/plugins/exploratory_view/public/index.ts
@@ -32,13 +32,7 @@ export { ALL_VALUES_SELECTED } from './components/shared/exploratory_view/config
export { APP_ROUTE as EXPLORATORY_VIEW_APP_URL } from './constants';
-export {
- ExploratoryView,
- FieldValueSuggestions,
- FieldValueSelection,
- FilterValueLabel,
- SelectableUrlList,
-} from './components/shared';
+export { ExploratoryView, FilterValueLabel, SelectableUrlList } from './components/shared';
export { createExploratoryViewUrl } from './components/shared/exploratory_view/configurations/exploratory_view_url';
export type { AllSeries } from './components/shared/exploratory_view/hooks/use_series_storage';
diff --git a/x-pack/plugins/fleet/cypress/e2e/fleet_settings_outputs.cy.ts b/x-pack/plugins/fleet/cypress/e2e/fleet_settings_outputs.cy.ts
index 53e9461346106..d759811883dc4 100644
--- a/x-pack/plugins/fleet/cypress/e2e/fleet_settings_outputs.cy.ts
+++ b/x-pack/plugins/fleet/cypress/e2e/fleet_settings_outputs.cy.ts
@@ -35,6 +35,10 @@ import { login } from '../tasks/login';
import { visit } from '../tasks/common';
+export const fillYamlConfigBox = (query: string) => {
+ cy.get('[data-test-subj="kibanaCodeEditor"] textarea').type(query, { force: true });
+};
+
describe('Outputs', () => {
beforeEach(() => {
login();
@@ -51,7 +55,7 @@ describe('Outputs', () => {
it('forces custom when reserved key is included in config YAML box', () => {
selectESOutput();
- cy.getBySel('kibanaCodeEditor').click().focused().type('bulk_max_size: 1000');
+ fillYamlConfigBox('bulk_max_size: 1000');
cy.getBySel(SETTINGS_OUTPUTS.PRESET_INPUT)
.should('have.value', 'custom')
@@ -61,7 +65,7 @@ describe('Outputs', () => {
it('allows balanced when reserved key is not included in config yaml box', () => {
selectESOutput();
- cy.getBySel('kibanaCodeEditor').click().focused().type('some_random_key: foo');
+ fillYamlConfigBox('some_random_key: foo');
cy.getBySel(SETTINGS_OUTPUTS.PRESET_INPUT)
.should('have.value', 'balanced')
diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.test.tsx
index 20fb4bb83dac8..5834c776a6dce 100644
--- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.test.tsx
+++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.test.tsx
@@ -30,6 +30,7 @@ const defaultProps = {
shownAgents: 10,
inactiveShownAgents: 0,
totalManagedAgentIds: [],
+ inactiveManagedAgentIds: [],
selectionMode: 'manual',
currentQuery: '',
selectedAgents: [],
@@ -126,6 +127,10 @@ describe('AgentBulkActions', () => {
});
describe('When in query mode', () => {
+ mockedExperimentalFeaturesService.get.mockReturnValue({
+ diagnosticFileUploadEnabled: true,
+ } as any);
+
it('should show correct actions for active agents when no managed policies exist', async () => {
const results = render({
...defaultProps,
@@ -162,15 +167,57 @@ describe('AgentBulkActions', () => {
expect(results.getByText('Add / remove tags').closest('button')!).toBeEnabled();
expect(results.getByText('Assign to new policy').closest('button')!).toBeEnabled();
- expect(results.getByText('Unenroll 8 agents').closest('button')!).toBeEnabled();
- expect(results.getByText('Upgrade 8 agents').closest('button')!).toBeEnabled();
- expect(results.getByText('Schedule upgrade for 8 agents').closest('button')!).toBeDisabled();
expect(
results.getByText('Request diagnostics for 8 agents').closest('button')!
).toBeEnabled();
+ expect(results.getByText('Unenroll 8 agents').closest('button')!).toBeEnabled();
+ expect(results.getByText('Upgrade 8 agents').closest('button')!).toBeEnabled();
+ expect(results.getByText('Schedule upgrade for 8 agents').closest('button')!).toBeDisabled();
expect(results.getByText('Restart upgrade 8 agents').closest('button')!).toBeEnabled();
});
+ it('should show correct actions also when there are inactive managed agents', async () => {
+ const results = render({
+ ...defaultProps,
+ inactiveManagedAgentIds: ['agentId1', 'agentId2'],
+ totalManagedAgentIds: ['agentId1', 'agentId2', 'agentId3'],
+ selectionMode: 'query',
+ });
+
+ const bulkActionsButton = results.getByTestId('agentBulkActionsButton');
+ await act(async () => {
+ fireEvent.click(bulkActionsButton);
+ });
+
+ expect(results.getByText('Add / remove tags').closest('button')!).toBeEnabled();
+ expect(results.getByText('Assign to new policy').closest('button')!).toBeEnabled();
+ expect(results.getByText('Unenroll 9 agents').closest('button')!).toBeEnabled();
+ expect(results.getByText('Upgrade 9 agents').closest('button')!).toBeEnabled();
+ expect(results.getByText('Schedule upgrade for 9 agents').closest('button')!).toBeDisabled();
+ expect(results.getByText('Restart upgrade 9 agents').closest('button')!).toBeEnabled();
+ });
+
+ it('should show disabled actions when only inactive agents are selected', async () => {
+ const results = render({
+ ...defaultProps,
+ inactiveShownAgents: 10,
+ selectedAgents: [{ id: 'agent1' }, { id: 'agent2' }] as Agent[],
+ selectionMode: 'query',
+ });
+
+ const bulkActionsButton = results.getByTestId('agentBulkActionsButton');
+ await act(async () => {
+ fireEvent.click(bulkActionsButton);
+ });
+
+ expect(results.getByText('Add / remove tags').closest('button')!).toBeDisabled();
+ expect(results.getByText('Assign to new policy').closest('button')!).toBeDisabled();
+ expect(results.getByText('Unenroll 0 agents').closest('button')!).toBeDisabled();
+ expect(results.getByText('Upgrade 0 agents').closest('button')!).toBeDisabled();
+ expect(results.getByText('Schedule upgrade for 0 agents').closest('button')!).toBeDisabled();
+ expect(results.getByText('Restart upgrade 0 agents').closest('button')!).toBeDisabled();
+ });
+
it('should generate a correct kuery to select agents', async () => {
const results = render({
...defaultProps,
diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.tsx
index 6ae366f1dbb98..cd00c194a6c11 100644
--- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.tsx
+++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.tsx
@@ -38,6 +38,7 @@ export interface Props {
shownAgents: number;
inactiveShownAgents: number;
totalManagedAgentIds: string[];
+ inactiveManagedAgentIds: string[];
selectionMode: SelectionMode;
currentQuery: string;
selectedAgents: Agent[];
@@ -51,6 +52,7 @@ export const AgentBulkActions: React.FunctionComponent = ({
shownAgents,
inactiveShownAgents,
totalManagedAgentIds,
+ inactiveManagedAgentIds,
selectionMode,
currentQuery,
selectedAgents,
@@ -91,18 +93,19 @@ export const AgentBulkActions: React.FunctionComponent = ({
}
}, [currentQuery, totalManagedAgentIds]);
- // Check if user is working with only inactive agents
- const atLeastOneActiveAgentSelected =
- selectionMode === 'manual'
- ? !!selectedAgents.find((agent) => agent.active)
- : shownAgents > inactiveShownAgents;
const totalActiveAgents = shownAgents - inactiveShownAgents;
+ // exclude inactive agents from the count
const agentCount =
selectionMode === 'manual'
? selectedAgents.length
- : totalActiveAgents - totalManagedAgentIds?.length;
+ : totalActiveAgents - (totalManagedAgentIds?.length - inactiveManagedAgentIds?.length);
+ // Check if user is working with only inactive agents
+ const atLeastOneActiveAgentSelected =
+ selectionMode === 'manual'
+ ? !!selectedAgents.find((agent) => agent.active)
+ : agentCount > 0 && shownAgents > inactiveShownAgents;
const agents = selectionMode === 'manual' ? selectedAgents : selectionQuery;
const [tagsPopoverButton, setTagsPopoverButton] = useState();
diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx
index 3ecc5e6545795..8013a490103af 100644
--- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx
+++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx
@@ -49,6 +49,7 @@ export interface SearchAndFilterBarProps {
inactiveShownAgents: number;
totalInactiveAgents: number;
totalManagedAgentIds: string[];
+ inactiveManagedAgentIds: string[];
selectionMode: SelectionMode;
currentQuery: string;
selectedAgents: Agent[];
@@ -78,6 +79,7 @@ export const SearchAndFilterBar: React.FunctionComponent = () => {
const [inactiveShownAgents, setInactiveShownAgents] = useState(0);
const [totalInactiveAgents, setTotalInactiveAgents] = useState(0);
const [totalManagedAgentIds, setTotalManagedAgentIds] = useState([]);
+ const [inactiveManagedAgentIds, setInactiveManagedAgentIds] = useState([]);
const [managedAgentsOnCurrentPage, setManagedAgentsOnCurrentPage] = useState(0);
const [showAgentActivityTour, setShowAgentActivityTour] = useState({ isOpen: false });
const getSortFieldForAPI = (field: keyof Agent): string => {
@@ -335,7 +336,11 @@ export const AgentListPage: React.FunctionComponent<{}> = () => {
}
const allManagedAgents = response.data?.items ?? [];
const allManagedAgentIds = allManagedAgents?.map((agent) => agent.id);
+ const inactiveManagedIds = allManagedAgents
+ ?.filter((agent) => agent.status === 'inactive')
+ .map((agent) => agent.id);
setTotalManagedAgentIds(allManagedAgentIds);
+ setInactiveManagedAgentIds(inactiveManagedIds);
setManagedAgentsOnCurrentPage(
agentsResponse.data.items
@@ -606,6 +611,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => {
inactiveShownAgents={inactiveShownAgents}
totalInactiveAgents={totalInactiveAgents}
totalManagedAgentIds={totalManagedAgentIds}
+ inactiveManagedAgentIds={inactiveManagedAgentIds}
selectionMode={selectionMode}
currentQuery={kuery}
selectedAgents={selectedAgents}
diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.test.ts
index ebffc0064b989..d759dec042247 100644
--- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.test.ts
+++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.test.ts
@@ -188,7 +188,7 @@ processors:
});
expect(pipelineInstall.contentForInstallation).toMatchInlineSnapshot(
- `"{\\"processors\\":[{\\"set\\":{\\"field\\":\\"test\\",\\"value\\":\\"toto\\"}},{\\"pipeline\\":{\\"name\\":\\"global@custom\\",\\"ignore_missing_pipeline\\":true}},{\\"pipeline\\":{\\"name\\":\\"logs@custom\\",\\"ignore_missing_pipeline\\":true}},{\\"pipeline\\":{\\"name\\":\\"logs-test@custom\\",\\"ignore_missing_pipeline\\":true}}]}"`
+ `"{\\"processors\\":[{\\"set\\":{\\"field\\":\\"test\\",\\"value\\":\\"toto\\"}},{\\"pipeline\\":{\\"name\\":\\"global@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Global pipeline for all data streams\\"}},{\\"pipeline\\":{\\"name\\":\\"logs@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Pipeline for all data streams of type \`logs\`\\"}},{\\"pipeline\\":{\\"name\\":\\"logs-test@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Pipeline for the \`test\` dataset\\"}}]}"`
);
});
@@ -231,12 +231,15 @@ processors:
- pipeline:
name: global@custom
ignore_missing_pipeline: true
+ description: '[Fleet] Global pipeline for all data streams'
- pipeline:
name: logs@custom
ignore_missing_pipeline: true
+ description: '[Fleet] Pipeline for all data streams of type \`logs\`'
- pipeline:
name: logs-test.access@custom
ignore_missing_pipeline: true
+ description: '[Fleet] Pipeline for the \`test.access\` dataset'
- reroute:
tag: test.access
dataset: test.reroute
@@ -280,7 +283,7 @@ processors:
});
expect(pipelineInstall.contentForInstallation).toMatchInlineSnapshot(
- `"{\\"processors\\":[{\\"set\\":{\\"field\\":\\"test\\",\\"value\\":\\"toto\\"}},{\\"pipeline\\":{\\"name\\":\\"global@custom\\",\\"ignore_missing_pipeline\\":true}},{\\"pipeline\\":{\\"name\\":\\"logs@custom\\",\\"ignore_missing_pipeline\\":true}},{\\"pipeline\\":{\\"name\\":\\"logs-test.access@custom\\",\\"ignore_missing_pipeline\\":true}},{\\"reroute\\":{\\"tag\\":\\"test.access\\",\\"dataset\\":\\"test.reroute\\",\\"namespace\\":\\"default\\",\\"if\\":\\"true == true\\"}}]}"`
+ `"{\\"processors\\":[{\\"set\\":{\\"field\\":\\"test\\",\\"value\\":\\"toto\\"}},{\\"pipeline\\":{\\"name\\":\\"global@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Global pipeline for all data streams\\"}},{\\"pipeline\\":{\\"name\\":\\"logs@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Pipeline for all data streams of type \`logs\`\\"}},{\\"pipeline\\":{\\"name\\":\\"logs-test.access@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Pipeline for the \`test.access\` dataset\\"}},{\\"reroute\\":{\\"tag\\":\\"test.access\\",\\"dataset\\":\\"test.reroute\\",\\"namespace\\":\\"default\\",\\"if\\":\\"true == true\\"}}]}"`
);
});
});
diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.ts
index 9c244821fd013..5ab17d690616e 100644
--- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.ts
+++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.ts
@@ -80,25 +80,30 @@ export function addCustomPipelineAndLocalRoutingRulesProcessor(
pipeline.dataStream?.routing_rules?.find(
(rule) => rule.source_dataset === pipeline.dataStream?.dataset
)?.rules ?? [];
+
const customPipelineProcessors = [
{
pipeline: {
name: 'global@custom',
ignore_missing_pipeline: true,
+ description: '[Fleet] Global pipeline for all data streams',
},
},
{
pipeline: {
name: `${pipeline.dataStream.type}@custom`,
ignore_missing_pipeline: true,
+ description: `[Fleet] Pipeline for all data streams of type \`${pipeline.dataStream.type}\``,
},
},
...(pipeline.dataStream.package
? [
{
pipeline: {
- name: `${pipeline.dataStream.type}-${pipeline.dataStream.package}@custom`,
+ // This pipeline name gets the `.integration` suffix to avoid conflicts with the pipeline name for the dataset below
+ name: `${pipeline.dataStream.type}-${pipeline.dataStream.package}.integration@custom`,
ignore_missing_pipeline: true,
+ description: `[Fleet] Pipeline for all data streams of type \`${pipeline.dataStream.type}\` defined by the \`${pipeline.dataStream.package}\` integration`,
},
},
]
@@ -107,6 +112,7 @@ export function addCustomPipelineAndLocalRoutingRulesProcessor(
pipeline: {
name: `${pipeline.dataStream.type}-${pipeline.dataStream.dataset}@custom`,
ignore_missing_pipeline: true,
+ description: `[Fleet] Pipeline for the \`${pipeline.dataStream.dataset}\` dataset`,
},
},
];
diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts
index 375770028488d..670ba36ed6a8d 100644
--- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts
+++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts
@@ -1611,14 +1611,7 @@ describe('EPM template', () => {
},
]);
- expect(esClient.transport.request).toHaveBeenCalledWith(
- expect.objectContaining({
- path: '/test.prefix1-default/_rollover',
- querystring: {
- lazy: true,
- },
- })
- );
+ expect(esClient.indices.rollover).toHaveBeenCalled();
});
it('should skip rollover on expected error when flag is on', async () => {
const esClient = elasticsearchServiceMock.createElasticsearchClient();
diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts
index 750a8ef860491..a60e9dc0c7ced 100644
--- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts
+++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts
@@ -933,12 +933,8 @@ const getDataStreams = async (
const rolloverDataStream = (dataStreamName: string, esClient: ElasticsearchClient) => {
try {
// Do no wrap rollovers in retryTransientEsErrors since it is not idempotent
- return esClient.transport.request({
- method: 'POST',
- path: `/${dataStreamName}/_rollover`,
- querystring: {
- lazy: true,
- },
+ return esClient.indices.rollover({
+ alias: dataStreamName,
});
} catch (error) {
throw new PackageESError(
diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx
index a509870ce6520..b2d08b058dae0 100644
--- a/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx
+++ b/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx
@@ -227,6 +227,13 @@ describe('', () => {
expect(header).toEqual(testIndexName);
});
+ it('changes the tab when its header is clicked', async () => {
+ await testBed.actions.clickIndexDetailsTab(IndexDetailsSection.Mappings);
+ expect(testBed.exists('indexDetailsMappingsCodeBlock')).toBe(true);
+ await testBed.actions.clickIndexDetailsTab(IndexDetailsSection.Settings);
+ expect(testBed.exists('indexDetailsSettingsCodeBlock')).toBe(true);
+ });
+
describe('Overview tab', () => {
it('updates the breadcrumbs to index details overview', async () => {
expect(breadcrumbService.setBreadcrumbs).toHaveBeenLastCalledWith(
diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx
index cac84c44f51c6..736f4410b9237 100644
--- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx
+++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx
@@ -5,15 +5,19 @@
* 2.0.
*/
-import React, { useState, useEffect } from 'react';
+import React, { useState, useEffect, useMemo } from 'react';
import { RouteComponentProps } from 'react-router-dom';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiPageSection, EuiSpacer, EuiPageHeader } from '@elastic/eui';
+import { useRedirectPath } from '../../../../hooks/redirect_path';
import { breadcrumbService, IndexManagementBreadcrumb } from '../../../../services/breadcrumbs';
import { ComponentTemplateDeserialized } from '../../shared_imports';
import { useComponentTemplatesContext } from '../../component_templates_context';
import { ComponentTemplateForm } from '../component_template_form';
+import { useStepFromQueryString } from '../use_step_from_query_string';
+import { useDatastreamsRollover } from '../component_template_datastreams_rollover/use_datastreams_rollover';
+import { MANAGED_BY_FLEET } from '../../constants';
interface Props {
/**
@@ -28,8 +32,35 @@ export const ComponentTemplateCreate: React.FunctionComponent {
const [isSaving, setIsSaving] = useState(false);
const [saveError, setSaveError] = useState(null);
+ const redirectTo = useRedirectPath(history);
+
+ const { activeStep: defaultActiveStep, updateStep } = useStepFromQueryString(history);
+
+ const locationSearchParams = useMemo(() => {
+ return new URLSearchParams(history.location.search);
+ }, [history.location.search]);
+
+ const defaultValue = useMemo(() => {
+ if (sourceComponentTemplate) {
+ return sourceComponentTemplate;
+ }
+
+ const name = locationSearchParams.get('name') ?? '';
+ const managedBy = locationSearchParams.get('managed_by');
+
+ return {
+ name,
+ template: {},
+ _meta: managedBy ? { managed_by: managedBy } : {},
+ _kbnMeta: {
+ usedBy: [],
+ isManaged: false,
+ },
+ };
+ }, [locationSearchParams, sourceComponentTemplate]);
const { api } = useComponentTemplatesContext();
+ const { showDatastreamRolloverModal } = useDatastreamsRollover();
const onSave = async (componentTemplate: ComponentTemplateDeserialized) => {
const { name } = componentTemplate;
@@ -45,10 +76,11 @@ export const ComponentTemplateCreate: React.FunctionComponent {
@@ -88,7 +120,9 @@ export const ComponentTemplateCreate: React.FunctionComponent
{
+ beforeEach(() => {
+ jest.mocked(useComponentTemplatesContext).mockReturnValue({
+ api: {
+ getComponentTemplateDatastreams: jest.fn(),
+ postDataStreamMappingsFromTemplate: jest.fn(),
+ },
+ overlays: { openModal: jest.fn() } as any,
+ } as any);
+ });
+ it('should do nothing if there no impacted data_streams', async () => {
+ jest
+ .mocked(useComponentTemplatesContext().api.getComponentTemplateDatastreams)
+ .mockResolvedValue({ data: { data_streams: [] }, error: undefined });
+
+ const {
+ result: {
+ current: { showDatastreamRolloverModal },
+ },
+ } = renderHook(() => useDatastreamsRollover());
+
+ await showDatastreamRolloverModal('logs-test.data@custom');
+ });
+
+ it('should try to update mappings if there is impacted data_streams', async () => {
+ const { api, overlays } = jest.mocked(useComponentTemplatesContext());
+
+ api.getComponentTemplateDatastreams.mockResolvedValue({
+ data: { data_streams: ['logs-test.data-default'] },
+ error: undefined,
+ });
+
+ api.postDataStreamMappingsFromTemplate.mockResolvedValue({
+ error: undefined,
+ data: { data_streams: [] },
+ });
+
+ jest
+ .mocked(useComponentTemplatesContext().overlays.openModal)
+ .mockReturnValue({ onClose: jest.fn() } as any);
+
+ const {
+ result: {
+ current: { showDatastreamRolloverModal },
+ },
+ } = renderHook(() => useDatastreamsRollover());
+
+ await showDatastreamRolloverModal('logs-test.data@custom');
+
+ expect(api.postDataStreamMappingsFromTemplate).toBeCalledTimes(1);
+ expect(overlays.openModal).not.toBeCalled();
+ });
+
+ it('should show datastream rollover modal if there is an error when updating mappings', async () => {
+ const { api, overlays } = jest.mocked(useComponentTemplatesContext());
+
+ api.getComponentTemplateDatastreams.mockResolvedValue({
+ data: { data_streams: ['logs-test.data-default'] },
+ error: undefined,
+ });
+
+ api.postDataStreamMappingsFromTemplate.mockResolvedValue({
+ error: new Error('test'),
+ data: { data_streams: [] },
+ });
+
+ jest
+ .mocked(useComponentTemplatesContext().overlays.openModal)
+ .mockReturnValue({ onClose: jest.fn() } as any);
+
+ const {
+ result: {
+ current: { showDatastreamRolloverModal },
+ },
+ } = renderHook(() => useDatastreamsRollover());
+
+ await showDatastreamRolloverModal('logs-test.data@custom');
+ expect(overlays.openModal).toBeCalled();
+ });
+});
diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_datastreams_rollover/use_datastreams_rollover.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_datastreams_rollover/use_datastreams_rollover.tsx
new file mode 100644
index 0000000000000..ebb85f2bfa3f2
--- /dev/null
+++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_datastreams_rollover/use_datastreams_rollover.tsx
@@ -0,0 +1,63 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React, { useCallback } from 'react';
+import { toMountPoint } from '@kbn/kibana-react-plugin/public';
+
+import { useComponentTemplatesContext } from '../../component_templates_context';
+import { MappingsDatastreamRolloverModal } from './mappings_datastreams_rollover_modal';
+
+export const test = {};
+
+export function useDatastreamsRollover() {
+ const { api, overlays } = useComponentTemplatesContext();
+
+ const showDatastreamRolloverModal = useCallback(
+ async (componentTemplateName: string) => {
+ const { data: dataStreamResponse } = await api.getComponentTemplateDatastreams(
+ componentTemplateName
+ );
+ const dataStreams = dataStreamResponse?.data_streams ?? [];
+
+ const dataStreamsToRollover: string[] = [];
+ for (const dataStream of dataStreams) {
+ try {
+ const { error: applyMappingError } = await api.postDataStreamMappingsFromTemplate(
+ dataStream
+ );
+ if (applyMappingError) {
+ throw applyMappingError;
+ }
+ } catch (err) {
+ dataStreamsToRollover.push(dataStream);
+ }
+ }
+
+ if (dataStreamsToRollover.length) {
+ const ref = overlays.openModal(
+ toMountPoint(
+ {
+ ref.close();
+ }}
+ />
+ )
+ );
+
+ await ref.onClose;
+ }
+ },
+ [api, overlays]
+ );
+
+ return {
+ showDatastreamRolloverModal,
+ };
+}
diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx
index fbbb6167202f0..334a8295d9c2e 100644
--- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx
+++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx
@@ -5,12 +5,10 @@
* 2.0.
*/
-import React, { useState, useEffect, useMemo, useCallback } from 'react';
+import React, { useState, useEffect, useMemo } from 'react';
import { RouteComponentProps } from 'react-router-dom';
import { FormattedMessage } from '@kbn/i18n-react';
-import { toMountPoint } from '@kbn/kibana-react-plugin/public';
import { EuiPageSection, EuiPageHeader, EuiSpacer } from '@elastic/eui';
-import { History } from 'history';
import { breadcrumbService, IndexManagementBreadcrumb } from '../../../../services/breadcrumbs';
import { useComponentTemplatesContext } from '../../component_templates_context';
@@ -22,47 +20,23 @@ import {
Error,
} from '../../shared_imports';
import { ComponentTemplateForm } from '../component_template_form';
-import type { WizardSection } from '../component_template_form';
import { useRedirectPath } from '../../../../hooks/redirect_path';
import { MANAGED_BY_FLEET } from '../../constants';
-import { MappingsDatastreamRolloverModal } from './mappings_datastreams_rollover_modal';
+import { useStepFromQueryString } from '../use_step_from_query_string';
+import { useDatastreamsRollover } from '../component_template_datastreams_rollover/use_datastreams_rollover';
interface MatchParams {
name: string;
}
-export function useStepFromQueryString(history: History) {
- const activeStep = useMemo(() => {
- const params = new URLSearchParams(history.location.search);
- if (params.has('step')) {
- return params.get('step') as WizardSection;
- }
- }, [history.location.search]);
-
- const updateStep = useCallback(
- (stepId: string) => {
- const params = new URLSearchParams(history.location.search);
- if (params.has('step')) {
- params.set('step', stepId);
- history.push({
- search: params.toString(),
- });
- }
- },
- [history]
- );
-
- return { activeStep, updateStep };
-}
-
export const ComponentTemplateEdit: React.FunctionComponent> = ({
match: {
params: { name },
},
history,
}) => {
- const { api, overlays } = useComponentTemplatesContext();
+ const { api } = useComponentTemplatesContext();
const { activeStep: defaultActiveStep, updateStep } = useStepFromQueryString(history);
const redirectTo = useRedirectPath(history);
@@ -75,6 +49,8 @@ export const ComponentTemplateEdit: React.FunctionComponent dataStreamResponse?.data_streams ?? [], [dataStreamResponse]);
+ const { showDatastreamRolloverModal } = useDatastreamsRollover();
+
useEffect(() => {
breadcrumbService.setBreadcrumbs(IndexManagementBreadcrumb.componentTemplateEdit);
}, []);
@@ -92,37 +68,8 @@ export const ComponentTemplateEdit: React.FunctionComponent {
- ref.close();
- }}
- />
- )
- );
-
- await ref.onClose;
- }
+ if (updatedComponentTemplate._meta?.managed_by === MANAGED_BY_FLEET) {
+ await showDatastreamRolloverModal(updatedComponentTemplate.name);
}
redirectTo({
pathname: encodeURI(
diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.test.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/use_step_from_query_string.test.tsx
similarity index 96%
rename from x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.test.tsx
rename to x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/use_step_from_query_string.test.tsx
index 55400b8ba6f04..cb26f40c91ae3 100644
--- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.test.tsx
+++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/use_step_from_query_string.test.tsx
@@ -7,7 +7,7 @@
import { renderHook } from '@testing-library/react-hooks';
import { createMemoryHistory } from 'history';
-import { useStepFromQueryString } from './component_template_edit';
+import { useStepFromQueryString } from './use_step_from_query_string';
describe('useStepFromQueryString', () => {
it('should return undefined if no step is set in the url', () => {
diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/use_step_from_query_string.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/use_step_from_query_string.tsx
new file mode 100644
index 0000000000000..99852329534d5
--- /dev/null
+++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/use_step_from_query_string.tsx
@@ -0,0 +1,34 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { useCallback, useMemo } from 'react';
+import { History } from 'history';
+import { type WizardSection } from './component_template_form';
+
+export function useStepFromQueryString(history: History) {
+ const activeStep = useMemo(() => {
+ const params = new URLSearchParams(history.location.search);
+ if (params.has('step')) {
+ return params.get('step') as WizardSection;
+ }
+ }, [history.location.search]);
+
+ const updateStep = useCallback(
+ (stepId: string) => {
+ const params = new URLSearchParams(history.location.search);
+ if (params.has('step')) {
+ params.set('step', stepId);
+ history.push({
+ search: params.toString(),
+ });
+ }
+ },
+ [history]
+ );
+
+ return { activeStep, updateStep };
+}
diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page.tsx
index 52572faea21ad..a9ef0e5b24454 100644
--- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page.tsx
+++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page.tsx
@@ -6,12 +6,12 @@
*/
import React, { useCallback, useEffect, useMemo, useState, FunctionComponent } from 'react';
-import qs from 'query-string';
import { RouteComponentProps } from 'react-router-dom';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiPageTemplate, EuiText, EuiCode } from '@elastic/eui';
import { SectionLoading } from '@kbn/es-ui-shared-plugin/public';
+import { resetIndexUrlParams } from './reset_index_url_params';
import {
IndexDetailsSection,
IndexDetailsTabId,
@@ -35,10 +35,7 @@ export const DetailsPage: FunctionComponent<
const [index, setIndex] = useState();
const navigateToIndicesList = useCallback(() => {
- const indicesListParams = qs.parse(search);
- delete indicesListParams.indexName;
- delete indicesListParams.tab;
- const paramsString = qs.stringify(indicesListParams);
+ const paramsString = resetIndexUrlParams(search);
history.push(`/${Section.Indices}${paramsString ? '?' : ''}${paramsString}`);
}, [history, search]);
diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_content.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_content.tsx
index 447c3ff330bac..672d193647c1d 100644
--- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_content.tsx
+++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_content.tsx
@@ -17,6 +17,7 @@ import { css } from '@emotion/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { RouteComponentProps } from 'react-router-dom';
+import { resetIndexUrlParams } from './reset_index_url_params';
import { renderBadges } from '../../../../lib/render_badges';
import { Index } from '../../../../../../common';
import {
@@ -113,7 +114,7 @@ export const DetailsPageContent: FunctionComponent = ({
const onSectionChange = useCallback(
(newSection: IndexDetailsTabId) => {
- return history.push(getIndexDetailsLink(index.name, search, newSection));
+ return history.push(getIndexDetailsLink(index.name, resetIndexUrlParams(search), newSection));
},
[history, index.name, search]
);
diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/reset_index_url_params.ts b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/reset_index_url_params.ts
new file mode 100644
index 0000000000000..193a8aecc4b2a
--- /dev/null
+++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/reset_index_url_params.ts
@@ -0,0 +1,15 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import qs from 'query-string';
+
+export const resetIndexUrlParams = (search: string): string => {
+ const indicesListParams = qs.parse(search);
+ delete indicesListParams.indexName;
+ delete indicesListParams.tab;
+ return qs.stringify(indicesListParams);
+};
diff --git a/x-pack/plugins/infra/public/components/asset_details/hooks/use_data_views.ts b/x-pack/plugins/infra/public/components/asset_details/hooks/use_data_views.ts
index d8883b9c2079a..8207343f2bc4d 100644
--- a/x-pack/plugins/infra/public/components/asset_details/hooks/use_data_views.ts
+++ b/x-pack/plugins/infra/public/components/asset_details/hooks/use_data_views.ts
@@ -10,13 +10,14 @@ import createContainer from 'constate';
import { i18n } from '@kbn/i18n';
import { findInventoryModel } from '@kbn/metrics-data-access-plugin/common';
import { useLogViewReference } from '../../../hooks/use_log_view_reference';
-import { useDataMetricsAdHocDataView } from '../../../hooks/use_metrics_adhoc_data_view';
+import { useDataView } from '../../../hooks/use_data_view';
import { useAssetDetailsRenderPropsContext } from './use_asset_details_render_props';
const useDataViews = ({ metricAlias }: { metricAlias: string }) => {
const { asset } = useAssetDetailsRenderPropsContext();
- const { dataView: metricsDataView, loading: metricsDataViewLoading } =
- useDataMetricsAdHocDataView({ metricAlias });
+ const { dataView: metricsDataView, loading: metricsDataViewLoading } = useDataView({
+ index: metricAlias,
+ });
const {
logViewReference,
getLogsDataView,
@@ -47,4 +48,4 @@ const useDataViews = ({ metricAlias }: { metricAlias: string }) => {
};
};
-export const [DataViewsProvider, useDataViewsProviderContext] = createContainer(useDataViews);
+export const [DataViewsProvider, useDataViewsContext] = createContainer(useDataViews);
diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/logs/logs.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/logs/logs.tsx
index cec2bb6f5e3e5..5535488f45e7d 100644
--- a/x-pack/plugins/infra/public/components/asset_details/tabs/logs/logs.tsx
+++ b/x-pack/plugins/infra/public/components/asset_details/tabs/logs/logs.tsx
@@ -21,7 +21,7 @@ import { findInventoryFields } from '@kbn/metrics-data-access-plugin/common';
import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana';
import { InfraLoadingPanel } from '../../../loading';
import { useAssetDetailsRenderPropsContext } from '../../hooks/use_asset_details_render_props';
-import { useDataViewsProviderContext } from '../../hooks/use_data_views';
+import { useDataViewsContext } from '../../hooks/use_data_views';
import { useDatePickerContext } from '../../hooks/use_date_picker';
import { useAssetDetailsUrlState } from '../../hooks/use_asset_details_url_state';
import { useIntersectingState } from '../../hooks/use_intersecting_state';
@@ -33,7 +33,7 @@ export const Logs = () => {
const { getDateRangeInTimestamp, dateRange, autoRefresh } = useDatePickerContext();
const [urlState, setUrlState] = useAssetDetailsUrlState();
const { asset } = useAssetDetailsRenderPropsContext();
- const { logs } = useDataViewsProviderContext();
+ const { logs } = useDataViewsContext();
const { loading: logViewLoading, reference: logViewReference } = logs ?? {};
diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/metadata/add_metadata_filter_button.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/metadata/add_metadata_filter_button.tsx
index 6e92714ad28b0..f1e0b9073c036 100644
--- a/x-pack/plugins/infra/public/components/asset_details/tabs/metadata/add_metadata_filter_button.tsx
+++ b/x-pack/plugins/infra/public/components/asset_details/tabs/metadata/add_metadata_filter_button.tsx
@@ -8,11 +8,11 @@
import React, { useMemo } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiToolTip, EuiButtonIcon } from '@elastic/eui';
-import { useMetricsDataViewContext } from '../../../../pages/metrics/hosts/hooks/use_data_view';
import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana';
import { buildMetadataFilter } from './build_metadata_filter';
import { useUnifiedSearchContext } from '../../../../pages/metrics/hosts/hooks/use_unified_search';
import type { Field } from './utils';
+import { useDataViewsContext } from '../../hooks/use_data_views';
interface AddMetadataFilterButtonProps {
item: Field;
@@ -23,7 +23,7 @@ const filterAddedToastTitle = i18n.translate('xpack.infra.metadataEmbeddable.fil
});
export const AddMetadataFilterButton = ({ item }: AddMetadataFilterButtonProps) => {
- const { dataView } = useMetricsDataViewContext();
+ const { metrics } = useDataViewsContext();
const { searchCriteria } = useUnifiedSearchContext();
const {
@@ -45,7 +45,7 @@ export const AddMetadataFilterButton = ({ item }: AddMetadataFilterButtonProps)
const newFilter = buildMetadataFilter({
field: item.name,
value: item.value ?? '',
- dataView,
+ dataView: metrics.dataView,
negate: false,
});
if (newFilter) {
diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/kpis/kpi.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/kpis/kpi.tsx
index 4047d365b8f24..9e672731f5056 100644
--- a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/kpis/kpi.tsx
+++ b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/kpis/kpi.tsx
@@ -5,10 +5,10 @@
* 2.0.
*/
import React, { useMemo } from 'react';
-
import type { DataView } from '@kbn/data-views-plugin/public';
import { TimeRange } from '@kbn/es-query';
-import { ChartModel } from '@kbn/lens-embeddable-utils';
+import type { LensConfig, LensDataviewDataset } from '@kbn/lens-embeddable-utils/config_builder';
+import { useDataView } from '../../../../../hooks/use_data_view';
import { METRICS_TOOLTIP } from '../../../../../common/visualizations';
import { LensChart, TooltipContent } from '../../../../lens';
import { buildCombinedHostsFilter } from '../../../../../utils/filters/build';
@@ -19,15 +19,17 @@ export const Kpi = ({
height,
assetName,
dateRange,
- dataView,
...chartProps
-}: ChartModel & {
+}: LensConfig & {
+ id: string;
height: number;
dataView?: DataView;
assetName: string;
dateRange: TimeRange;
}) => {
const { searchSessionId } = useLoadingStateContext();
+ const { dataView } = useDataView({ index: (chartProps.dataset as LensDataviewDataset)?.index });
+
const filters = useMemo(() => {
return [
buildCombinedHostsFilter({
@@ -50,7 +52,6 @@ export const Kpi = ({
{
const charts = useMemo(
() =>
dashboards?.kpi.get({
- metricsDataView: dataView,
+ metricsDataViewId: dataView?.id,
options: {
- backgroundColor: euiTheme.colors.lightestShade,
+ seriesColor: euiTheme.colors.lightestShade,
},
}).charts ?? [],
[dataView, euiTheme.colors.lightestShade, dashboards?.kpi]
diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/chart.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/chart.tsx
index d1e3bc1bdee3a..db61602279306 100644
--- a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/chart.tsx
+++ b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/chart.tsx
@@ -5,8 +5,10 @@
* 2.0.
*/
import React, { useCallback, useMemo } from 'react';
-import type { ChartModel } from '@kbn/lens-embeddable-utils';
+
+import type { LensConfig, LensDataviewDataset } from '@kbn/lens-embeddable-utils/config_builder';
import type { TimeRange } from '@kbn/es-query';
+import { useDataView } from '../../../../../hooks/use_data_view';
import { METRIC_CHART_HEIGHT } from '../../../../../common/visualizations/constants';
import { buildCombinedHostsFilter } from '../../../../../utils/filters/build';
import { type BrushEndArgs, LensChart, type OnFilterEvent, LensChartProps } from '../../../../lens';
@@ -14,28 +16,27 @@ import { useDatePickerContext } from '../../../hooks/use_date_picker';
import { extractRangeFromChartFilterEvent } from './chart_utils';
import { useLoadingStateContext } from '../../../hooks/use_loading_state';
-export type ChartProps = ChartModel &
+export type ChartProps = LensConfig &
Pick & {
+ id: string;
filterFieldName: string;
dateRange: TimeRange;
assetName: string;
- dataViewOrigin?: 'metrics' | 'logs';
['data-test-subj']: string;
};
export const Chart = ({
id,
filterFieldName,
- dataViewOrigin,
overrides,
dateRange,
assetName,
- dataView,
...props
}: ChartProps) => {
const { setDateRange } = useDatePickerContext();
const { searchSessionId } = useLoadingStateContext();
const { ['data-test-subj']: dataTestSubj, ...chartProps } = { ...props };
+ const { dataView } = useDataView({ index: (chartProps.dataset as LensDataviewDataset)?.index });
const filters = useMemo(() => {
return [
@@ -78,7 +79,6 @@ export const Chart = ({
{...chartProps}
id={`${dataTestSubj}${id}`}
borderRadius="m"
- dataView={dataView}
dateRange={dateRange}
height={METRIC_CHART_HEIGHT}
searchSessionId={searchSessionId}
diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/metrics_grid.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/metrics_grid.tsx
index d2697112cd0d0..4477c5d12907f 100644
--- a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/metrics_grid.tsx
+++ b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/metrics_grid.tsx
@@ -7,14 +7,14 @@
import React from 'react';
import { EuiFlexItem, EuiFlexGrid } from '@elastic/eui';
import type { TimeRange } from '@kbn/es-query';
-import type { ChartModel } from '@kbn/lens-embeddable-utils';
+import type { LensConfig } from '@kbn/lens-embeddable-utils/config_builder';
import { Chart } from './chart';
interface Props {
assetName: string;
dateRange: TimeRange;
filterFieldName: string;
- charts: ChartModel[];
+ charts: Array;
['data-test-subj']: string;
}
diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/metrics_section.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/metrics_section.tsx
index 3750b5bf422a7..0f17dde43c283 100644
--- a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/metrics_section.tsx
+++ b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/metrics/metrics_section.tsx
@@ -36,15 +36,15 @@ export const MetricsSection = ({ assetName, metricsDataView, logsDataView, dateR
const dashboards = useMemo(
() => ({
hosts: value?.assetDetails.get({
- metricsDataView,
- logsDataView,
+ metricsDataViewId: metricsDataView?.id,
+ logsDataViewId: logsDataView?.id,
}),
kubernetes: value?.assetDetailsKubernetesNode.get({
- metricsDataView,
+ metricsDataViewId: metricsDataView?.id,
}),
}),
- [logsDataView, metricsDataView, value?.assetDetails, value?.assetDetailsKubernetesNode]
+ [logsDataView?.id, metricsDataView?.id, value?.assetDetails, value?.assetDetailsKubernetesNode]
);
return (
@@ -85,10 +85,10 @@ export const MetricsSectionCompact = ({
const charts = useMemo(
() =>
value?.assetDetailsFlyout.get({
- metricsDataView,
- logsDataView,
+ metricsDataViewId: metricsDataView?.id,
+ logsDataViewId: logsDataView?.id,
}).charts ?? [],
- [metricsDataView, logsDataView, value?.assetDetailsFlyout]
+ [logsDataView?.id, metricsDataView?.id, value?.assetDetailsFlyout]
);
return (
diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/overview.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/overview.tsx
index 8da39ec6e6b7f..29dcdec3ddbc3 100644
--- a/x-pack/plugins/infra/public/components/asset_details/tabs/overview/overview.tsx
+++ b/x-pack/plugins/infra/public/components/asset_details/tabs/overview/overview.tsx
@@ -16,7 +16,7 @@ import { KPIGrid } from './kpis/kpi_grid';
import { MetricsSection, MetricsSectionCompact } from './metrics/metrics_section';
import { useAssetDetailsRenderPropsContext } from '../../hooks/use_asset_details_render_props';
import { useMetadataStateContext } from '../../hooks/use_metadata_state';
-import { useDataViewsProviderContext } from '../../hooks/use_data_views';
+import { useDataViewsContext } from '../../hooks/use_data_views';
import { useDatePickerContext } from '../../hooks/use_date_picker';
import { SectionSeparator } from './section_separator';
import { MetadataErrorCallout } from '../../components/metadata_error_callout';
@@ -33,7 +33,7 @@ export const Overview = () => {
error: fetchMetadataError,
} = useMetadataStateContext();
- const { logs, metrics } = useDataViewsProviderContext();
+ const { logs, metrics } = useDataViewsContext();
const isFullPageView = renderMode.mode !== 'flyout';
diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/profiling/profiling.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/profiling/profiling.tsx
index 0e8d888447a55..527ddcc59cb50 100644
--- a/x-pack/plugins/infra/public/components/asset_details/tabs/profiling/profiling.tsx
+++ b/x-pack/plugins/infra/public/components/asset_details/tabs/profiling/profiling.tsx
@@ -114,6 +114,16 @@ export function Profiling() {
>
),
+ append: (
+
+
+
+
+
+ ),
},
];
diff --git a/x-pack/plugins/infra/public/components/lens/chart_load_error.tsx b/x-pack/plugins/infra/public/components/lens/chart_load_error.tsx
index 5ffdc573a2cd7..364b984208d43 100644
--- a/x-pack/plugins/infra/public/components/lens/chart_load_error.tsx
+++ b/x-pack/plugins/infra/public/components/lens/chart_load_error.tsx
@@ -7,10 +7,9 @@
import React from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText } from '@elastic/eui';
-import { FormattedMessage } from '@kbn/i18n-react';
import { css } from '@emotion/react';
-export const ChartLoadError = () => {
+export const ChartLoadError = ({ error }: { error: Error }) => {
return (
{
-
+ {error.message}
diff --git a/x-pack/plugins/infra/public/components/lens/lens_chart.tsx b/x-pack/plugins/infra/public/components/lens/lens_chart.tsx
index ac8a40d7d580f..e9cd4407fb5b2 100644
--- a/x-pack/plugins/infra/public/components/lens/lens_chart.tsx
+++ b/x-pack/plugins/infra/public/components/lens/lens_chart.tsx
@@ -21,6 +21,7 @@ export type LensChartProps = UseLensAttributesParams &
Pick & {
toolTip?: React.ReactElement;
searchSessionId?: string;
+ description?: string;
};
export const LensChart = React.memo(
@@ -97,9 +98,12 @@ export const LensChart = React.memo(
css={css`
position: relative;
min-height: ${height}px;
+ .embPanel-isLoading {
+ min-height: ${height}px;
+ }
`}
>
- {error ? : content}
+ {error ? : content}
);
}
diff --git a/x-pack/plugins/infra/public/components/lens/types.ts b/x-pack/plugins/infra/public/components/lens/types.ts
index 2d3f76d38a31b..d024b3bb5503b 100644
--- a/x-pack/plugins/infra/public/components/lens/types.ts
+++ b/x-pack/plugins/infra/public/components/lens/types.ts
@@ -5,9 +5,8 @@
* 2.0.
*/
-import type { DataView } from '@kbn/data-views-plugin/public';
import type { TimeRange } from '@kbn/es-query';
-import type { LensAttributes } from '@kbn/lens-embeddable-utils';
+import type { LensAttributes } from '@kbn/lens-embeddable-utils/config_builder';
import type { LensEmbeddableInput, TypedLensByValueInput } from '@kbn/lens-plugin/public';
import type { Action } from '@kbn/ui-actions-plugin/public';
@@ -39,6 +38,5 @@ export type BaseChartProps = Pick<
| 'query'
| 'title'
> & {
- dataView?: DataView;
height?: number;
};
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts b/x-pack/plugins/infra/public/hooks/use_data_view.test.ts
similarity index 92%
rename from x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts
rename to x-pack/plugins/infra/public/hooks/use_data_view.test.ts
index 49e20d9890ccb..157a594498273 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.test.ts
+++ b/x-pack/plugins/infra/public/hooks/use_data_view.test.ts
@@ -10,7 +10,7 @@ import { renderHook } from '@testing-library/react-hooks';
import { type KibanaReactContextValue, useKibana } from '@kbn/kibana-react-plugin/public';
import { coreMock } from '@kbn/core/public/mocks';
import type { DataView, DataViewsServicePublic } from '@kbn/data-views-plugin/public';
-import type { InfraClientStartDeps } from '../../../../types';
+import type { InfraClientStartDeps } from '../types';
import { CoreStart } from '@kbn/core/public';
jest.mock('@kbn/kibana-react-plugin/public');
@@ -40,13 +40,14 @@ describe('useDataView hook', () => {
beforeEach(() => {
dataViewMock = {
create: jest.fn().mockImplementation(() => Promise.resolve(mockDataView)),
+ get: jest.fn().mockImplementation(() => Promise.reject(new Error('Data view not found'))),
} as Partial as jest.Mocked;
mockUseKibana();
});
it('should create a new ad-hoc data view', async () => {
- const { result, waitForNextUpdate } = renderHook(() => useDataView({ metricAlias: 'test' }));
+ const { result, waitForNextUpdate } = renderHook(() => useDataView({ index: 'test' }));
await waitForNextUpdate();
expect(result.current.loading).toEqual(false);
@@ -55,7 +56,7 @@ describe('useDataView hook', () => {
});
it('should create a dataview with unique id for metricAlias metrics', async () => {
- const { waitForNextUpdate } = renderHook(() => useDataView({ metricAlias: 'metrics' }));
+ const { waitForNextUpdate } = renderHook(() => useDataView({ index: 'metrics' }));
await waitForNextUpdate();
expect(dataViewMock.create).toHaveBeenCalledWith({
@@ -66,7 +67,7 @@ describe('useDataView hook', () => {
});
it('should create a dataview with unique id for metricAlias remote-metrics', async () => {
- const { waitForNextUpdate } = renderHook(() => useDataView({ metricAlias: 'remote-metrics' }));
+ const { waitForNextUpdate } = renderHook(() => useDataView({ index: 'remote-metrics' }));
await waitForNextUpdate();
expect(dataViewMock.create).toHaveBeenCalledWith({
diff --git a/x-pack/plugins/infra/public/hooks/use_metrics_adhoc_data_view.ts b/x-pack/plugins/infra/public/hooks/use_data_view.ts
similarity index 57%
rename from x-pack/plugins/infra/public/hooks/use_metrics_adhoc_data_view.ts
rename to x-pack/plugins/infra/public/hooks/use_data_view.ts
index 1761297e9dcff..5ad22e76d2622 100644
--- a/x-pack/plugins/infra/public/hooks/use_metrics_adhoc_data_view.ts
+++ b/x-pack/plugins/infra/public/hooks/use_data_view.ts
@@ -12,31 +12,38 @@ import { useKibanaContextForPlugin } from './use_kibana';
export const TIMESTAMP_FIELD = '@timestamp';
export const DATA_VIEW_PREFIX = 'infra_metrics';
-export const generateDataViewId = (indexPattern: string) => {
+export const generateDataViewId = (index: string) => {
// generates a unique but the same uuid as long as the index pattern doesn't change
- return `${DATA_VIEW_PREFIX}_${uuidv5(indexPattern, uuidv5.DNS)}`;
+ return `${DATA_VIEW_PREFIX}_${uuidv5(index, uuidv5.DNS)}`;
};
-export const useDataMetricsAdHocDataView = ({ metricAlias }: { metricAlias: string }) => {
+export const useDataView = ({ index }: { index?: string }) => {
const {
services: { dataViews },
} = useKibanaContextForPlugin();
- const state = useAsyncRetry(() => {
- return dataViews.create({
- id: generateDataViewId(metricAlias),
- title: metricAlias,
- timeFieldName: TIMESTAMP_FIELD,
- });
- }, [metricAlias]);
+ const state = useAsyncRetry(async () => {
+ if (!index) {
+ return Promise.resolve(undefined);
+ }
+
+ return dataViews.get(index, false).catch(() =>
+ // if data view doesn't exist, create an ad-hoc one
+ dataViews.create({
+ id: generateDataViewId(index),
+ title: index,
+ timeFieldName: TIMESTAMP_FIELD,
+ })
+ );
+ }, [index]);
const { value: dataView, loading, error, retry } = state;
return {
- metricAlias,
+ index,
dataView,
loading,
- loadDataView: retry,
+ retry,
error,
};
};
diff --git a/x-pack/plugins/infra/public/hooks/use_lens_attributes.test.ts b/x-pack/plugins/infra/public/hooks/use_lens_attributes.test.ts
index a0bf9dd6c1fcd..0a619069c04a4 100644
--- a/x-pack/plugins/infra/public/hooks/use_lens_attributes.test.ts
+++ b/x-pack/plugins/infra/public/hooks/use_lens_attributes.test.ts
@@ -8,37 +8,28 @@
import 'jest-canvas-mock';
import { renderHook } from '@testing-library/react-hooks';
import { useLensAttributes } from './use_lens_attributes';
-import type { DataView } from '@kbn/data-views-plugin/public';
import { coreMock } from '@kbn/core/public/mocks';
import { type KibanaReactContextValue, useKibana } from '@kbn/kibana-react-plugin/public';
import { CoreStart } from '@kbn/core/public';
import type { InfraClientStartDeps } from '../types';
+import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks';
import { lensPluginMock } from '@kbn/lens-plugin/public/mocks';
import { FilterStateStore } from '@kbn/es-query';
+import type { LensBaseLayer, LensConfig } from '@kbn/lens-embeddable-utils/config_builder';
+
+import { LensConfigBuilder } from '@kbn/lens-embeddable-utils/config_builder';
jest.mock('@kbn/kibana-react-plugin/public');
-const useKibanaMock = useKibana as jest.MockedFunction;
-const mockDataView = {
- id: 'mock-id',
- title: 'mock-title',
- timeFieldName: '@timestamp',
- isPersisted: () => false,
- getName: () => 'mock-data-view',
- toSpec: () => ({}),
- fields: [],
- metaFields: [],
-} as unknown as jest.Mocked;
+const useKibanaMock = useKibana as jest.MockedFunction;
+jest.mock('@kbn/lens-embeddable-utils/config_builder');
+const LensConfigBuilderMock = LensConfigBuilder as jest.MockedClass;
-const normalizedLoad1m = {
+const normalizedLoad1m: LensBaseLayer = {
label: 'Normalized Load',
value: 'average(system.load.1) / max(system.load.cores)',
- format: {
- id: 'percent',
- params: {
- decimals: 0,
- },
- },
+ format: 'percent',
+ decimals: 0,
};
const lensPluginMockStart = lensPluginMock.createStartContract();
@@ -46,174 +37,49 @@ const mockUseKibana = () => {
useKibanaMock.mockReturnValue({
services: {
...coreMock.createStart(),
+ dataViews: { ...dataViewPluginMocks.createStartContract() },
lens: { ...lensPluginMockStart },
} as Partial & Partial,
} as unknown as KibanaReactContextValue & Partial>);
};
-describe('useHostTable hook', () => {
+describe('useLensAttributes hook', () => {
+ const params: LensConfig = {
+ chartType: 'xy',
+ layers: [
+ {
+ type: 'series',
+ yAxis: [normalizedLoad1m],
+ xAxis: '@timestamp',
+ seriesType: 'line',
+ },
+ {
+ type: 'reference',
+ yAxis: [
+ {
+ value: '1',
+ },
+ ],
+ },
+ ],
+ title: 'Injected Normalized Load',
+ dataset: {
+ index: 'mock-id',
+ },
+ };
beforeEach(() => {
mockUseKibana();
});
it('should return the basic lens attributes', async () => {
- const { result, waitForNextUpdate } = renderHook(() =>
- useLensAttributes({
- visualizationType: 'lnsXY',
- layers: [
- {
- data: [normalizedLoad1m],
- options: {
- buckets: {
- type: 'date_histogram',
- },
- breakdown: {
- field: 'host.name',
- type: 'top_values',
- params: {
- size: 10,
- },
- },
- },
- layerType: 'data',
- },
- {
- data: [
- {
- value: '1',
- format: {
- id: 'percent',
- params: {
- decimals: 0,
- },
- },
- },
- ],
- layerType: 'referenceLine',
- },
- ],
- title: 'Injected Normalized Load',
- dataView: mockDataView,
- })
- );
+ const { waitForNextUpdate } = renderHook(() => useLensAttributes(params));
await waitForNextUpdate();
- const { state, title } = result.current.attributes ?? {};
- const { datasourceStates } = state ?? {};
-
- expect(title).toBe('Injected Normalized Load');
- expect(datasourceStates).toEqual({
- formBased: {
- layers: {
- layer_0: {
- columnOrder: ['aggs_breakdown', 'x_date_histogram', 'formula_accessor_0_0'],
- columns: {
- aggs_breakdown: {
- dataType: 'string',
- isBucketed: true,
- label: 'Top 10 values of host.name',
- operationType: 'terms',
- params: {
- exclude: [],
- excludeIsRegex: false,
- include: [],
- includeIsRegex: false,
- missingBucket: false,
- orderBy: {
- fallback: false,
- type: 'alphabetical',
- },
- orderDirection: 'asc',
- otherBucket: false,
- parentFormat: {
- id: 'terms',
- },
- size: 10,
- },
- scale: 'ordinal',
- sourceField: 'host.name',
- },
- x_date_histogram: {
- dataType: 'date',
- isBucketed: true,
- label: '@timestamp',
- operationType: 'date_histogram',
- params: {
- interval: 'auto',
- },
- scale: 'interval',
- sourceField: '@timestamp',
- },
- formula_accessor_0_0: {
- customLabel: true,
- dataType: 'number',
- filter: undefined,
- isBucketed: false,
- label: 'Normalized Load',
- operationType: 'formula',
- params: {
- format: {
- id: 'percent',
- params: {
- decimals: 0,
- },
- },
- formula: 'average(system.load.1) / max(system.load.cores)',
- isFormulaBroken: true,
- },
- reducedTimeRange: undefined,
- references: [],
- timeScale: undefined,
- },
- },
- indexPatternId: 'mock-id',
- },
- layer_1_reference: {
- columnOrder: ['formula_accessor_1_0_reference_column'],
- columns: {
- formula_accessor_1_0_reference_column: {
- customLabel: true,
- dataType: 'number',
- isBucketed: false,
- isStaticValue: true,
- label: 'Reference',
- operationType: 'static_value',
- params: {
- format: {
- id: 'percent',
- params: {
- decimals: 0,
- },
- },
- value: '1',
- },
- references: [],
- scale: 'ratio',
- },
- },
- incompleteColumns: {},
- linkToLayers: [],
- sampling: 1,
- },
- },
- },
- });
+ expect(LensConfigBuilderMock.mock.instances[0].build).toHaveBeenCalledWith(params);
});
it('should return extra actions', async () => {
- const { result, waitForNextUpdate } = renderHook(() =>
- useLensAttributes({
- title: 'Chart',
- visualizationType: 'lnsXY',
- layers: [
- {
- data: [normalizedLoad1m],
- layerType: 'data',
- },
- ],
- dataView: mockDataView,
- })
- );
+ const { result, waitForNextUpdate } = renderHook(() => useLensAttributes(params));
await waitForNextUpdate();
const extraActions = result.current.getExtraActions({
diff --git a/x-pack/plugins/infra/public/hooks/use_lens_attributes.ts b/x-pack/plugins/infra/public/hooks/use_lens_attributes.ts
index 7a5f07d171eb7..cf2c07147c338 100644
--- a/x-pack/plugins/infra/public/hooks/use_lens_attributes.ts
+++ b/x-pack/plugins/infra/public/hooks/use_lens_attributes.ts
@@ -5,62 +5,43 @@
* 2.0.
*/
-import { useCallback, useMemo } from 'react';
-import type { DataView } from '@kbn/data-views-plugin/public';
+import { useCallback } from 'react';
import { Filter, Query, TimeRange } from '@kbn/es-query';
-import { useKibana } from '@kbn/kibana-react-plugin/public';
import type { Action, ActionExecutionContext } from '@kbn/ui-actions-plugin/public';
import { i18n } from '@kbn/i18n';
import useAsync from 'react-use/lib/useAsync';
-import { FormulaPublicApi } from '@kbn/lens-plugin/public';
import {
- type LensVisualizationState,
- type Chart,
type LensAttributes,
- type ChartModel,
- type XYLayerConfig,
- LensAttributesBuilder,
- XYChart,
- MetricChart,
- MetricLayer,
- XYDataLayer,
- XYReferenceLinesLayer,
-} from '@kbn/lens-embeddable-utils';
-import { InfraClientSetupDeps } from '../types';
+ type LensConfig,
+ LensConfigBuilder,
+} from '@kbn/lens-embeddable-utils/config_builder';
+import { useKibanaContextForPlugin } from './use_kibana';
-export type UseLensAttributesParams = Omit;
+export type UseLensAttributesParams = LensConfig;
-export const useLensAttributes = ({ dataView, ...params }: UseLensAttributesParams) => {
+export const useLensAttributes = (params: UseLensAttributesParams) => {
const {
- services: { lens },
- } = useKibana();
+ services: { lens, dataViews },
+ } = useKibanaContextForPlugin();
const { navigateToPrefilledEditor } = lens;
- const { value, error } = useAsync(() => {
- return lens.stateHelperApi();
- }, [lens]);
- const { formula: formulaAPI } = value ?? {};
- const attributes = useMemo(() => {
- if (!dataView || !formulaAPI) {
- return null;
+ const { value: attributes, error } = useAsync(async () => {
+ const { formula: formulaAPI } = await lens.stateHelperApi();
+ if (!dataViews || !formulaAPI || !params.dataset) {
+ return undefined;
}
- const builder = new LensAttributesBuilder({
- visualization: chartFactory({
- dataView,
- formulaAPI,
- ...params,
- }),
- });
+ const builder = new LensConfigBuilder(formulaAPI, dataViews);
- return builder.build();
- }, [dataView, formulaAPI, params]);
+ return builder.build(params) as Promise;
+ }, [params.chartType, params.dataset, dataViews]);
const injectFilters = useCallback(
({ filters, query }: { filters: Filter[]; query: Query }): LensAttributes | null => {
if (!attributes) {
return null;
}
+
return {
...attributes,
state: {
@@ -125,79 +106,19 @@ export const useLensAttributes = ({ dataView, ...params }: UseLensAttributesPara
);
const getFormula = () => {
- const firstDataLayer = [
- ...(Array.isArray(params.layers) ? params.layers : [params.layers]),
- ].find((p) => p.layerType === 'data');
-
- if (!firstDataLayer) {
- return '';
+ if (params.chartType === 'xy') {
+ return params.layers[0].yAxis[0].value;
}
- const mainFormulaConfig = Array.isArray(firstDataLayer.data)
- ? firstDataLayer.data[0]
- : firstDataLayer.data;
-
- return mainFormulaConfig.value;
+ return params.value;
};
- return { formula: getFormula(), attributes, getExtraActions, error };
-};
-
-const chartFactory = ({
- dataView,
- formulaAPI,
- ...params
-}: {
- dataView: DataView;
- formulaAPI: FormulaPublicApi;
-} & UseLensAttributesParams): Chart => {
- switch (params.visualizationType) {
- case 'lnsXY':
- if (!Array.isArray(params.layers)) {
- throw new Error(`Invalid layers type. Expected an array of layers.`);
- }
-
- const xyLayerFactory = (layer: XYLayerConfig) => {
- switch (layer.layerType) {
- case 'data': {
- return new XYDataLayer(layer);
- }
- case 'referenceLine': {
- return new XYReferenceLinesLayer(layer);
- }
- default:
- throw new Error(`Invalid layer type`);
- }
- };
-
- const { layers, ...rest } = params;
- return new XYChart({
- dataView,
- formulaAPI,
- layers: layers.map((layerItem) => {
- return xyLayerFactory(layerItem);
- }),
- ...rest,
- });
-
- case 'lnsMetric':
- if (Array.isArray(params.layers)) {
- throw new Error(`Invalid layer type. Expected a single layer object.`);
- }
-
- return new MetricChart({
- dataView,
- formulaAPI,
- layers: new MetricLayer({
- data: params.layers.data,
- options: { ...params.layers.options },
- layerType: params.layers.layerType,
- }),
- title: params.title,
- });
- default:
- throw new Error(`Unsupported chart type`);
- }
+ return {
+ formula: getFormula(),
+ attributes: attributes as LensAttributes | null,
+ getExtraActions,
+ error,
+ };
};
const getOpenInLensAction = (onExecute: () => void): Action => {
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_container.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_container.tsx
index 2fdf896328103..5b5fab795ff81 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_container.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_container.tsx
@@ -9,14 +9,14 @@ import { EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { InfraLoadingPanel } from '../../../../components/loading';
-import { useMetricsDataViewContext } from '../hooks/use_data_view';
+import { useMetricsDataViewContext } from '../hooks/use_metrics_data_view';
import { UnifiedSearchBar } from './search_bar/unified_search_bar';
import { HostsContent } from './hosts_content';
import { ErrorCallout } from './error_callout';
import { UnifiedSearchProvider } from '../hooks/use_unified_search';
export const HostContainer = () => {
- const { dataView, loading, error, metricAlias, loadDataView } = useMetricsDataViewContext();
+ const { dataView, loading, error, metricAlias, retry } = useMetricsDataViewContext();
const isLoading = loading || !dataView;
if (isLoading && !error) {
@@ -42,7 +42,7 @@ export const HostContainer = () => {
'There was an error trying to create a Data View: {metricAlias}. Try reloading the page.',
values: { metricAlias },
})}
- onTryAgainClick={loadDataView}
+ onTryAgainClick={retry}
hasTryAgainButton
/>
) : (
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/kpi.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/kpi.tsx
index e14d72ac7207d..a88a3ccdcf4ab 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/kpi.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/kpis/kpi.tsx
@@ -5,7 +5,8 @@
* 2.0.
*/
import React, { useMemo } from 'react';
-import { ChartModel } from '@kbn/lens-embeddable-utils';
+import type { LensConfig, LensDataviewDataset } from '@kbn/lens-embeddable-utils/config_builder';
+import { useDataView } from '../../../../../hooks/use_data_view';
import { METRICS_TOOLTIP } from '../../../../../common/visualizations';
import { LensChart, TooltipContent } from '../../../../../components/lens';
import { buildCombinedHostsFilter } from '../../../../../utils/filters/build';
@@ -14,16 +15,11 @@ import { useHostsViewContext } from '../../hooks/use_hosts_view';
import { useHostCountContext } from '../../hooks/use_host_count';
import { useAfterLoadedState } from '../../hooks/use_after_loaded_state';
-export const Kpi = ({
- id,
- height,
- visualizationType = 'lnsMetric',
- dataView,
- ...chartProps
-}: ChartModel & { height: number }) => {
+export const Kpi = ({ id, height, ...chartProps }: LensConfig & { height: number; id: string }) => {
const { searchCriteria } = useUnifiedSearchContext();
const { hostNodes, loading: hostsLoading, searchSessionId } = useHostsViewContext();
const { isRequestRunning: hostCountLoading } = useHostCountContext();
+ const { dataView } = useDataView({ index: (chartProps.dataset as LensDataviewDataset)?.index });
const shouldUseSearchCriteria = hostNodes.length === 0;
const loading = hostsLoading || hostCountLoading;
@@ -60,12 +56,10 @@ export const Kpi = ({
{
@@ -43,9 +43,9 @@ export const KPIGrid = () => {
const charts = useMemo(
() =>
dashboards?.kpi.get({
- metricsDataView: dataView,
+ metricsDataViewId: dataView?.id,
options: {
- backgroundColor: euiTheme.colors.lightestShade,
+ seriesColor: euiTheme.colors.lightestShade,
...(subtitle ? { subtitle } : {}),
},
}).charts ?? [],
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/search_bar/unified_search_bar.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/search_bar/unified_search_bar.tsx
index 96ee8542ea727..4c5b5fef264c5 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/search_bar/unified_search_bar.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/search_bar/unified_search_bar.tsx
@@ -14,7 +14,7 @@ import { useKibanaHeader } from '../../../../../hooks/use_kibana_header';
import { useKibanaContextForPlugin } from '../../../../../hooks/use_kibana';
import { useUnifiedSearchContext } from '../../hooks/use_unified_search';
import { ControlsContent } from './controls_content';
-import { useMetricsDataViewContext } from '../../hooks/use_data_view';
+import { useMetricsDataViewContext } from '../../hooks/use_metrics_data_view';
import { LimitOptions } from './limit_options';
import { HostLimitOptions } from '../../types';
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/metrics/chart.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/metrics/chart.tsx
index 1d82f0d76da22..a90347c3be697 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/metrics/chart.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/tabs/metrics/chart.tsx
@@ -5,7 +5,8 @@
* 2.0.
*/
import React, { useMemo } from 'react';
-import type { ChartModel, XYVisualOptions } from '@kbn/lens-embeddable-utils';
+import type { LensConfig, LensDataviewDataset } from '@kbn/lens-embeddable-utils/config_builder';
+import { useDataView } from '../../../../../../hooks/use_data_view';
import { METRIC_CHART_HEIGHT } from '../../../../../../common/visualizations/constants';
import { LensChart } from '../../../../../../components/lens';
import { useUnifiedSearchContext } from '../../../hooks/use_unified_search';
@@ -14,14 +15,15 @@ import { buildCombinedHostsFilter } from '../../../../../../utils/filters/build'
import { useHostsTableContext } from '../../../hooks/use_hosts_table';
import { useAfterLoadedState } from '../../../hooks/use_after_loaded_state';
-export interface ChartProps extends Omit {
- visualOptions?: XYVisualOptions;
-}
+export type ChartProps = LensConfig & {
+ id: string;
+};
-export const Chart = ({ dataView, ...chartProps }: ChartProps) => {
+export const Chart = ({ id, ...chartProps }: ChartProps) => {
const { searchCriteria } = useUnifiedSearchContext();
const { loading, searchSessionId } = useHostsViewContext();
const { currentPage } = useHostsTableContext();
+ const { dataView } = useDataView({ index: (chartProps.dataset as LensDataviewDataset)?.index });
const shouldUseSearchCriteria = currentPage.length === 0;
@@ -44,14 +46,13 @@ export const Chart = ({ dataView, ...chartProps }: ChartProps) => {
dataView,
}),
];
- }, [searchCriteria.filters, currentPage, dataView, shouldUseSearchCriteria]);
+ }, [shouldUseSearchCriteria, searchCriteria.filters, currentPage, dataView]);
return (
{
const model = findInventoryModel('host');
@@ -23,7 +23,7 @@ export const MetricsGrid = () => {
});
const charts = useMemo(
- () => dashboards?.hostsView.get({ metricsDataView: dataView }).charts ?? [],
+ () => dashboards?.hostsView.get({ metricsDataViewId: dataView?.id }).charts ?? [],
[dataView, dashboards]
);
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_count.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_count.ts
index 134e651ed7a64..1058ca994c430 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_count.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_count.ts
@@ -15,7 +15,7 @@ import type { ITelemetryClient } from '../../../../services/telemetry';
import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana';
import { decodeOrThrow } from '../../../../../common/runtime_types';
import { useDataSearch, useLatestPartialDataSearchResponse } from '../../../../utils/data_search';
-import { useMetricsDataViewContext } from './use_data_view';
+import { useMetricsDataViewContext } from './use_metrics_data_view';
import { useUnifiedSearchContext } from './use_unified_search';
export const useHostCount = () => {
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.test.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.test.ts
index 9d6ea82bec095..1d7ea3bd82538 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.test.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.test.ts
@@ -11,11 +11,11 @@ import { InfraAssetMetricsItem } from '../../../../../common/http_api';
import * as useUnifiedSearchHooks from './use_unified_search';
import * as useHostsViewHooks from './use_hosts_view';
import * as useKibanaContextForPluginHook from '../../../../hooks/use_kibana';
-import * as useMetricsDataViewHooks from './use_data_view';
+import * as useMetricsDataViewHooks from './use_metrics_data_view';
jest.mock('./use_unified_search');
jest.mock('./use_hosts_view');
-jest.mock('./use_data_view');
+jest.mock('./use_metrics_data_view');
jest.mock('../../../../hooks/use_kibana');
const mockUseUnifiedSearchContext =
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.tsx
index 23aee3a6c1e3c..f7d4c4ce15099 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.tsx
@@ -28,7 +28,7 @@ import type {
} from '../../../../../common/http_api';
import { Sorting, useHostsTableUrlState } from './use_hosts_table_url_state';
import { useHostsViewContext } from './use_hosts_view';
-import { useMetricsDataViewContext } from './use_data_view';
+import { useMetricsDataViewContext } from './use_metrics_data_view';
import { ColumnHeader } from '../components/table/column_header';
import { TABLE_COLUMN_LABEL } from '../translations';
import { METRICS_TOOLTIP } from '../../../../common/visualizations';
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_metrics_data_view.ts
similarity index 54%
rename from x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.ts
rename to x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_metrics_data_view.ts
index b7b3103dacfc4..4c62bc58f00a9 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_data_view.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_metrics_data_view.ts
@@ -6,24 +6,21 @@
*/
import createContainer from 'constate';
-import { useDataMetricsAdHocDataView } from '../../../../hooks/use_metrics_adhoc_data_view';
+import { useDataView } from '../../../../hooks/use_data_view';
-export const useDataView = ({ metricAlias }: { metricAlias: string }) => {
- const {
- dataView,
- loading,
- loadDataView: retry,
- error,
- } = useDataMetricsAdHocDataView({ metricAlias });
+export const useMetricsDataView = ({ metricAlias }: { metricAlias: string }) => {
+ const { dataView, loading, retry, error } = useDataView({
+ index: metricAlias,
+ });
return {
metricAlias,
dataView,
loading,
- loadDataView: retry,
+ retry,
error,
};
};
-export const MetricsDataView = createContainer(useDataView);
+export const MetricsDataView = createContainer(useMetricsDataView);
export const [MetricsDataViewProvider, useMetricsDataViewContext] = MetricsDataView;
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_unified_search.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_unified_search.ts
index 3f6741b33f65c..caefb2f8a3089 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_unified_search.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_unified_search.ts
@@ -15,7 +15,7 @@ import { parseDateRange } from '../../../../utils/datemath';
import { useKibanaQuerySettings } from '../../../../utils/use_kibana_query_settings';
import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana';
import { telemetryTimeRangeFormatter } from '../../../../../common/formatters/telemetry_time_range';
-import { useMetricsDataViewContext } from './use_data_view';
+import { useMetricsDataViewContext } from './use_metrics_data_view';
import {
HostsSearchPayload,
useHostsUrlState,
diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx
index 8766a8bdddf2e..4e97a99e37553 100644
--- a/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx
@@ -18,7 +18,7 @@ import { useSourceContext } from '../../../containers/metrics_source';
import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs';
import { MetricsPageTemplate } from '../page_template';
import { hostsTitle } from '../../../translations';
-import { MetricsDataViewProvider } from './hooks/use_data_view';
+import { MetricsDataViewProvider } from './hooks/use_metrics_data_view';
import { fullHeightContentStyles } from '../../../page_template.styles';
import { HostContainer } from './components/hosts_container';
import { BetaBadge } from '../../../components/beta_badge';
diff --git a/x-pack/plugins/lens/public/datasources/form_based/utils.test.tsx b/x-pack/plugins/lens/public/datasources/form_based/utils.test.tsx
index f4aa785bd25f2..7d7b2d9b59f83 100644
--- a/x-pack/plugins/lens/public/datasources/form_based/utils.test.tsx
+++ b/x-pack/plugins/lens/public/datasources/form_based/utils.test.tsx
@@ -435,5 +435,68 @@ describe('indexpattern_datasource utils', () => {
);
expect(warnings).toHaveLength(2);
});
+
+ // formula columns should never have a source field
+ // but it has been observed in the wild (https://github.com/elastic/kibana/issues/168561)
+ it('should ignore formula column with source field', () => {
+ const state = {
+ layers: {
+ '08ae29be-2717-4320-a908-a50ca73ee558': {
+ indexPatternId: '0',
+ columnOrder: [
+ '62f73507-09c4-4bf9-9e6f-a9692e348d94',
+ '1a027207-98b3-4a57-a97f-4c67e95eebc1',
+ ],
+ columns: {
+ '1a027207-98b3-4a57-a97f-4c67e95eebc1': {
+ customLabel: true,
+ dataType: 'number',
+ filter: {
+ language: 'kuery',
+ query: 'my:field',
+ },
+ isBucketed: false,
+ label: 'Failures',
+ operationType: 'count',
+ params: {
+ emptyAsNull: true,
+ },
+ scale: 'ratio',
+ sourceField: '___records___',
+ },
+ '62f73507-09c4-4bf9-9e6f-a9692e348d94': {
+ customLabel: true,
+ dataType: 'number',
+ filter: {
+ language: 'kuery',
+ query: 'my:field',
+ },
+ isBucketed: false,
+ label: 'Success',
+ operationType: 'formula',
+ params: {
+ emptyAsNull: true,
+ formula: 'count(kql=\'message:"some message" AND message:"SUCCESS"\')',
+ isFormulaBroken: false,
+ },
+ references: ['62f73507-09c4-4bf9-9e6f-a9692e348d94X0'],
+ scale: 'ratio',
+ // here's the issue - this should not be here
+ sourceField: '___records___',
+ },
+ },
+ incompleteColumns: {},
+ },
+ },
+ } as unknown as FormBasedPrivateState;
+
+ expect(() => {
+ getUnsupportedOperationsWarningMessage(
+ state,
+ createFramePublic(createMockedIndexPatternWithAdditionalFields([])),
+ docLinks
+ );
+ }).not.toThrow();
+ });
});
});
diff --git a/x-pack/plugins/lens/public/datasources/form_based/utils.tsx b/x-pack/plugins/lens/public/datasources/form_based/utils.tsx
index 16c4dbdc047fb..280e2d6a19a1a 100644
--- a/x-pack/plugins/lens/public/datasources/form_based/utils.tsx
+++ b/x-pack/plugins/lens/public/datasources/form_based/utils.tsx
@@ -338,20 +338,24 @@ export function getUnsupportedOperationsWarningMessage(
const columnsEntries = Object.entries(layer.columns);
return columnsEntries
.filter(([_, column]) => {
- if (!hasField(column)) {
+ const operation = operationDefinitionMap[column.operationType] as Extract<
+ GenericOperationDefinition,
+ { input: 'field' }
+ >;
+
+ // this check for getPossibleOperationForField is needed as long as
+ // https://github.com/elastic/kibana/issues/168561 is unresolved
+ if (!operation.getPossibleOperationForField || !hasField(column)) {
return false;
}
+
const field = dataView.getFieldByName(column.sourceField);
if (!field) {
return false;
}
return (
- !(
- operationDefinitionMap[column.operationType] as Extract<
- GenericOperationDefinition,
- { input: 'field' }
- >
- ).getPossibleOperationForField(field) && field?.timeSeriesMetric === 'counter'
+ !operation.getPossibleOperationForField?.(field) &&
+ field?.timeSeriesMetric === 'counter'
);
})
.map(
diff --git a/x-pack/plugins/log_explorer/common/constants.ts b/x-pack/plugins/log_explorer/common/constants.ts
index b9e85258b9d9c..62cd9af1d05c3 100644
--- a/x-pack/plugins/log_explorer/common/constants.ts
+++ b/x-pack/plugins/log_explorer/common/constants.ts
@@ -14,23 +14,29 @@ export const LOG_LEVEL_FIELD = 'log.level';
export const MESSAGE_FIELD = 'message';
export const ERROR_MESSAGE_FIELD = 'error.message';
export const EVENT_ORIGINAL_FIELD = 'event.original';
-export const SERVICE_NAME_FIELD = 'service.name';
export const TRACE_ID_FIELD = 'trace.id';
+export const LOG_FILE_PATH_FIELD = 'log.file.path';
+export const DATASTREAM_NAMESPACE_FIELD = 'data_stream.namespace';
+export const DATASTREAM_DATASET_FIELD = 'data_stream.dataset';
+
+// Resource Fields
export const AGENT_NAME_FIELD = 'agent.name';
-export const ORCHESTRATOR_CLUSTER_NAME_FIELD = 'orchestrator.cluster.name';
-export const ORCHESTRATOR_RESOURCE_ID_FIELD = 'orchestrator.resource.id';
export const CLOUD_PROVIDER_FIELD = 'cloud.provider';
export const CLOUD_REGION_FIELD = 'cloud.region';
export const CLOUD_AVAILABILITY_ZONE_FIELD = 'cloud.availability_zone';
export const CLOUD_PROJECT_ID_FIELD = 'cloud.project.id';
export const CLOUD_INSTANCE_ID_FIELD = 'cloud.instance.id';
-export const LOG_FILE_PATH_FIELD = 'log.file.path';
-export const DATASTREAM_NAMESPACE_FIELD = 'data_stream.namespace';
-export const DATASTREAM_DATASET_FIELD = 'data_stream.dataset';
+export const SERVICE_NAME_FIELD = 'service.name';
+export const ORCHESTRATOR_CLUSTER_NAME_FIELD = 'orchestrator.cluster.name';
+export const ORCHESTRATOR_RESOURCE_ID_FIELD = 'orchestrator.resource.id';
+export const ORCHESTRATOR_NAMESPACE_FIELD = 'orchestrator.namespace';
+export const CONTAINER_NAME_FIELD = 'container.name';
+export const CONTAINER_ID_FIELD = 'container.id';
// Virtual column fields
export const CONTENT_FIELD = 'content';
+export const RESOURCE_FIELD = 'resource';
// Sizing
export const DATA_GRID_COLUMN_WIDTH_SMALL = 240;
@@ -39,11 +45,7 @@ export const DATA_GRID_COLUMN_WIDTH_MEDIUM = 320;
// UI preferences
export const DEFAULT_COLUMNS = [
{
- field: SERVICE_NAME_FIELD,
- width: DATA_GRID_COLUMN_WIDTH_SMALL,
- },
- {
- field: HOST_NAME_FIELD,
+ field: RESOURCE_FIELD,
width: DATA_GRID_COLUMN_WIDTH_MEDIUM,
},
{
diff --git a/x-pack/plugins/log_explorer/public/controller/controller_customizations.ts b/x-pack/plugins/log_explorer/common/document.ts
similarity index 65%
rename from x-pack/plugins/log_explorer/public/controller/controller_customizations.ts
rename to x-pack/plugins/log_explorer/common/document.ts
index 5430d0aebdd07..e9b97f1671f1e 100644
--- a/x-pack/plugins/log_explorer/public/controller/controller_customizations.ts
+++ b/x-pack/plugins/log_explorer/common/document.ts
@@ -5,24 +5,7 @@
* 2.0.
*/
-import type { DataTableRecord } from '@kbn/discover-utils/types';
-import { DocViewRenderProps } from '@kbn/unified-doc-viewer/types';
-
-export interface LogExplorerCustomizations {
- flyout?: {
- renderContent?: RenderContentCustomization;
- };
-}
-
-export interface LogExplorerFlyoutContentProps {
- actions: {
- addFilter: DocViewRenderProps['filter'];
- addColumn: DocViewRenderProps['onAddColumn'];
- removeColumn: DocViewRenderProps['onRemoveColumn'];
- };
- dataView: DocViewRenderProps['dataView'];
- doc: LogDocument;
-}
+import type { DataTableRecord } from '@kbn/discover-utils/src/types';
export interface LogDocument extends DataTableRecord {
flattened: {
@@ -37,7 +20,11 @@ export interface LogDocument extends DataTableRecord {
'trace.id'?: string;
'agent.name'?: string;
'orchestrator.cluster.name'?: string;
+ 'orchestrator.cluster.id'?: string;
'orchestrator.resource.id'?: string;
+ 'orchestrator.namespace'?: string;
+ 'container.name'?: string;
+ 'container.id'?: string;
'cloud.provider'?: string;
'cloud.region'?: string;
'cloud.availability_zone'?: string;
@@ -61,7 +48,10 @@ export interface FlyoutDoc {
'trace.id'?: string;
'agent.name'?: string;
'orchestrator.cluster.name'?: string;
+ 'orchestrator.cluster.id'?: string;
'orchestrator.resource.id'?: string;
+ 'orchestrator.namespace'?: string;
+ 'container.name'?: string;
'cloud.provider'?: string;
'cloud.region'?: string;
'cloud.availability_zone'?: string;
@@ -72,8 +62,15 @@ export interface FlyoutDoc {
'data_stream.dataset': string;
}
-export type RenderContentCustomization = (
- renderPreviousContent: RenderPreviousContent
-) => (props: Props) => React.ReactNode;
-
-export type RenderPreviousContent = (props: Props) => React.ReactNode;
+export interface ResourceFields {
+ 'host.name'?: string;
+ 'service.name'?: string;
+ 'agent.name'?: string;
+ 'orchestrator.cluster.name'?: string;
+ 'orchestrator.cluster.id'?: string;
+ 'orchestrator.resource.id'?: string;
+ 'orchestrator.namespace'?: string;
+ 'container.name'?: string;
+ 'container.id'?: string;
+ 'cloud.instance.id'?: string;
+}
diff --git a/x-pack/plugins/log_explorer/public/components/common/hover_popover.tsx b/x-pack/plugins/log_explorer/public/components/common/hover_popover.tsx
index c03830e6b6a7b..8ba78717c071a 100644
--- a/x-pack/plugins/log_explorer/public/components/common/hover_popover.tsx
+++ b/x-pack/plugins/log_explorer/public/components/common/hover_popover.tsx
@@ -5,7 +5,7 @@
* 2.0.
*/
-import React, { useRef, useState } from 'react';
+import React, { useEffect, useRef, useState } from 'react';
import { EuiPopover, EuiPopoverTitle } from '@elastic/eui';
export const HoverPopover = ({
@@ -20,10 +20,14 @@ export const HoverPopover = ({
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
const leaveTimer = useRef(null);
- const onMouseEnter = () => {
+ const clearTimer = () => {
if (leaveTimer.current) {
clearTimeout(leaveTimer.current);
}
+ };
+
+ const onMouseEnter = () => {
+ clearTimer();
setIsPopoverOpen(true);
};
@@ -31,6 +35,12 @@ export const HoverPopover = ({
leaveTimer.current = setTimeout(() => setIsPopoverOpen(false), 100);
};
+ useEffect(() => {
+ return () => {
+ clearTimer();
+ };
+ }, []);
+
return (
import('@kbn/unified-data-table/src/components/data_table_cell_value')
);
@@ -38,7 +38,7 @@ interface ChipWithPopoverProps {
*/
text: string;
dataTestSubj?: string;
- leftSideIcon?: EuiBadgeProps['iconType'];
+ leftSideIcon?: React.ReactNode;
rightSideIcon?: EuiBadgeProps['iconType'];
borderColor?: string | null;
style?: React.CSSProperties;
@@ -78,15 +78,12 @@ export function ChipWithPopover({
font-size: ${xsFontSize};
display: flex;
justify-content: center;
+ margin-top: -3px;
`}
style={style}
>
- {leftSideIcon && (
-
-
-
- )}
+ {leftSideIcon && {leftSideIcon}}
{text}
diff --git a/x-pack/plugins/log_explorer/public/components/common/translations.ts b/x-pack/plugins/log_explorer/public/components/common/translations.ts
index 176915aa47fb5..c5e3165d95cae 100644
--- a/x-pack/plugins/log_explorer/public/components/common/translations.ts
+++ b/x-pack/plugins/log_explorer/public/components/common/translations.ts
@@ -15,6 +15,10 @@ export const contentLabel = i18n.translate('xpack.logExplorer.dataTable.header.p
defaultMessage: 'Content',
});
+export const resourceLabel = i18n.translate('xpack.logExplorer.dataTable.header.popover.resource', {
+ defaultMessage: 'Resource',
+});
+
export const flyoutServiceLabel = i18n.translate('xpack.logExplorer.flyoutDetail.label.service', {
defaultMessage: 'Service',
});
@@ -211,3 +215,10 @@ export const contentHeaderTooltipParagraph2 = i18n.translate(
defaultMessage: 'When the message field is empty, one of the following is displayed',
}
);
+
+export const resourceHeaderTooltipParagraph = i18n.translate(
+ 'xpack.logExplorer.dataTable.header.resource.tooltip.paragraph',
+ {
+ defaultMessage: "Fields that provide information on the document's source, such as:",
+ }
+);
diff --git a/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_detail.tsx b/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_detail.tsx
index a16a9b638c1ad..6d696f2cfd5c1 100644
--- a/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_detail.tsx
+++ b/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_detail.tsx
@@ -6,7 +6,7 @@
*/
import React from 'react';
-import { LogExplorerFlyoutContentProps } from './types';
+import { LogExplorerFlyoutContentProps } from '../../customizations/types';
import { useDocDetail } from '../../hooks/use_doc_detail';
import { FlyoutHeader } from './flyout_header';
import { FlyoutHighlights } from './flyout_highlights';
diff --git a/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_header.tsx b/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_header.tsx
index 2f9832347c6b6..f8c34d5dd8346 100644
--- a/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_header.tsx
+++ b/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_header.tsx
@@ -15,7 +15,7 @@ import {
useGeneratedHtmlId,
EuiTitle,
} from '@elastic/eui';
-import { FlyoutDoc } from './types';
+import { FlyoutDoc } from '../../../common/document';
import { getMessageWithFallbacks } from '../../hooks/use_doc_detail';
import { LogLevel } from '../common/log_level';
import { Timestamp } from './sub_components/timestamp';
diff --git a/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_highlights.tsx b/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_highlights.tsx
index 5be6d340decd5..6ee16be2fddae 100644
--- a/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_highlights.tsx
+++ b/x-pack/plugins/log_explorer/public/components/flyout_detail/flyout_highlights.tsx
@@ -8,7 +8,7 @@ import React from 'react';
import { CloudProvider, CloudProviderIcon } from '@kbn/custom-icons';
import { useMeasure } from 'react-use/lib';
import { first } from 'lodash';
-import { FlyoutDoc, LogDocument } from './types';
+import { FlyoutDoc, LogDocument } from '../../../common/document';
import * as constants from '../../../common/constants';
import { HighlightField } from './sub_components/highlight_field';
import {
diff --git a/x-pack/plugins/log_explorer/public/components/flyout_detail/index.ts b/x-pack/plugins/log_explorer/public/components/flyout_detail/index.ts
index 4b00c914df228..78f7d3ac35c50 100644
--- a/x-pack/plugins/log_explorer/public/components/flyout_detail/index.ts
+++ b/x-pack/plugins/log_explorer/public/components/flyout_detail/index.ts
@@ -6,4 +6,3 @@
*/
export * from './flyout_detail';
-export * from './types';
diff --git a/x-pack/plugins/log_explorer/public/components/flyout_detail/sub_components/timestamp.tsx b/x-pack/plugins/log_explorer/public/components/flyout_detail/sub_components/timestamp.tsx
index 95df948c80560..fa59947ca0076 100644
--- a/x-pack/plugins/log_explorer/public/components/flyout_detail/sub_components/timestamp.tsx
+++ b/x-pack/plugins/log_explorer/public/components/flyout_detail/sub_components/timestamp.tsx
@@ -7,7 +7,7 @@
import React from 'react';
import { EuiBadge } from '@elastic/eui';
-import { FlyoutDoc } from '../types';
+import { FlyoutDoc } from '../../../../common/document';
interface TimestampProps {
timestamp: FlyoutDoc['@timestamp'];
diff --git a/x-pack/plugins/log_explorer/public/components/virtual_columns/cell_renderer.tsx b/x-pack/plugins/log_explorer/public/components/virtual_columns/cell_renderer.tsx
new file mode 100644
index 0000000000000..6728d925ca70e
--- /dev/null
+++ b/x-pack/plugins/log_explorer/public/components/virtual_columns/cell_renderer.tsx
@@ -0,0 +1,43 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+import type { DataGridCellValueElementProps } from '@kbn/unified-data-table';
+import { LogExplorerDiscoverServices } from '../../controller';
+import { VirtualColumnServiceProvider } from '../../hooks/use_virtual_column_services';
+import { CONTENT_FIELD, RESOURCE_FIELD } from '../../../common/constants';
+import { Content } from './content';
+import { Resource } from './resource';
+
+export const renderCell =
+ (type: string, { data }: { data: LogExplorerDiscoverServices['data'] }) =>
+ (props: DataGridCellValueElementProps) => {
+ const { dataView } = props;
+ const virtualColumnServices = {
+ data,
+ dataView,
+ };
+
+ let renderedCell = null;
+
+ switch (type) {
+ case CONTENT_FIELD:
+ renderedCell = ;
+ break;
+ case RESOURCE_FIELD:
+ renderedCell = ;
+ break;
+ default:
+ break;
+ }
+
+ return (
+
+ {renderedCell}
+
+ );
+ };
diff --git a/x-pack/plugins/log_explorer/public/components/virtual_columns/column.tsx b/x-pack/plugins/log_explorer/public/components/virtual_columns/column.tsx
index 79b8e0ac7ba27..9e1ad91079ace 100644
--- a/x-pack/plugins/log_explorer/public/components/virtual_columns/column.tsx
+++ b/x-pack/plugins/log_explorer/public/components/virtual_columns/column.tsx
@@ -8,7 +8,8 @@
import React from 'react';
import { CustomGridColumnProps } from '@kbn/unified-data-table';
import { ContentColumnTooltip } from './column_tooltips/content_column_tooltip';
-import { CONTENT_FIELD } from '../../../common/constants';
+import { CONTENT_FIELD, RESOURCE_FIELD } from '../../../common/constants';
+import { ResourceColumnTooltip } from './column_tooltips/resource_column_tooltip';
export const renderColumn =
(field: string) =>
@@ -17,6 +18,11 @@ export const renderColumn =
case CONTENT_FIELD:
column.display = ;
break;
+ case RESOURCE_FIELD:
+ column.display = (
+
+ );
+ break;
default:
break;
}
diff --git a/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/content_column_tooltip.tsx b/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/content_column_tooltip.tsx
index d3ba390bcff3c..a845b999400a6 100644
--- a/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/content_column_tooltip.tsx
+++ b/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/content_column_tooltip.tsx
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiToken, useEuiTheme } from '@elastic/eui';
+import { EuiText, useEuiTheme } from '@elastic/eui';
import React from 'react';
import { CustomGridColumnProps } from '@kbn/unified-data-table';
import { css } from '@emotion/react';
@@ -14,12 +14,10 @@ import {
contentHeaderTooltipParagraph2,
contentLabel,
} from '../../common/translations';
-import { dynamic } from '../../../utils/dynamic';
import { HoverPopover } from '../../common/hover_popover';
-
-const ColumnHeaderTruncateContainer = dynamic(
- () => import('@kbn/unified-data-table/src/components/column_header_truncate_container')
-);
+import { TooltipButtonComponent } from './tooltip_button';
+import { FieldWithToken } from './field_with_token';
+import * as constants from '../../../../common/constants';
export const ContentColumnTooltip = ({ column, headerRowHeight }: CustomGridColumnProps) => {
const { euiTheme } = useEuiTheme();
@@ -27,13 +25,16 @@ export const ContentColumnTooltip = ({ column, headerRowHeight }: CustomGridColu
margin-bottom: ${euiTheme.size.s};
`;
- const contentButtonComponent = (
-
- {column.displayAsText}
-
- );
return (
-
+
+ }
+ title={contentLabel}
+ >
{contentHeaderTooltipParagraph1}
@@ -41,36 +42,8 @@ export const ContentColumnTooltip = ({ column, headerRowHeight }: CustomGridColu
{contentHeaderTooltipParagraph2}
-
-
-
-
-
-
- error.message
-
-
-
-
-
-
-
-
-
- event.original
-
-
-
+
+
);
diff --git a/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/field_with_token.tsx b/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/field_with_token.tsx
new file mode 100644
index 0000000000000..045dbc1205680
--- /dev/null
+++ b/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/field_with_token.tsx
@@ -0,0 +1,43 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { EuiFlexGroup, EuiFlexItem, EuiText, EuiToken } from '@elastic/eui';
+import React from 'react';
+import { css } from '@emotion/react';
+import { euiThemeVars } from '@kbn/ui-theme';
+
+const spacingXsCss = css`
+ margin-bottom: ${euiThemeVars.euiSizeXS};
+`;
+
+export const FieldWithToken = ({
+ field,
+ iconType = 'tokenKeyword',
+}: {
+ field: string;
+ iconType?: string;
+}) => {
+ return (
+
+
+
+
+
+
+
+ {field}
+
+
+
+
+ );
+};
diff --git a/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/resource_column_tooltip.tsx b/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/resource_column_tooltip.tsx
new file mode 100644
index 0000000000000..6e6f62e274a9f
--- /dev/null
+++ b/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/resource_column_tooltip.tsx
@@ -0,0 +1,50 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+import { css } from '@emotion/react';
+import { EuiText } from '@elastic/eui';
+import type { CustomGridColumnProps } from '@kbn/unified-data-table';
+import { euiThemeVars } from '@kbn/ui-theme';
+import { resourceHeaderTooltipParagraph, resourceLabel } from '../../common/translations';
+import { HoverPopover } from '../../common/hover_popover';
+import { TooltipButtonComponent } from './tooltip_button';
+import * as constants from '../../../../common/constants';
+import { FieldWithToken } from './field_with_token';
+
+const spacingCSS = css`
+ margin-bottom: ${euiThemeVars.euiSizeS};
+`;
+
+export const ResourceColumnTooltip = ({ column, headerRowHeight }: CustomGridColumnProps) => {
+ return (
+
+ }
+ title={resourceLabel}
+ >
+
+
+ {resourceHeaderTooltipParagraph}
+
+ {[
+ constants.SERVICE_NAME_FIELD,
+ constants.CONTAINER_NAME_FIELD,
+ constants.ORCHESTRATOR_NAMESPACE_FIELD,
+ constants.HOST_NAME_FIELD,
+ constants.CLOUD_INSTANCE_ID_FIELD,
+ ].map((field) => (
+
+ ))}
+
+
+ );
+};
diff --git a/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/tooltip_button.tsx b/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/tooltip_button.tsx
new file mode 100644
index 0000000000000..3f0a688393702
--- /dev/null
+++ b/x-pack/plugins/log_explorer/public/components/virtual_columns/column_tooltips/tooltip_button.tsx
@@ -0,0 +1,22 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { EuiIcon } from '@elastic/eui';
+import React from 'react';
+import ColumnHeaderTruncateContainer from '@kbn/unified-data-table/src/components/column_header_truncate_container';
+
+export const TooltipButtonComponent = ({
+ displayText,
+ headerRowHeight,
+}: {
+ displayText?: string;
+ headerRowHeight?: number;
+}) => (
+
+ {displayText}
+
+);
diff --git a/x-pack/plugins/log_explorer/public/components/virtual_columns/content.tsx b/x-pack/plugins/log_explorer/public/components/virtual_columns/content.tsx
index 515299aac6347..569324a788505 100644
--- a/x-pack/plugins/log_explorer/public/components/virtual_columns/content.tsx
+++ b/x-pack/plugins/log_explorer/public/components/virtual_columns/content.tsx
@@ -12,11 +12,10 @@ import { getShouldShowFieldHandler } from '@kbn/discover-utils';
import { i18n } from '@kbn/i18n';
import type { DataTableRecord } from '@kbn/discover-utils/src/types';
import { useDocDetail, getMessageWithFallbacks } from '../../hooks/use_doc_detail';
-import { LogDocument, LogExplorerDiscoverServices } from '../../controller';
+import { LogDocument } from '../../../common/document';
import { LogLevel } from '../common/log_level';
import * as constants from '../../../common/constants';
import { dynamic } from '../../utils/dynamic';
-import { VirtualColumnServiceProvider } from '../../hooks/use_virtual_column_services';
import './virtual_column.scss';
const SourceDocument = dynamic(
@@ -72,7 +71,7 @@ const SourcePopoverContent = ({
);
};
-const Content = ({
+export const Content = ({
row,
dataView,
fieldFormats,
@@ -116,18 +115,3 @@ const Content = ({
);
};
-
-export const renderContent =
- ({ data }: { data: LogExplorerDiscoverServices['data'] }) =>
- (props: DataGridCellValueElementProps) => {
- const { dataView } = props;
- const virtualColumnServices = {
- data,
- dataView,
- };
- return (
-
-
-
- );
- };
diff --git a/x-pack/plugins/log_explorer/public/components/virtual_columns/resource.tsx b/x-pack/plugins/log_explorer/public/components/virtual_columns/resource.tsx
new file mode 100644
index 0000000000000..0ff1ecde45d27
--- /dev/null
+++ b/x-pack/plugins/log_explorer/public/components/virtual_columns/resource.tsx
@@ -0,0 +1,67 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+import type { DataGridCellValueElementProps } from '@kbn/unified-data-table';
+import { first } from 'lodash';
+import { AgentName } from '@kbn/elastic-agent-utils';
+import { ChipWithPopover } from '../common/popover_chip';
+import * as constants from '../../../common/constants';
+import { getUnformattedResourceFields } from '../../utils/resource';
+import { LogDocument } from '../../../common/document';
+import { dynamic } from '../../utils/dynamic';
+
+const AgentIcon = dynamic(() => import('@kbn/custom-icons/src/components/agent_icon'));
+
+export const Resource = ({ row }: DataGridCellValueElementProps) => {
+ const resourceDoc = getUnformattedResourceFields(row as LogDocument);
+ return (
+
+ {(resourceDoc[constants.SERVICE_NAME_FIELD] as string) && (
+
+ }
+ />
+ )}
+ {resourceDoc[constants.CONTAINER_NAME_FIELD] && (
+
+ )}
+ {resourceDoc[constants.HOST_NAME_FIELD] && (
+
+ )}
+ {resourceDoc[constants.ORCHESTRATOR_NAMESPACE_FIELD] && (
+
+ )}
+ {resourceDoc[constants.CLOUD_INSTANCE_ID_FIELD] && (
+
+ )}
+
+ );
+};
diff --git a/x-pack/plugins/log_explorer/public/controller/create_controller.ts b/x-pack/plugins/log_explorer/public/controller/create_controller.ts
index 53260aeb97281..84a0f94e9f348 100644
--- a/x-pack/plugins/log_explorer/public/controller/create_controller.ts
+++ b/x-pack/plugins/log_explorer/public/controller/create_controller.ts
@@ -13,7 +13,7 @@ import { interpret } from 'xstate';
import { DatasetsService } from '../services/datasets';
import { createLogExplorerControllerStateMachine } from '../state_machines/log_explorer_controller';
import { LogExplorerStartDeps } from '../types';
-import { LogExplorerCustomizations } from './controller_customizations';
+import { LogExplorerCustomizations } from '../customizations/types';
import { createDataServiceProxy } from './custom_data_service';
import { createUiSettingsServiceProxy } from './custom_ui_settings_service';
import {
diff --git a/x-pack/plugins/log_explorer/public/controller/index.ts b/x-pack/plugins/log_explorer/public/controller/index.ts
index 8c1ebbc752dbd..d35776f74ef4b 100644
--- a/x-pack/plugins/log_explorer/public/controller/index.ts
+++ b/x-pack/plugins/log_explorer/public/controller/index.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-export * from './controller_customizations';
+export * from '../customizations/types';
export * from './create_controller';
export * from './provider';
export * from './types';
diff --git a/x-pack/plugins/log_explorer/public/controller/types.ts b/x-pack/plugins/log_explorer/public/controller/types.ts
index 5947051ad2518..dcf7a9ac0e056 100644
--- a/x-pack/plugins/log_explorer/public/controller/types.ts
+++ b/x-pack/plugins/log_explorer/public/controller/types.ts
@@ -20,7 +20,7 @@ import {
LogExplorerControllerStateMachine,
LogExplorerControllerStateService,
} from '../state_machines/log_explorer_controller';
-import { LogExplorerCustomizations } from './controller_customizations';
+import { LogExplorerCustomizations } from '../customizations/types';
export interface LogExplorerController {
actions: {};
diff --git a/x-pack/plugins/log_explorer/public/customizations/custom_cell_renderer.tsx b/x-pack/plugins/log_explorer/public/customizations/custom_cell_renderer.tsx
index 8c33a55221d81..765d910ede954 100644
--- a/x-pack/plugins/log_explorer/public/customizations/custom_cell_renderer.tsx
+++ b/x-pack/plugins/log_explorer/public/customizations/custom_cell_renderer.tsx
@@ -6,11 +6,12 @@
*/
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
-import { CONTENT_FIELD } from '../../common/constants';
-import { renderContent } from '../components/virtual_columns/content';
+import { CONTENT_FIELD, RESOURCE_FIELD } from '../../common/constants';
+import { renderCell } from '../components/virtual_columns/cell_renderer';
export const createCustomCellRenderer = ({ data }: { data: DataPublicPluginStart }) => {
return {
- [CONTENT_FIELD]: renderContent({ data }),
+ [CONTENT_FIELD]: renderCell(CONTENT_FIELD, { data }),
+ [RESOURCE_FIELD]: renderCell(RESOURCE_FIELD, { data }),
};
};
diff --git a/x-pack/plugins/log_explorer/public/customizations/custom_column.tsx b/x-pack/plugins/log_explorer/public/customizations/custom_column.tsx
index e24f088affb25..1e5cba9693eb5 100644
--- a/x-pack/plugins/log_explorer/public/customizations/custom_column.tsx
+++ b/x-pack/plugins/log_explorer/public/customizations/custom_column.tsx
@@ -5,9 +5,10 @@
* 2.0.
*/
-import { CONTENT_FIELD } from '../../common/constants';
+import { CONTENT_FIELD, RESOURCE_FIELD } from '../../common/constants';
import { renderColumn } from '../components/virtual_columns/column';
export const createCustomGridColumnsConfiguration = () => ({
[CONTENT_FIELD]: renderColumn(CONTENT_FIELD),
+ [RESOURCE_FIELD]: renderColumn(RESOURCE_FIELD),
});
diff --git a/x-pack/plugins/log_explorer/public/customizations/custom_flyout_content.tsx b/x-pack/plugins/log_explorer/public/customizations/custom_flyout_content.tsx
index 73402f4aba1af..cd74ed1c4c81c 100644
--- a/x-pack/plugins/log_explorer/public/customizations/custom_flyout_content.tsx
+++ b/x-pack/plugins/log_explorer/public/customizations/custom_flyout_content.tsx
@@ -9,8 +9,9 @@ import React, { useMemo } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
import { DocViewRenderProps } from '@kbn/unified-doc-viewer/types';
import { FlyoutDetail } from '../components/flyout_detail/flyout_detail';
-import { LogExplorerFlyoutContentProps } from '../components/flyout_detail';
-import { LogDocument, useLogExplorerControllerContext } from '../controller';
+import { LogExplorerFlyoutContentProps } from './types';
+import { useLogExplorerControllerContext } from '../controller';
+import { LogDocument } from '../../common/document';
const CustomFlyoutContent = ({
filter,
diff --git a/x-pack/plugins/log_explorer/public/customizations/types.ts b/x-pack/plugins/log_explorer/public/customizations/types.ts
new file mode 100644
index 0000000000000..3eb6794f6a90c
--- /dev/null
+++ b/x-pack/plugins/log_explorer/public/customizations/types.ts
@@ -0,0 +1,32 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+import { DocViewRenderProps } from '@kbn/unified-doc-viewer/src/services/types';
+import { LogDocument } from '../../common/document';
+
+export type RenderPreviousContent = (props: Props) => React.ReactNode;
+
+export type RenderContentCustomization = (
+ renderPreviousContent: RenderPreviousContent
+) => (props: Props) => React.ReactNode;
+
+export interface LogExplorerFlyoutContentProps {
+ actions: {
+ addFilter: DocViewRenderProps['filter'];
+ addColumn: DocViewRenderProps['onAddColumn'];
+ removeColumn: DocViewRenderProps['onRemoveColumn'];
+ };
+ dataView: DocViewRenderProps['dataView'];
+ doc: LogDocument;
+}
+
+export interface LogExplorerCustomizations {
+ flyout?: {
+ renderContent?: RenderContentCustomization;
+ };
+}
diff --git a/x-pack/plugins/log_explorer/public/hooks/use_discover_action.ts b/x-pack/plugins/log_explorer/public/hooks/use_discover_action.ts
index b19afa399bb53..889d8c944672a 100644
--- a/x-pack/plugins/log_explorer/public/hooks/use_discover_action.ts
+++ b/x-pack/plugins/log_explorer/public/hooks/use_discover_action.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
import createContainer from 'constate';
-import type { LogExplorerFlyoutContentProps } from '../components/flyout_detail/types';
+import type { LogExplorerFlyoutContentProps } from '../customizations/types';
interface UseFlyoutActionsDeps {
value: LogExplorerFlyoutContentProps['actions'];
diff --git a/x-pack/plugins/log_explorer/public/hooks/use_doc_detail.ts b/x-pack/plugins/log_explorer/public/hooks/use_doc_detail.ts
index 64bb8ffd1f8dd..d128d8b5790b4 100644
--- a/x-pack/plugins/log_explorer/public/hooks/use_doc_detail.ts
+++ b/x-pack/plugins/log_explorer/public/hooks/use_doc_detail.ts
@@ -7,11 +7,8 @@
import { formatFieldValue } from '@kbn/discover-utils';
import * as constants from '../../common/constants';
import { useKibanaContextForPlugin } from '../utils/use_kibana';
-import {
- FlyoutDoc,
- LogExplorerFlyoutContentProps,
- LogDocument,
-} from '../components/flyout_detail/types';
+import { LogExplorerFlyoutContentProps } from '../customizations/types';
+import { FlyoutDoc, LogDocument } from '../../common/document';
export function useDocDetail(
doc: LogDocument,
diff --git a/x-pack/plugins/log_explorer/public/index.ts b/x-pack/plugins/log_explorer/public/index.ts
index efd337234ffc6..b7aec3f532ff4 100644
--- a/x-pack/plugins/log_explorer/public/index.ts
+++ b/x-pack/plugins/log_explorer/public/index.ts
@@ -8,14 +8,17 @@
import type { PluginInitializerContext } from '@kbn/core/public';
import type { LogExplorerConfig } from '../common/plugin_config';
import { LogExplorerPlugin } from './plugin';
+
export type {
CreateLogExplorerController,
LogExplorerController,
- LogExplorerCustomizations,
- LogExplorerFlyoutContentProps,
LogExplorerPublicState,
LogExplorerPublicStateUpdate,
} from './controller';
+export type {
+ LogExplorerCustomizations,
+ LogExplorerFlyoutContentProps,
+} from './customizations/types';
export type { LogExplorerControllerContext } from './state_machines/log_explorer_controller';
export type { LogExplorerPluginSetup, LogExplorerPluginStart } from './types';
export {
diff --git a/x-pack/plugins/log_explorer/public/utils/resource.ts b/x-pack/plugins/log_explorer/public/utils/resource.ts
new file mode 100644
index 0000000000000..11123d8030481
--- /dev/null
+++ b/x-pack/plugins/log_explorer/public/utils/resource.ts
@@ -0,0 +1,40 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { LogDocument, ResourceFields } from '../../common/document';
+import * as constants from '../../common/constants';
+
+type Field = keyof LogDocument['flattened'];
+
+const getFieldFromDoc = (doc: LogDocument, field: T) => {
+ const fieldValueArray = doc.flattened[field];
+ return fieldValueArray && fieldValueArray.length ? fieldValueArray[0] : undefined;
+};
+
+export const getUnformattedResourceFields = (doc: LogDocument): ResourceFields => {
+ const serviceName = getFieldFromDoc(doc, constants.SERVICE_NAME_FIELD);
+ const hostName = getFieldFromDoc(doc, constants.HOST_NAME_FIELD);
+ const agentName = getFieldFromDoc(doc, constants.AGENT_NAME_FIELD);
+ const orchestratorClusterName = getFieldFromDoc(doc, constants.ORCHESTRATOR_CLUSTER_NAME_FIELD);
+ const orchestratorResourceId = getFieldFromDoc(doc, constants.ORCHESTRATOR_RESOURCE_ID_FIELD);
+ const orchestratorNamespace = getFieldFromDoc(doc, constants.ORCHESTRATOR_NAMESPACE_FIELD);
+ const containerName = getFieldFromDoc(doc, constants.CONTAINER_NAME_FIELD);
+ const containerId = getFieldFromDoc(doc, constants.CONTAINER_ID_FIELD);
+ const cloudInstanceId = getFieldFromDoc(doc, constants.CLOUD_INSTANCE_ID_FIELD);
+
+ return {
+ [constants.SERVICE_NAME_FIELD]: serviceName,
+ [constants.HOST_NAME_FIELD]: hostName,
+ [constants.AGENT_NAME_FIELD]: agentName,
+ [constants.ORCHESTRATOR_CLUSTER_NAME_FIELD]: orchestratorClusterName,
+ [constants.ORCHESTRATOR_RESOURCE_ID_FIELD]: orchestratorResourceId,
+ [constants.ORCHESTRATOR_NAMESPACE_FIELD]: orchestratorNamespace,
+ [constants.CONTAINER_NAME_FIELD]: containerName,
+ [constants.CONTAINER_ID_FIELD]: containerId,
+ [constants.CLOUD_INSTANCE_ID_FIELD]: cloudInstanceId,
+ };
+};
diff --git a/x-pack/plugins/log_explorer/tsconfig.json b/x-pack/plugins/log_explorer/tsconfig.json
index 5a5ce9cb0e78d..69395d75f5b59 100644
--- a/x-pack/plugins/log_explorer/tsconfig.json
+++ b/x-pack/plugins/log_explorer/tsconfig.json
@@ -41,6 +41,8 @@
"@kbn/unified-field-list",
"@kbn/unified-search-plugin",
"@kbn/xstate-utils",
+ "@kbn/elastic-agent-utils",
+ "@kbn/ui-theme",
],
"exclude": [
"target/**/*"
diff --git a/x-pack/plugins/maps/public/legacy_visualizations/is_legacy_map.ts b/x-pack/plugins/maps/public/legacy_visualizations/is_legacy_map.ts
index 2a5fc483027e7..93a74b2adc1ea 100644
--- a/x-pack/plugins/maps/public/legacy_visualizations/is_legacy_map.ts
+++ b/x-pack/plugins/maps/public/legacy_visualizations/is_legacy_map.ts
@@ -5,8 +5,10 @@
* 2.0.
*/
+import type { HasType } from '@kbn/presentation-publishing';
import { Embeddable } from '@kbn/embeddable-plugin/public';
-import type { VisualizeEmbeddable } from '@kbn/visualizations-plugin/public';
+import type { HasVisualizeConfig, VisualizeEmbeddable } from '@kbn/visualizations-plugin/public';
+import { apiHasVisualizeConfig } from '@kbn/visualizations-plugin/public';
export function isLegacyMap(embeddable: Embeddable) {
return (
@@ -15,3 +17,12 @@ export function isLegacyMap(embeddable: Embeddable) {
['region_map', 'tile_map'].includes((embeddable as VisualizeEmbeddable).getVis()?.type?.name)
);
}
+
+type LegacyMapApi = HasType & Partial;
+
+export function isLegacyMapApi(api: LegacyMapApi) {
+ if (api.type !== 'visualization' || !apiHasVisualizeConfig(api)) {
+ return false;
+ }
+ return ['region_map', 'tile_map'].includes(api.getVis().type?.name);
+}
diff --git a/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent/action.ts b/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent/action.ts
index 5e21c28d69fe1..5bd55e65b6fe0 100644
--- a/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent/action.ts
+++ b/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent/action.ts
@@ -6,14 +6,19 @@
*/
import { i18n } from '@kbn/i18n';
-import type { Embeddable } from '@kbn/embeddable-plugin/public';
+import { type EmbeddableApiContext, apiHasType } from '@kbn/presentation-publishing';
import { createAction } from '@kbn/ui-actions-plugin/public';
-import type { FilterByMapExtentActionContext, FilterByMapExtentInput } from './types';
+import { type FilterByMapExtentActionApi } from './types';
+import { MAP_SAVED_OBJECT_TYPE } from '../../../common/constants';
+import { isLegacyMapApi } from '../../legacy_visualizations/is_legacy_map';
export const FILTER_BY_MAP_EXTENT = 'FILTER_BY_MAP_EXTENT';
-function getContainerLabel(embeddable: Embeddable) {
- return embeddable.parent?.type === 'dashboard'
+export const isApiCompatible = (api: unknown | null): api is FilterByMapExtentActionApi =>
+ Boolean(apiHasType(api));
+
+function getContainerLabel(api: FilterByMapExtentActionApi | unknown) {
+ return isApiCompatible(api) && api.parentApi?.type === 'dashboard'
? i18n.translate('xpack.maps.filterByMapExtentMenuItem.dashboardLabel', {
defaultMessage: 'dashboard',
})
@@ -22,36 +27,38 @@ function getContainerLabel(embeddable: Embeddable) {
});
}
-function getDisplayName(embeddable: Embeddable) {
+function getDisplayName(api: FilterByMapExtentActionApi | unknown) {
return i18n.translate('xpack.maps.filterByMapExtentMenuItem.displayName', {
defaultMessage: 'Filter {containerLabel} by map bounds',
- values: { containerLabel: getContainerLabel(embeddable) },
+ values: { containerLabel: getContainerLabel(api) },
});
}
-export const filterByMapExtentAction = createAction({
+export const filterByMapExtentAction = createAction({
id: FILTER_BY_MAP_EXTENT,
type: FILTER_BY_MAP_EXTENT,
order: 20,
- getDisplayName: (context: FilterByMapExtentActionContext) => {
- return getDisplayName(context.embeddable);
+ getDisplayName: ({ embeddable }: EmbeddableApiContext) => {
+ return getDisplayName(embeddable);
},
- getDisplayNameTooltip: (context: FilterByMapExtentActionContext) => {
+ getDisplayNameTooltip: ({ embeddable }: EmbeddableApiContext) => {
return i18n.translate('xpack.maps.filterByMapExtentMenuItem.displayNameTooltip', {
defaultMessage:
'As you zoom and pan the map, the {containerLabel} updates to display only the data visible in the map bounds.',
- values: { containerLabel: getContainerLabel(context.embeddable) },
+ values: { containerLabel: getContainerLabel(embeddable) },
});
},
getIconType: () => {
return 'filter';
},
- isCompatible: async (context: FilterByMapExtentActionContext) => {
- const { isCompatible } = await import('./is_compatible');
- return isCompatible(context);
+ isCompatible: async ({ embeddable }: EmbeddableApiContext) => {
+ if (!isApiCompatible(embeddable)) return false;
+ return embeddable.disableTriggers
+ ? false
+ : embeddable.type === MAP_SAVED_OBJECT_TYPE || isLegacyMapApi(embeddable);
},
- execute: async (context: FilterByMapExtentActionContext) => {
+ execute: async ({ embeddable }: EmbeddableApiContext) => {
const { openModal } = await import('./modal');
- openModal(getDisplayName(context.embeddable));
+ openModal(getDisplayName(embeddable));
},
});
diff --git a/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent/is_compatible.ts b/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent/is_compatible.ts
deleted file mode 100644
index 32892b6fdc18b..0000000000000
--- a/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent/is_compatible.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { MAP_SAVED_OBJECT_TYPE } from '../../../common/constants';
-import { isLegacyMap } from '../../legacy_visualizations/is_legacy_map';
-import type { FilterByMapExtentActionContext } from './types';
-
-export function isCompatible({ embeddable }: FilterByMapExtentActionContext) {
- return (
- (embeddable.type === MAP_SAVED_OBJECT_TYPE || isLegacyMap(embeddable)) &&
- !embeddable.getInput().disableTriggers
- );
-}
diff --git a/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent/types.ts b/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent/types.ts
index 5587588b60730..b5de10937c3d4 100644
--- a/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent/types.ts
+++ b/x-pack/plugins/maps/public/trigger_actions/filter_by_map_extent/types.ts
@@ -5,12 +5,8 @@
* 2.0.
*/
-import type { Embeddable, EmbeddableInput } from '@kbn/embeddable-plugin/public';
+import type { HasDisableTriggers, HasParentApi, HasType } from '@kbn/presentation-publishing';
+import type { HasVisualizeConfig } from '@kbn/visualizations-plugin/public';
-export interface FilterByMapExtentInput extends EmbeddableInput {
- filterByMapExtent: boolean;
-}
-
-export interface FilterByMapExtentActionContext {
- embeddable: Embeddable;
-}
+export type FilterByMapExtentActionApi = HasType &
+ Partial & HasVisualizeConfig>;
diff --git a/x-pack/plugins/maps/tsconfig.json b/x-pack/plugins/maps/tsconfig.json
index f85d237b6d890..3139e90e20311 100644
--- a/x-pack/plugins/maps/tsconfig.json
+++ b/x-pack/plugins/maps/tsconfig.json
@@ -83,6 +83,7 @@
"@kbn/es-types",
"@kbn/data-service",
"@kbn/code-editor",
+ "@kbn/presentation-publishing",
],
"exclude": [
"target/**/*",
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/cpu_charts.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/cpu_charts.ts
index 307db0766accf..302ab3684f190 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/cpu_charts.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/cpu_charts.ts
@@ -6,30 +6,23 @@
*/
import { i18n } from '@kbn/i18n';
-import type { StaticValueConfig, XYChartModel } from '@kbn/lens-embeddable-utils';
+import type { LensConfigWithId } from '../../../types';
import { formulas } from '../formulas';
import type { ChartArgs } from './types';
-export const REFERENCE_LINE: StaticValueConfig = {
- value: '1',
- format: {
- id: 'percent',
- params: {
- decimals: 0,
- },
- },
- color: '#6092c0',
-};
-
export const cpuUsageBreakdown = {
- get: ({ dataView }: ChartArgs): XYChartModel => ({
+ get: ({ dataViewId }: ChartArgs): LensConfigWithId => ({
id: 'cpuUsageBreakdown',
+ chartType: 'xy',
title: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.cpuUsage', {
defaultMessage: 'CPU Usage',
}),
layers: [
{
- data: [
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [
formulas.cpuUsageIowait,
formulas.cpuUsageIrq,
formulas.cpuUsageNice,
@@ -38,48 +31,28 @@ export const cpuUsageBreakdown = {
formulas.cpuUsageUser,
formulas.cpuUsageSystem,
],
- options: {
- seriesType: 'area_stacked',
- },
- layerType: 'data',
- },
- ],
- visualizationType: 'lnsXY',
- dataView,
- }),
-};
-
-export const normalizedLoad1m = {
- get: ({ dataView }: ChartArgs): XYChartModel => ({
- id: 'normalizedLoad1m',
- title: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.normalizedLoad1m', {
- defaultMessage: 'Normalized Load',
- }),
- layers: [
- { data: [formulas.normalizedLoad1m], layerType: 'data' },
- { data: [REFERENCE_LINE], layerType: 'referenceLine' },
- ],
- visualizationType: 'lnsXY',
- dataView,
- }),
-};
-
-export const loadBreakdown = {
- get: ({ dataView }: ChartArgs): XYChartModel => ({
- id: 'loadBreakdown',
- title: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.load', {
- defaultMessage: 'Load',
- }),
- layers: [
- {
- data: [formulas.load1m, formulas.load5m, formulas.load15m],
- options: {
- seriesType: 'area',
- },
- layerType: 'data',
},
],
- visualizationType: 'lnsXY',
- dataView,
+ fittingFunction: 'Linear',
+ legend: {
+ position: 'bottom',
+ show: true,
+ },
+ yBounds: {
+ mode: 'custom',
+ lowerBound: 0,
+ upperBound: 1,
+ },
+ axisTitleVisibility: {
+ showXAxisTitle: false,
+ showYAxisTitle: false,
+ },
+ ...(dataViewId
+ ? {
+ dataset: {
+ index: dataViewId,
+ },
+ }
+ : {}),
}),
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/disk_charts.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/disk_charts.ts
index 53f2c3e8ea505..4b6fa2b3c80d7 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/disk_charts.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/disk_charts.ts
@@ -6,21 +6,23 @@
*/
import { i18n } from '@kbn/i18n';
-import type { XYChartModel } from '@kbn/lens-embeddable-utils';
+import type { LensConfigWithId } from '../../../types';
import { formulas } from '../formulas';
import type { ChartArgs } from './types';
-const TOP_VALUES_SIZE = 5;
-
export const diskSpaceUsageAvailable = {
- get: ({ dataView }: ChartArgs): XYChartModel => ({
+ get: ({ dataViewId }: ChartArgs): LensConfigWithId => ({
id: 'diskSpaceUsageAvailable',
+ chartType: 'xy',
title: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.diskUsage', {
defaultMessage: 'Disk Usage',
}),
layers: [
{
- data: [
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [
{
...formulas.diskUsage,
label: i18n.translate(
@@ -40,26 +42,50 @@ export const diskSpaceUsageAvailable = {
),
},
],
- options: {
- seriesType: 'area',
- },
- layerType: 'data',
},
],
- visualizationType: 'lnsXY',
- dataView,
+ fittingFunction: 'Linear',
+ legend: {
+ show: true,
+ position: 'bottom',
+ },
+ yBounds: {
+ mode: 'custom',
+ lowerBound: 0,
+ upperBound: 1,
+ },
+ axisTitleVisibility: {
+ showXAxisTitle: false,
+ showYAxisTitle: false,
+ },
+ ...(dataViewId
+ ? {
+ dataset: {
+ index: dataViewId,
+ },
+ }
+ : {}),
}),
};
export const diskUsageByMountPoint = {
- get: ({ dataView }: ChartArgs): XYChartModel => ({
+ get: ({ dataViewId }: ChartArgs): LensConfigWithId => ({
id: 'DiskUsageByMountPoint',
+ chartType: 'xy',
title: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.diskUsageByMountingPoint', {
defaultMessage: 'Disk Usage by Mount Point',
}),
layers: [
{
- data: [
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ breakdown: {
+ type: 'topValues',
+ field: 'system.filesystem.mount_point',
+ size: 5,
+ },
+ yAxis: [
{
...formulas.diskUsage,
label: i18n.translate(
@@ -70,44 +96,44 @@ export const diskUsageByMountPoint = {
),
},
],
- options: {
- seriesType: 'area',
- breakdown: {
- type: 'top_values',
- field: 'system.filesystem.mount_point',
- params: {
- size: TOP_VALUES_SIZE,
- },
- },
- },
- layerType: 'data',
},
],
- visualOptions: {
- legend: {
- isVisible: true,
- position: 'bottom',
- legendSize: 50 as any,
- },
- yLeftExtent: {
- mode: 'dataBounds',
- lowerBound: 0,
- upperBound: 1,
- },
+ fittingFunction: 'Linear',
+ legend: {
+ show: true,
+ position: 'bottom',
},
- visualizationType: 'lnsXY',
- dataView,
+ yBounds: {
+ mode: 'custom',
+ lowerBound: 0,
+ upperBound: 1,
+ },
+ axisTitleVisibility: {
+ showXAxisTitle: false,
+ showYAxisTitle: false,
+ },
+ ...(dataViewId
+ ? {
+ dataset: {
+ index: dataViewId,
+ },
+ }
+ : {}),
}),
};
export const diskThroughputReadWrite = {
- get: ({ dataView }: ChartArgs): XYChartModel => ({
+ get: ({ dataViewId }: ChartArgs): LensConfigWithId => ({
id: 'diskThroughputReadWrite',
+ chartType: 'xy',
title: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.diskIOPS', {
defaultMessage: 'Disk IOPS',
}),
layers: [
{
- data: [
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [
{
...formulas.diskIORead,
label: i18n.translate(
@@ -127,33 +153,40 @@ export const diskThroughputReadWrite = {
),
},
],
- options: {
- seriesType: 'area',
- },
- layerType: 'data',
},
],
- visualOptions: {
- yLeftExtent: {
- mode: 'dataBounds',
- lowerBound: 0,
- upperBound: 1,
- },
+ fittingFunction: 'Linear',
+ legend: {
+ show: true,
+ position: 'bottom',
+ },
+ axisTitleVisibility: {
+ showXAxisTitle: false,
+ showYAxisTitle: false,
},
- visualizationType: 'lnsXY',
- dataView,
+ ...(dataViewId
+ ? {
+ dataset: {
+ index: dataViewId,
+ },
+ }
+ : {}),
}),
};
export const diskIOReadWrite = {
- get: ({ dataView }: ChartArgs): XYChartModel => ({
+ get: ({ dataViewId }: ChartArgs): LensConfigWithId => ({
id: 'diskIOReadWrite',
+ chartType: 'xy',
title: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.diskThroughput', {
defaultMessage: 'Disk Throughput',
}),
layers: [
{
- data: [
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [
{
...formulas.diskReadThroughput,
label: i18n.translate(
@@ -173,20 +206,23 @@ export const diskIOReadWrite = {
),
},
],
- options: {
- seriesType: 'area',
- },
- layerType: 'data',
},
],
- visualOptions: {
- yLeftExtent: {
- mode: 'dataBounds',
- lowerBound: 0,
- upperBound: 1,
- },
+ fittingFunction: 'Linear',
+ legend: {
+ show: true,
+ position: 'bottom',
},
- visualizationType: 'lnsXY',
- dataView,
+ axisTitleVisibility: {
+ showXAxisTitle: false,
+ showYAxisTitle: false,
+ },
+ ...(dataViewId
+ ? {
+ dataset: {
+ index: dataViewId,
+ },
+ }
+ : {}),
}),
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/index.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/index.ts
index 1f0a3947e4617..dc1a99819359b 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/index.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/index.ts
@@ -5,63 +5,93 @@
* 2.0.
*/
-import {
- type ChartModel,
- type XYChartModel,
- type MetricChartModel,
- type XYLayerOptions,
- type MetricLayerOptions,
- type ChartTypes,
- type XYVisualOptions,
- XY_ID,
-} from '@kbn/lens-embeddable-utils';
+import type { ChartType, ChartTypeLensConfig } from '@kbn/lens-embeddable-utils/config_builder';
+import { LensConfigWithId } from '../../../types';
import type { HostFormulaNames } from '../formulas';
import { formulas } from '../formulas';
-type ChartByFormula = Record<
- HostFormulaNames,
- TType extends typeof XY_ID ? XYChartModel : MetricChartModel
->;
+type CustomLensConfig = { id: string } & ChartTypeLensConfig;
-type BaseArgs = Pick & {
- formulaIds: HostFormulaNames[];
- visualizationType: TType;
- layerOptions?: TType extends typeof XY_ID ? XYLayerOptions : MetricLayerOptions;
- visualOptions?: TType extends typeof XY_ID ? XYVisualOptions : never;
-};
-
-export const createBasicCharts = ({
- formulaIds,
- visualizationType,
- dataView,
- layerOptions,
- ...rest
-}: BaseArgs): ChartByFormula => {
- return formulaIds.reduce((acc, curr) => {
- const layers = {
- data: visualizationType === XY_ID ? [formulas[curr]] : formulas[curr],
- layerType: visualizationType === XY_ID ? 'data' : 'metricTrendline',
- options: layerOptions,
- };
+type Args = T extends 'xy'
+ ? Omit>, 'layers' | 'chartType' | 'dataset'> & {
+ layerConfig?: Partial['layers'][number]>;
+ }
+ : Omit>, 'value' | 'chartType' | 'dataset'>;
- const chartModel = {
+export const createBasicCharts = ({
+ chartType,
+ fromFormulas,
+ chartConfig,
+ dataViewId,
+}: {
+ chartType: T;
+ fromFormulas: HostFormulaNames[];
+ chartConfig?: Args;
+ dataViewId?: string;
+}): Record> => {
+ return fromFormulas.reduce((acc, curr) => {
+ const baseConfig = {
+ ...chartConfig,
id: curr,
- title: formulas[curr].label,
- dataView,
- visualizationType,
- layers: visualizationType === XY_ID ? [layers] : layers,
- ...rest,
- } as TType extends typeof XY_ID ? XYChartModel : MetricChartModel;
+ title: formulas[curr].label ?? chartConfig?.title ?? '',
+ ...(dataViewId
+ ? {
+ dataset: {
+ index: dataViewId,
+ },
+ }
+ : {}),
+ } as LensConfigWithId;
+
+ if (chartType === 'xy') {
+ const {
+ layerConfig,
+ legend,
+ fittingFunction = 'Linear',
+ ...xyConfig
+ } = baseConfig as Args<'xy'>;
+ return {
+ ...acc,
+ [curr]: {
+ ...xyConfig,
+ chartType,
+ legend: {
+ show: false,
+ position: 'bottom',
+ ...legend,
+ },
+ axisTitleVisibility: {
+ showXAxisTitle: false,
+ showYAxisTitle: false,
+ },
+ fittingFunction,
+ layers: [
+ {
+ seriesType: 'line',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [formulas[curr]],
+ ...layerConfig,
+ },
+ ],
+ } as CustomLensConfig<'xy'>,
+ };
+ }
return {
...acc,
- [curr]: chartModel,
+ [curr]: {
+ ...baseConfig,
+ ...formulas[curr],
+ chartType,
+ },
};
- }, {} as ChartByFormula);
+ }, {} as Record>);
};
// custom charts
-export { cpuUsageBreakdown, normalizedLoad1m, loadBreakdown } from './cpu_charts';
+export { cpuUsageBreakdown } from './cpu_charts';
+export { loadBreakdown } from './load_charts';
export {
diskIOReadWrite,
diskSpaceUsageAvailable,
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/load_charts.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/load_charts.ts
new file mode 100644
index 0000000000000..9603aa676009c
--- /dev/null
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/load_charts.ts
@@ -0,0 +1,45 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { i18n } from '@kbn/i18n';
+import type { LensConfigWithId } from '../../../types';
+import { formulas } from '../formulas';
+import type { ChartArgs } from './types';
+
+export const loadBreakdown = {
+ get: ({ dataViewId }: ChartArgs): LensConfigWithId => ({
+ id: 'loadBreakdown',
+ chartType: 'xy',
+ title: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.load', {
+ defaultMessage: 'Load',
+ }),
+ layers: [
+ {
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [formulas.load1m, formulas.load5m, formulas.load15m],
+ },
+ ],
+ fittingFunction: 'Linear',
+ legend: {
+ position: 'bottom',
+ show: true,
+ },
+ axisTitleVisibility: {
+ showXAxisTitle: false,
+ showYAxisTitle: false,
+ },
+ ...(dataViewId
+ ? {
+ dataset: {
+ index: dataViewId,
+ },
+ }
+ : {}),
+ }),
+};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/memory_charts.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/memory_charts.ts
index 95c30fcdb18e6..e68a1a4fa44bb 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/memory_charts.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/memory_charts.ts
@@ -6,19 +6,23 @@
*/
import { i18n } from '@kbn/i18n';
-import type { XYChartModel } from '@kbn/lens-embeddable-utils';
+import type { LensConfigWithId } from '../../../types';
import { formulas } from '../formulas';
import type { ChartArgs } from './types';
export const memoryUsageBreakdown = {
- get: ({ dataView }: ChartArgs): XYChartModel => ({
+ get: ({ dataViewId }: ChartArgs): LensConfigWithId => ({
id: 'memoryUsageBreakdown',
+ chartType: 'xy',
title: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.memoryUsage', {
defaultMessage: 'Memory Usage',
}),
layers: [
{
- data: [
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [
{
...formulas.memoryCache,
label: i18n.translate(
@@ -47,25 +51,23 @@ export const memoryUsageBreakdown = {
),
},
],
- options: {
- seriesType: 'area_stacked',
- },
- layerType: 'data',
},
],
- visualOptions: {
- legend: {
- isVisible: true,
- position: 'bottom',
- legendSize: 50 as any,
- },
- yLeftExtent: {
- mode: 'dataBounds',
- lowerBound: 0,
- upperBound: 1,
- },
+ fittingFunction: 'Linear',
+ legend: {
+ position: 'bottom',
+ show: true,
},
- visualizationType: 'lnsXY',
- dataView,
+ axisTitleVisibility: {
+ showXAxisTitle: false,
+ showYAxisTitle: false,
+ },
+ ...(dataViewId
+ ? {
+ dataset: {
+ index: dataViewId,
+ },
+ }
+ : {}),
}),
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/network_charts.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/network_charts.ts
index 5181b5b075765..1cfbc25b1a869 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/network_charts.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/network_charts.ts
@@ -6,19 +6,23 @@
*/
import { i18n } from '@kbn/i18n';
-import type { XYChartModel } from '@kbn/lens-embeddable-utils';
+import type { LensConfigWithId } from '../../../types';
import { formulas } from '../formulas';
import type { ChartArgs } from './types';
export const rxTx = {
- get: ({ dataView }: ChartArgs): XYChartModel => ({
+ get: ({ dataViewId }: ChartArgs): LensConfigWithId => ({
id: 'rxTx',
+ chartType: 'xy',
title: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.network', {
defaultMessage: 'Network',
}),
layers: [
{
- data: [
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [
{
...formulas.rx,
label: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.network.label.rx', {
@@ -32,21 +36,23 @@ export const rxTx = {
}),
},
],
- options: {
- seriesType: 'area',
- },
-
- layerType: 'data',
},
],
- visualOptions: {
- yLeftExtent: {
- mode: 'dataBounds',
- lowerBound: 0,
- upperBound: 1,
- },
+ fittingFunction: 'Linear',
+ legend: {
+ show: true,
+ position: 'bottom',
},
- visualizationType: 'lnsXY',
- dataView,
+ axisTitleVisibility: {
+ showXAxisTitle: false,
+ showYAxisTitle: false,
+ },
+ ...(dataViewId
+ ? {
+ dataset: {
+ index: dataViewId,
+ },
+ }
+ : {}),
}),
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/types.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/types.ts
index f3634648b4fdb..ab0857284c35b 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/types.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/charts/types.ts
@@ -5,8 +5,6 @@
* 2.0.
*/
-import { DataView } from '@kbn/data-views-plugin/common';
-
export interface ChartArgs {
- dataView?: DataView;
+ dataViewId?: string;
}
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details.ts
index c6fc7c1cdc9aa..db626b567feb6 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details.ts
@@ -4,8 +4,6 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { DataView } from '@kbn/data-views-plugin/common';
-import type { XYVisualOptions } from '@kbn/lens-embeddable-utils';
import { createDashboardModel } from '../../../create_dashboard_model';
import {
createBasicCharts,
@@ -21,76 +19,52 @@ import {
export const assetDetails = {
get: ({
- metricsDataView,
- logsDataView,
+ metricsDataViewId,
+ logsDataViewId,
}: {
- metricsDataView?: DataView;
- logsDataView?: DataView;
+ metricsDataViewId?: string;
+ logsDataViewId?: string;
}) => {
- const commonVisualOptions: XYVisualOptions = {
- showDottedLine: true,
- missingValues: 'Linear',
- };
-
- const legend: XYVisualOptions = {
- legend: {
- isVisible: true,
- position: 'bottom',
+ const { cpuUsage, memoryUsage } = createBasicCharts({
+ chartType: 'xy',
+ fromFormulas: ['cpuUsage', 'memoryUsage'],
+ chartConfig: {
+ yBounds: {
+ mode: 'custom',
+ lowerBound: 0,
+ upperBound: 1,
+ },
},
- };
+ dataViewId: metricsDataViewId,
+ });
- const { cpuUsage, memoryUsage, normalizedLoad1m } = createBasicCharts({
- visualizationType: 'lnsXY',
- formulaIds: ['cpuUsage', 'memoryUsage', 'normalizedLoad1m'],
- dataView: metricsDataView,
- visualOptions: commonVisualOptions,
+ const { normalizedLoad1m } = createBasicCharts({
+ chartType: 'xy',
+ fromFormulas: ['normalizedLoad1m'],
+ dataViewId: metricsDataViewId,
});
+ normalizedLoad1m.layers.push({ type: 'reference', yAxis: [{ value: '1' }] });
const { logRate } = createBasicCharts({
- visualizationType: 'lnsXY',
- formulaIds: ['logRate'],
- dataView: logsDataView,
- visualOptions: commonVisualOptions,
+ chartType: 'xy',
+ fromFormulas: ['logRate'],
+ dataViewId: logsDataViewId,
});
return createDashboardModel({
charts: [
cpuUsage,
- {
- ...cpuUsageBreakdown.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
+ cpuUsageBreakdown.get({ dataViewId: metricsDataViewId }),
memoryUsage,
- {
- ...memoryUsageBreakdown.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
+ memoryUsageBreakdown.get({ dataViewId: metricsDataViewId }),
normalizedLoad1m,
- {
- ...loadBreakdown.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
+ loadBreakdown.get({ dataViewId: metricsDataViewId }),
logRate,
- {
- ...diskSpaceUsageAvailable.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
- {
- ...diskUsageByMountPoint.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
- {
- ...diskThroughputReadWrite.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
- {
- ...diskIOReadWrite.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
- {
- ...rxTx.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
+ diskSpaceUsageAvailable.get({ dataViewId: metricsDataViewId }),
+ diskUsageByMountPoint.get({ dataViewId: metricsDataViewId }),
+ diskThroughputReadWrite.get({ dataViewId: metricsDataViewId }),
+ diskIOReadWrite.get({ dataViewId: metricsDataViewId }),
+ rxTx.get({ dataViewId: metricsDataViewId }),
],
});
},
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details_flyout.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details_flyout.ts
index 96436e3d00f41..ee1d25c7a1da9 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details_flyout.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details_flyout.ts
@@ -4,8 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { DataView } from '@kbn/data-views-plugin/common';
-import type { XYVisualOptions } from '@kbn/lens-embeddable-utils';
+
import { createDashboardModel } from '../../../create_dashboard_model';
import {
createBasicCharts,
@@ -18,36 +17,36 @@ import {
export const assetDetailsFlyout = {
get: ({
- metricsDataView,
- logsDataView,
+ metricsDataViewId,
+ logsDataViewId,
}: {
- metricsDataView?: DataView;
- logsDataView?: DataView;
+ metricsDataViewId?: string;
+ logsDataViewId?: string;
}) => {
- const commonVisualOptions: XYVisualOptions = {
- showDottedLine: true,
- missingValues: 'Linear',
- };
-
- const legend: XYVisualOptions = {
- legend: {
- isVisible: true,
- position: 'bottom',
+ const { cpuUsage, memoryUsage } = createBasicCharts({
+ chartType: 'xy',
+ fromFormulas: ['cpuUsage', 'memoryUsage'],
+ chartConfig: {
+ yBounds: {
+ mode: 'custom',
+ lowerBound: 0,
+ upperBound: 1,
+ },
},
- };
+ dataViewId: metricsDataViewId,
+ });
- const { cpuUsage, memoryUsage, normalizedLoad1m } = createBasicCharts({
- visualizationType: 'lnsXY',
- formulaIds: ['cpuUsage', 'memoryUsage', 'normalizedLoad1m'],
- dataView: metricsDataView,
- visualOptions: commonVisualOptions,
+ const { normalizedLoad1m } = createBasicCharts({
+ chartType: 'xy',
+ fromFormulas: ['normalizedLoad1m'],
+ dataViewId: metricsDataViewId,
});
+ normalizedLoad1m.layers.push({ type: 'reference', yAxis: [{ value: '1' }] });
const { logRate } = createBasicCharts({
- visualizationType: 'lnsXY',
- formulaIds: ['logRate'],
- dataView: logsDataView,
- visualOptions: commonVisualOptions,
+ chartType: 'xy',
+ fromFormulas: ['logRate'],
+ dataViewId: logsDataViewId,
});
return createDashboardModel({
@@ -56,26 +55,11 @@ export const assetDetailsFlyout = {
memoryUsage,
normalizedLoad1m,
logRate,
- {
- ...diskSpaceUsageAvailable.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
- {
- ...diskUsageByMountPoint.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
- {
- ...diskThroughputReadWrite.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
- {
- ...diskIOReadWrite.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
- {
- ...rxTx.get({ dataView: metricsDataView }),
- visualOptions: { ...commonVisualOptions, ...legend },
- },
+ diskSpaceUsageAvailable.get({ dataViewId: metricsDataViewId }),
+ diskUsageByMountPoint.get({ dataViewId: metricsDataViewId }),
+ diskThroughputReadWrite.get({ dataViewId: metricsDataViewId }),
+ diskIOReadWrite.get({ dataViewId: metricsDataViewId }),
+ rxTx.get({ dataViewId: metricsDataViewId }),
],
});
},
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details_kubernetes_node.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details_kubernetes_node.ts
index cd9dd1591f35e..4ab25b54fe9f2 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details_kubernetes_node.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/asset_details_kubernetes_node.ts
@@ -4,21 +4,30 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { DataView } from '@kbn/data-views-plugin/common';
import { i18n } from '@kbn/i18n';
-import type { XYVisualOptions } from '@kbn/lens-embeddable-utils';
+import type { LensXYConfigBase } from '@kbn/lens-embeddable-utils/config_builder';
import { createDashboardModel } from '../../../create_dashboard_model';
import { formulas } from '../../../kubernetes/node/metrics';
export const assetDetailsKubernetesNode = {
- get: ({ metricsDataView }: { metricsDataView?: DataView }) => {
- const commonVisualOptions: XYVisualOptions = {
- showDottedLine: true,
- missingValues: 'Linear',
+ get: ({ metricsDataViewId }: { metricsDataViewId?: string }) => {
+ const baseConfig: Partial = {
+ fittingFunction: 'Linear',
+ axisTitleVisibility: {
+ showXAxisTitle: false,
+ showYAxisTitle: false,
+ },
legend: {
- isVisible: true,
+ show: true,
position: 'bottom',
},
+ ...(metricsDataViewId
+ ? {
+ dataset: {
+ index: metricsDataViewId,
+ },
+ }
+ : {}),
};
return createDashboardModel({
@@ -26,6 +35,7 @@ export const assetDetailsKubernetesNode = {
charts: [
{
id: 'nodeCpuCapacity',
+ chartType: 'xy',
title: i18n.translate(
'xpack.metricsData.assetDetails.metricsCharts.kubernetes.nodeCpuCapacity',
{
@@ -34,19 +44,17 @@ export const assetDetailsKubernetesNode = {
),
layers: [
{
- data: [formulas.nodeCpuCapacity, formulas.nodeCpuUsed],
- options: {
- seriesType: 'area',
- },
- layerType: 'data',
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [formulas.nodeCpuCapacity, formulas.nodeCpuUsed],
},
],
- dataView: metricsDataView,
- visualizationType: 'lnsXY',
- visualOptions: commonVisualOptions,
+ ...baseConfig,
},
{
id: 'nodeMemoryCapacity',
+ chartType: 'xy',
title: i18n.translate(
'xpack.metricsData.assetDetails.metricsCharts.kubernetes.nodeMemoryCapacity',
{
@@ -55,19 +63,17 @@ export const assetDetailsKubernetesNode = {
),
layers: [
{
- data: [formulas.nodeMemoryCapacity, formulas.nodeMemoryUsed],
- options: {
- seriesType: 'area',
- },
- layerType: 'data',
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [formulas.nodeMemoryCapacity, formulas.nodeMemoryUsed],
},
],
- visualizationType: 'lnsXY',
- dataView: metricsDataView,
- visualOptions: commonVisualOptions,
+ ...baseConfig,
},
{
id: 'nodeDiskCapacity',
+ chartType: 'xy',
title: i18n.translate(
'xpack.metricsData.assetDetails.metricsCharts.kubernetes.nodeDiskCapacity',
{
@@ -76,19 +82,17 @@ export const assetDetailsKubernetesNode = {
),
layers: [
{
- data: [formulas.nodeDiskCapacity, formulas.nodeDiskUsed],
- options: {
- seriesType: 'area',
- },
- layerType: 'data',
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [formulas.nodeDiskCapacity, formulas.nodeDiskUsed],
},
],
- visualizationType: 'lnsXY',
- dataView: metricsDataView,
- visualOptions: commonVisualOptions,
+ ...baseConfig,
},
{
id: 'nodePodCapacity',
+ chartType: 'xy',
title: i18n.translate(
'xpack.metricsData.assetDetails.metricsCharts.kubernetes.nodePodCapacity',
{
@@ -97,16 +101,13 @@ export const assetDetailsKubernetesNode = {
),
layers: [
{
- data: [formulas.nodePodCapacity, formulas.nodePodUsed],
- options: {
- seriesType: 'area',
- },
- layerType: 'data',
+ seriesType: 'area',
+ type: 'series',
+ xAxis: '@timestamp',
+ yAxis: [formulas.nodePodCapacity, formulas.nodePodUsed],
},
],
- visualizationType: 'lnsXY',
- dataView: metricsDataView,
- visualOptions: commonVisualOptions,
+ ...baseConfig,
},
],
});
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/hosts_view.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/hosts_view.ts
index 8ba14603e85a8..3f46d8f733102 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/hosts_view.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/hosts_view.ts
@@ -5,32 +5,21 @@
* 2.0.
*/
-import { DataView } from '@kbn/data-views-plugin/common';
-import { XYChartModel, XYLayerOptions } from '@kbn/lens-embeddable-utils';
+import type { LensBreakdownConfig } from '@kbn/lens-embeddable-utils/config_builder';
import { createDashboardModel } from '../../../create_dashboard_model';
import { createBasicCharts } from '../charts';
export const hostsView = {
- get: ({ metricsDataView }: { metricsDataView?: DataView }) => {
- const commonVisualOptions: XYChartModel['visualOptions'] = {
- showDottedLine: true,
- missingValues: 'Linear',
- };
-
- const layerOptions: XYLayerOptions = {
- breakdown: {
- type: 'top_values',
- field: 'host.name',
- params: {
- size: 20,
- },
- },
+ get: ({ metricsDataViewId }: { metricsDataViewId?: string }) => {
+ const breakdown: LensBreakdownConfig = {
+ field: 'host.name',
+ type: 'topValues',
+ size: 20,
};
const {
memoryUsage,
memoryFree,
- diskUsage,
diskSpaceAvailable,
diskIORead,
diskIOWrite,
@@ -39,13 +28,10 @@ export const hostsView = {
rx,
tx,
} = createBasicCharts({
- visualizationType: 'lnsXY',
- formulaIds: [
- 'cpuUsage',
+ chartType: 'xy',
+ fromFormulas: [
'memoryUsage',
- 'normalizedLoad1m',
'memoryFree',
- 'diskUsage',
'diskSpaceAvailable',
'diskIORead',
'diskIOWrite',
@@ -54,24 +40,40 @@ export const hostsView = {
'rx',
'tx',
],
- dataView: metricsDataView,
- layerOptions,
- visualOptions: commonVisualOptions,
+ chartConfig: {
+ layerConfig: {
+ breakdown,
+ },
+ },
+ dataViewId: metricsDataViewId,
});
- const { cpuUsage, normalizedLoad1m } = createBasicCharts({
- visualizationType: 'lnsXY',
- formulaIds: ['cpuUsage', 'normalizedLoad1m'],
- layerOptions,
- visualOptions: {
- ...commonVisualOptions,
- yLeftExtent: {
- mode: 'dataBounds',
+ const { normalizedLoad1m } = createBasicCharts({
+ chartType: 'xy',
+ fromFormulas: ['normalizedLoad1m'],
+ chartConfig: {
+ layerConfig: {
+ breakdown,
+ },
+ },
+ dataViewId: metricsDataViewId,
+ });
+ normalizedLoad1m.layers.push({ type: 'reference', yAxis: [{ value: '1' }] });
+
+ const { cpuUsage, diskUsage } = createBasicCharts({
+ chartType: 'xy',
+ fromFormulas: ['cpuUsage', 'diskUsage'],
+ chartConfig: {
+ layerConfig: {
+ breakdown,
+ },
+ yBounds: {
+ mode: 'custom',
lowerBound: 0,
upperBound: 1,
},
},
- dataView: metricsDataView,
+ dataViewId: metricsDataViewId,
});
return createDashboardModel({
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/kpi.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/kpi.ts
index 28a929f147e71..2556811c1a44d 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/kpi.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/dashboards/kpi.ts
@@ -4,9 +4,8 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { DataView } from '@kbn/data-views-plugin/common';
import { i18n } from '@kbn/i18n';
-import type { MetricLayerOptions } from '@kbn/lens-embeddable-utils';
+import type { LensMetricConfig } from '@kbn/lens-embeddable-utils/config_builder';
import { createDashboardModel } from '../../../create_dashboard_model';
import { createBasicCharts } from '../charts';
@@ -16,95 +15,28 @@ const AVERAGE = i18n.translate('xpack.metricsData.assetDetails.overview.kpi.subt
export const kpi = {
get: ({
- metricsDataView,
+ metricsDataViewId,
options,
}: {
- metricsDataView?: DataView;
- options?: MetricLayerOptions;
+ metricsDataViewId?: string;
+ options?: Pick;
}) => {
const { cpuUsage, diskUsage, memoryUsage, normalizedLoad1m } = createBasicCharts({
- visualizationType: 'lnsMetric',
- formulaIds: ['cpuUsage', 'diskUsage', 'memoryUsage', 'normalizedLoad1m'],
- layerOptions: {
- showTrendLine: true,
- subtitle: AVERAGE,
- ...options,
+ chartType: 'metric',
+ fromFormulas: ['cpuUsage', 'diskUsage', 'memoryUsage', 'normalizedLoad1m'],
+ chartConfig: {
+ trendLine: true,
+ subtitle: options?.subtitle ?? AVERAGE,
+ seriesColor: options?.seriesColor,
},
- dataView: metricsDataView,
+ dataViewId: metricsDataViewId,
});
return createDashboardModel({
- charts: [
- {
- ...cpuUsage,
- layers: {
- ...cpuUsage.layers,
- data: {
- ...cpuUsage.layers.data,
- format: cpuUsage.layers.data.format
- ? {
- ...cpuUsage.layers.data.format,
- params: {
- decimals: 1,
- },
- }
- : undefined,
- },
- },
- },
- {
- ...normalizedLoad1m,
- layers: {
- ...normalizedLoad1m.layers,
- data: {
- ...normalizedLoad1m.layers.data,
- format: normalizedLoad1m.layers.data.format
- ? {
- ...normalizedLoad1m.layers.data.format,
- params: {
- decimals: 1,
- },
- }
- : undefined,
- },
- },
- },
-
- {
- ...memoryUsage,
- layers: {
- ...memoryUsage.layers,
- data: {
- ...memoryUsage.layers.data,
- format: memoryUsage.layers.data.format
- ? {
- ...memoryUsage.layers.data.format,
- params: {
- decimals: 1,
- },
- }
- : undefined,
- },
- },
- },
- {
- ...diskUsage,
- layers: {
- ...diskUsage.layers,
- data: {
- ...diskUsage.layers.data,
- format: diskUsage.layers.data.format
- ? {
- ...diskUsage.layers.data.format,
- params: {
- decimals: 1,
- },
- }
- : undefined,
- },
- },
- },
- ],
+ charts: [cpuUsage, diskUsage, memoryUsage, normalizedLoad1m].map((p) => ({
+ ...p,
+ decimals: 1,
+ })),
});
},
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu.ts
new file mode 100644
index 0000000000000..1308771f924d9
--- /dev/null
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu.ts
@@ -0,0 +1,81 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { i18n } from '@kbn/i18n';
+import type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder';
+
+export const cpuUsageIowait: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.iowaitLabel', {
+ defaultMessage: 'iowait',
+ }),
+ value: 'average(system.cpu.iowait.pct) / max(system.cpu.cores)',
+ format: 'percent',
+ decimals: 1,
+};
+
+export const cpuUsageIrq: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.irqLabel', {
+ defaultMessage: 'irq',
+ }),
+ value: 'average(system.cpu.irq.pct) / max(system.cpu.cores)',
+ format: 'percent',
+ decimals: 1,
+};
+
+export const cpuUsageNice: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.niceLabel', {
+ defaultMessage: 'nice',
+ }),
+ value: 'average(system.cpu.nice.norm.pct) / max(system.cpu.cores)',
+ format: 'percent',
+ decimals: 1,
+};
+
+export const cpuUsageSoftirq: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.softirqLabel', {
+ defaultMessage: 'softirq',
+ }),
+ value: 'average(system.cpu.softirq.pct) / max(system.cpu.cores)',
+ format: 'percent',
+ decimals: 1,
+};
+
+export const cpuUsageSteal: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.stealLabel', {
+ defaultMessage: 'steal',
+ }),
+ value: 'average(system.cpu.steal.pct) / max(system.cpu.cores)',
+ format: 'percent',
+ decimals: 1,
+};
+
+export const cpuUsageSystem: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.systemLabel', {
+ defaultMessage: 'system',
+ }),
+ value: 'average(system.cpu.system.pct) / max(system.cpu.cores)',
+ format: 'percent',
+ decimals: 1,
+};
+
+export const cpuUsageUser: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.userLabel', {
+ defaultMessage: 'user',
+ }),
+ value: 'average(system.cpu.user.pct) / max(system.cpu.cores)',
+ format: 'percent',
+ decimals: 1,
+};
+
+export const cpuUsage: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage', {
+ defaultMessage: 'CPU Usage',
+ }),
+ value: '(average(system.cpu.user.pct) + average(system.cpu.system.pct)) / max(system.cpu.cores)',
+ format: 'percent',
+ decimals: 0,
+};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage.ts
deleted file mode 100644
index 5fc722ef8ee7f..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const cpuUsage: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage', {
- defaultMessage: 'CPU Usage',
- }),
- value: '(average(system.cpu.user.pct) + average(system.cpu.system.pct)) / max(system.cpu.cores)',
- format: {
- id: 'percent',
- params: {
- decimals: 0,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_iowait.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_iowait.ts
deleted file mode 100644
index 884306852f87d..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_iowait.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const cpuUsageIowait: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.iowaitLabel', {
- defaultMessage: 'iowait',
- }),
- value: 'average(system.cpu.iowait.pct) / max(system.cpu.cores)',
- format: {
- id: 'percent',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_irq.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_irq.ts
deleted file mode 100644
index 148939a0ffd3e..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_irq.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const cpuUsageIrq: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.irqLabel', {
- defaultMessage: 'irq',
- }),
- value: 'average(system.cpu.irq.pct) / max(system.cpu.cores)',
- format: {
- id: 'percent',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_nice.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_nice.ts
deleted file mode 100644
index 24d2400d0a2ca..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_nice.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const cpuUsageNice: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.niceLabel', {
- defaultMessage: 'nice',
- }),
- value: 'average(system.cpu.nice.norm.pct) / max(system.cpu.cores)',
- format: {
- id: 'percent',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_softirq.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_softirq.ts
deleted file mode 100644
index 8ec868af679a8..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_softirq.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const cpuUsageSoftirq: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.softirqLabel', {
- defaultMessage: 'softirq',
- }),
- value: 'average(system.cpu.softirq.pct) / max(system.cpu.cores)',
- format: {
- id: 'percent',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_steal.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_steal.ts
deleted file mode 100644
index a400551d492e1..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_steal.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const cpuUsageSteal: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.stealLabel', {
- defaultMessage: 'steal',
- }),
- value: 'average(system.cpu.steal.pct) / max(system.cpu.cores)',
- format: {
- id: 'percent',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_system.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_system.ts
deleted file mode 100644
index 80e2e369f3f20..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_system.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const cpuUsageSystem: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.systemLabel', {
- defaultMessage: 'system',
- }),
- value: 'average(system.cpu.system.pct) / max(system.cpu.cores)',
- format: {
- id: 'percent',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_user.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_user.ts
deleted file mode 100644
index 6fb45344f8896..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/cpu_usage_user.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const cpuUsageUser: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.cpuUsage.userLabel', {
- defaultMessage: 'user',
- }),
- value: 'average(system.cpu.user.pct) / max(system.cpu.cores)',
- format: {
- id: 'percent',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk.ts
new file mode 100644
index 0000000000000..d0837218b61c8
--- /dev/null
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk.ts
@@ -0,0 +1,76 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { i18n } from '@kbn/i18n';
+import type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder';
+
+export const diskIORead: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskIORead', {
+ defaultMessage: 'Disk Read IOPS',
+ }),
+ value: "counter_rate(max(system.diskio.read.count), kql='system.diskio.read.count: *')",
+ format: 'number',
+ decimals: 0,
+ normalizeByUnit: 's',
+};
+
+export const diskReadThroughput: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskReadThroughput', {
+ defaultMessage: 'Disk Read Throughput',
+ }),
+ value: "counter_rate(max(system.diskio.read.bytes), kql='system.diskio.read.bytes: *')",
+ format: 'bytes',
+ decimals: 1,
+ normalizeByUnit: 's',
+};
+
+export const diskSpaceAvailable: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskSpaceAvailable', {
+ defaultMessage: 'Disk Space Available',
+ }),
+ value: 'average(system.filesystem.free)',
+ format: 'bytes',
+ decimals: 0,
+};
+
+export const diskSpaceAvailability: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskSpaceAvailability', {
+ defaultMessage: 'Disk Space Availability',
+ }),
+ value: '1 - average(system.filesystem.used.pct)',
+ format: 'percent',
+ decimals: 0,
+};
+
+export const diskUsage: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskUsage', {
+ defaultMessage: 'Disk Usage',
+ }),
+ value: 'average(system.filesystem.used.pct)',
+ format: 'percent',
+ decimals: 0,
+};
+
+export const diskIOWrite: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskIOWrite', {
+ defaultMessage: 'Disk Write IOPS',
+ }),
+ value: "counter_rate(max(system.diskio.write.count), kql='system.diskio.write.count: *')",
+ format: 'number',
+ decimals: 0,
+ normalizeByUnit: 's',
+};
+
+export const diskWriteThroughput: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskWriteThroughput', {
+ defaultMessage: 'Disk Write Throughput',
+ }),
+ value: "counter_rate(max(system.diskio.write.bytes), kql='system.diskio.write.bytes: *')",
+ format: 'bytes',
+ decimals: 1,
+ normalizeByUnit: 's',
+};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_read_iops.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_read_iops.ts
deleted file mode 100644
index a21a735856ded..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_read_iops.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const diskIORead: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskIORead', {
- defaultMessage: 'Disk Read IOPS',
- }),
- value: "counter_rate(max(system.diskio.read.count), kql='system.diskio.read.count: *')",
- format: {
- id: 'number',
- params: {
- decimals: 0,
- },
- },
- timeScale: 's',
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_read_throughput.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_read_throughput.ts
deleted file mode 100644
index 73b684dc5a65b..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_read_throughput.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const diskReadThroughput: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskReadThroughput', {
- defaultMessage: 'Disk Read Throughput',
- }),
- value: "counter_rate(max(system.diskio.read.bytes), kql='system.diskio.read.bytes: *')",
- format: {
- id: 'bytes',
- params: {
- decimals: 1,
- },
- },
- timeScale: 's',
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_space_availability.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_space_availability.ts
deleted file mode 100644
index 6ea6811d30d0f..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_space_availability.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const diskSpaceAvailability: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskSpaceAvailability', {
- defaultMessage: 'Disk Space Availability',
- }),
- value: '1 - average(system.filesystem.used.pct)',
- format: {
- id: 'percent',
- params: {
- decimals: 0,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_space_available.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_space_available.ts
deleted file mode 100644
index c6e9919b4c532..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_space_available.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const diskSpaceAvailable: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskSpaceAvailable', {
- defaultMessage: 'Disk Space Available',
- }),
- value: 'average(system.filesystem.free)',
- format: {
- id: 'bytes',
- params: {
- decimals: 0,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_usage.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_usage.ts
deleted file mode 100644
index e9a2ff6f93cbe..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_usage.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const diskUsage: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskUsage', {
- defaultMessage: 'Disk Usage',
- }),
- value: 'average(system.filesystem.used.pct)',
- format: {
- id: 'percent',
- params: {
- decimals: 0,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_write_iops.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_write_iops.ts
deleted file mode 100644
index 881a8bcd05294..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_write_iops.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const diskIOWrite: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskIOWrite', {
- defaultMessage: 'Disk Write IOPS',
- }),
- value: "counter_rate(max(system.diskio.write.count), kql='system.diskio.write.count: *')",
- format: {
- id: 'number',
- params: {
- decimals: 0,
- },
- },
- timeScale: 's',
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_write_throughput.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_write_throughput.ts
deleted file mode 100644
index 2290ed6e3b83f..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/disk_write_throughput.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const diskWriteThroughput: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.diskWriteThroughput', {
- defaultMessage: 'Disk Write Throughput',
- }),
- value: "counter_rate(max(system.diskio.write.bytes), kql='system.diskio.write.bytes: *')",
- format: {
- id: 'bytes',
- params: {
- decimals: 1,
- },
- },
- timeScale: 's',
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/host_count.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/host_count.ts
index d5cea36319d69..c62b9c9e17a8e 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/host_count.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/host_count.ts
@@ -6,17 +6,13 @@
*/
import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
+import type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder';
-export const hostCount: FormulaValueConfig = {
+export const hostCount: LensBaseLayer = {
label: i18n.translate('xpack.metricsData.assetDetails.formulas.hostCount.hostsLabel', {
defaultMessage: 'Hosts',
}),
value: 'unique_count(host.name)',
- format: {
- id: 'number',
- params: {
- decimals: 0,
- },
- },
+ format: 'number',
+ decimals: 0,
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/index.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/index.ts
index f290d9f894272..5bead7f6583a0 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/index.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/index.ts
@@ -5,34 +5,38 @@
* 2.0.
*/
-import { cpuUsage } from './cpu_usage';
-import { cpuUsageIowait } from './cpu_usage_iowait';
-import { cpuUsageIrq } from './cpu_usage_irq';
-import { cpuUsageNice } from './cpu_usage_nice';
-import { cpuUsageSoftirq } from './cpu_usage_softirq';
-import { cpuUsageSteal } from './cpu_usage_steal';
-import { cpuUsageUser } from './cpu_usage_user';
-import { cpuUsageSystem } from './cpu_usage_system';
-import { diskIORead } from './disk_read_iops';
-import { diskIOWrite } from './disk_write_iops';
-import { diskReadThroughput } from './disk_read_throughput';
-import { diskWriteThroughput } from './disk_write_throughput';
-import { diskSpaceAvailability } from './disk_space_availability';
-import { diskSpaceAvailable } from './disk_space_available';
-import { diskUsage } from './disk_usage';
+import {
+ cpuUsage,
+ cpuUsageIowait,
+ cpuUsageIrq,
+ cpuUsageNice,
+ cpuUsageSoftirq,
+ cpuUsageSteal,
+ cpuUsageSystem,
+ cpuUsageUser,
+} from './cpu';
+
+import {
+ diskIORead,
+ diskIOWrite,
+ diskReadThroughput,
+ diskSpaceAvailable,
+ diskSpaceAvailability,
+ diskUsage,
+ diskWriteThroughput,
+} from './disk';
+
import { hostCount } from './host_count';
import { logRate } from './log_rate';
-import { normalizedLoad1m } from './normalized_load_1m';
-import { load1m } from './load_1m';
-import { load5m } from './load_5m';
-import { load15m } from './load_15m';
-import { memoryUsage } from './memory_usage';
-import { memoryFree } from './memory_free';
-import { memoryUsed } from './memory_used';
-import { memoryFreeExcludingCache } from './memory_free_excluding_cache';
-import { memoryCache } from './memory_cache';
-import { rx } from './rx';
-import { tx } from './tx';
+import { load1m, load15m, load5m, normalizedLoad1m } from './load';
+import {
+ memoryUsage,
+ memoryCache,
+ memoryFreeExcludingCache,
+ memoryUsed,
+ memoryFree,
+} from './memory';
+import { rx, tx } from './network';
export const formulas = {
cpuUsage,
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load.ts
new file mode 100644
index 0000000000000..3d52fb1af6920
--- /dev/null
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load.ts
@@ -0,0 +1,45 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { i18n } from '@kbn/i18n';
+import type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder';
+
+export const load1m: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.load1m', {
+ defaultMessage: 'Load (1m)',
+ }),
+ value: 'average(system.load.1)',
+ format: 'number',
+ decimals: 1,
+};
+
+export const load5m: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.load5m', {
+ defaultMessage: 'Load (5m)',
+ }),
+ value: 'average(system.load.5)',
+ format: 'number',
+ decimals: 1,
+};
+
+export const load15m: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.load15m', {
+ defaultMessage: 'Load (15m)',
+ }),
+ value: 'average(system.load.15)',
+ format: 'number',
+ decimals: 1,
+};
+
+export const normalizedLoad1m: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.normalizedLoad1m', {
+ defaultMessage: 'Normalized Load',
+ }),
+ value: 'average(system.load.1) / max(system.load.cores)',
+ format: 'percent',
+ decimals: 0,
+};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load_15m.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load_15m.ts
deleted file mode 100644
index 79179241b414d..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load_15m.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const load15m: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.load15m', {
- defaultMessage: 'Load (15m)',
- }),
- value: 'average(system.load.15)',
- format: {
- id: 'number',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load_1m.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load_1m.ts
deleted file mode 100644
index 7346023dc01bb..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load_1m.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const load1m: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.load1m', {
- defaultMessage: 'Load (1m)',
- }),
- value: 'average(system.load.1)',
- format: {
- id: 'number',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load_5m.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load_5m.ts
deleted file mode 100644
index 027d05ef012ba..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/load_5m.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const load5m: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.load5m', {
- defaultMessage: 'Load (5m)',
- }),
- value: 'average(system.load.5)',
- format: {
- id: 'number',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/log_rate.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/log_rate.ts
index 21b1309841b7d..6947afbc2e262 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/log_rate.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/log_rate.ts
@@ -6,18 +6,14 @@
*/
import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
+import type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder';
-export const logRate: FormulaValueConfig = {
+export const logRate: LensBaseLayer = {
label: i18n.translate('xpack.metricsData.assetDetails.formulas.logRate', {
defaultMessage: 'Log Rate',
}),
value: 'differences(cumulative_sum(count()))',
- format: {
- id: 'number',
- params: {
- decimals: 0,
- },
- },
- timeScale: 's',
+ format: 'number',
+ decimals: 0,
+ normalizeByUnit: 's',
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory.ts
new file mode 100644
index 0000000000000..7b3afb4894e12
--- /dev/null
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory.ts
@@ -0,0 +1,55 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { i18n } from '@kbn/i18n';
+import type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder';
+
+export const memoryCache: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.metric.label.cache', {
+ defaultMessage: 'cache',
+ }),
+ value: 'average(system.memory.used.bytes) - average(system.memory.actual.used.bytes)',
+ format: 'bytes',
+ decimals: 1,
+};
+
+export const memoryFree: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.memoryFree', {
+ defaultMessage: 'Memory Free',
+ }),
+ value: 'max(system.memory.total) - average(system.memory.actual.used.bytes)',
+ format: 'bytes',
+ decimals: 1,
+};
+
+export const memoryFreeExcludingCache: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.metric.label.free', {
+ defaultMessage: 'free',
+ }),
+ value: 'average(system.memory.free)',
+ format: 'bytes',
+ decimals: 1,
+};
+
+export const memoryUsage: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.memoryUsage', {
+ defaultMessage: 'Memory Usage',
+ }),
+ value: 'average(system.memory.actual.used.pct)',
+ format: 'percent',
+
+ decimals: 0,
+};
+
+export const memoryUsed: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.metric.label.used', {
+ defaultMessage: 'used',
+ }),
+ value: 'average(system.memory.actual.used.bytes)',
+ format: 'bytes',
+ decimals: 1,
+};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_cache.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_cache.ts
deleted file mode 100644
index 3e5b32b256fb7..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_cache.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const memoryCache: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.metric.label.cache', {
- defaultMessage: 'cache',
- }),
- value: 'average(system.memory.used.bytes) - average(system.memory.actual.used.bytes)',
- format: {
- id: 'bytes',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_free.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_free.ts
deleted file mode 100644
index 2c07c22650926..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_free.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const memoryFree: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.memoryFree', {
- defaultMessage: 'Memory Free',
- }),
- value: 'max(system.memory.total) - average(system.memory.actual.used.bytes)',
- format: {
- id: 'bytes',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_free_excluding_cache.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_free_excluding_cache.ts
deleted file mode 100644
index 97df7baed7dfe..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_free_excluding_cache.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const memoryFreeExcludingCache: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.metric.label.free', {
- defaultMessage: 'free',
- }),
- value: 'average(system.memory.free)',
- format: {
- id: 'bytes',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_usage.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_usage.ts
deleted file mode 100644
index 8a4641cd365a6..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_usage.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const memoryUsage: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.memoryUsage', {
- defaultMessage: 'Memory Usage',
- }),
- value: 'average(system.memory.actual.used.pct)',
- format: {
- id: 'percent',
- params: {
- decimals: 0,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_used.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_used.ts
deleted file mode 100644
index 373164e3705e7..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/memory_used.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const memoryUsed: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.metric.label.used', {
- defaultMessage: 'used',
- }),
- value: 'average(system.memory.actual.used.bytes)',
- format: {
- id: 'bytes',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/rx.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/network.ts
similarity index 51%
rename from x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/rx.ts
rename to x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/network.ts
index ec341acf9be6f..d35beeb7469d0 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/rx.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/network.ts
@@ -6,19 +6,26 @@
*/
import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
+import type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder';
-export const rx: FormulaValueConfig = {
+export const rx: LensBaseLayer = {
label: i18n.translate('xpack.metricsData.assetDetails.formulas.rx', {
defaultMessage: 'Network Inbound (RX)',
}),
value:
"average(host.network.ingress.bytes) * 8 / (max(metricset.period, kql='host.network.ingress.bytes: *') / 1000)",
- format: {
- id: 'bits',
- params: {
- decimals: 1,
- },
- },
- timeScale: 's',
+ format: 'bits',
+ decimals: 1,
+ normalizeByUnit: 's',
+};
+
+export const tx: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.tx', {
+ defaultMessage: 'Network Outbound (TX)',
+ }),
+ value:
+ "average(host.network.egress.bytes) * 8 / (max(metricset.period, kql='host.network.egress.bytes: *') / 1000)",
+ format: 'bits',
+ decimals: 1,
+ normalizeByUnit: 's',
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/normalized_load_1m.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/normalized_load_1m.ts
deleted file mode 100644
index 48d130868667f..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/normalized_load_1m.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const normalizedLoad1m: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.normalizedLoad1m', {
- defaultMessage: 'Normalized Load',
- }),
- value: 'average(system.load.1) / max(system.load.cores)',
- format: {
- id: 'percent',
- params: {
- decimals: 0,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/tx.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/tx.ts
deleted file mode 100644
index 52ada97dd06d6..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/host/metrics/formulas/tx.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const tx: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.tx', {
- defaultMessage: 'Network Outbound (TX)',
- }),
- value:
- "average(host.network.egress.bytes) * 8 / (max(metricset.period, kql='host.network.egress.bytes: *') / 1000)",
- format: {
- id: 'bits',
- params: {
- decimals: 1,
- },
- },
- timeScale: 's',
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_cpu_capacity.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/cpu.ts
similarity index 50%
rename from x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_cpu_capacity.ts
rename to x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/cpu.ts
index 952edac1d5de4..baa061613128b 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_cpu_capacity.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/cpu.ts
@@ -6,18 +6,24 @@
*/
import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
+import type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder';
-export const nodeCpuCapacity: FormulaValueConfig = {
+export const nodeCpuCapacity: LensBaseLayer = {
label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.capacity', {
defaultMessage: 'Capacity',
}),
value: 'max(kubernetes.node.cpu.allocatable.cores) * 1000000000',
- format: {
- id: 'number',
- params: {
- decimals: 1,
- compact: true,
- },
- },
+ format: 'number',
+ decimals: 1,
+ compactValues: true,
+};
+
+export const nodeCpuUsed: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.used', {
+ defaultMessage: 'Used',
+ }),
+ value: 'average(kubernetes.node.cpu.usage.nanocores)',
+ format: 'number',
+ decimals: 1,
+ compactValues: true,
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_disk_capacity.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/disk.ts
similarity index 53%
rename from x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_disk_capacity.ts
rename to x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/disk.ts
index 45e0e61c1b8f6..e518b01556b5d 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_disk_capacity.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/disk.ts
@@ -6,17 +6,22 @@
*/
import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
+import type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder';
-export const nodeDiskCapacity: FormulaValueConfig = {
+export const nodeDiskCapacity: LensBaseLayer = {
label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.capacity', {
defaultMessage: 'Capacity',
}),
value: 'max(kubernetes.node.fs.capacity.bytes)',
- format: {
- id: 'bytes',
- params: {
- decimals: 1,
- },
- },
+ format: 'bytes',
+ decimals: 1,
+};
+
+export const nodeDiskUsed: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.used', {
+ defaultMessage: 'Used',
+ }),
+ value: 'average(kubernetes.node.fs.used.bytes)',
+ format: 'bytes',
+ decimals: 1,
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/index.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/index.ts
index 5203d1a0abf31..cd2ff880b045b 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/index.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/index.ts
@@ -5,14 +5,10 @@
* 2.0.
*/
-import { nodeCpuCapacity } from './node_cpu_capacity';
-import { nodeCpuUsed } from './node_cpu_used';
-import { nodeDiskCapacity } from './node_disk_capacity';
-import { nodeDiskUsed } from './node_disk_used';
-import { nodeMemoryCapacity } from './node_memory_capacity';
-import { nodeMemoryUsed } from './node_memory_used';
-import { nodePodCapacity } from './node_pod_capacity';
-import { nodePodUsed } from './node_pod_used';
+import { nodeCpuCapacity, nodeCpuUsed } from './cpu';
+import { nodeDiskCapacity, nodeDiskUsed } from './disk';
+import { nodeMemoryCapacity, nodeMemoryUsed } from './memory';
+import { nodePodCapacity, nodePodUsed } from './pod_capacity';
export const formulas = {
nodeCpuCapacity,
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_memory_capacity.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/memory.ts
similarity index 52%
rename from x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_memory_capacity.ts
rename to x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/memory.ts
index 4607f002194a9..63ad88faef781 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_memory_capacity.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/memory.ts
@@ -6,17 +6,22 @@
*/
import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
+import type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder';
-export const nodeMemoryCapacity: FormulaValueConfig = {
+export const nodeMemoryCapacity: LensBaseLayer = {
label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.capacity', {
defaultMessage: 'Capacity',
}),
value: 'max(kubernetes.node.memory.allocatable.bytes)',
- format: {
- id: 'bytes',
- params: {
- decimals: 1,
- },
- },
+ format: 'bytes',
+ decimals: 1,
+};
+
+export const nodeMemoryUsed: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.used', {
+ defaultMessage: 'Used',
+ }),
+ value: 'average(kubernetes.node.memory.usage.bytes)',
+ format: 'bytes',
+ decimals: 1,
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_cpu_used.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_cpu_used.ts
deleted file mode 100644
index 4561303430d15..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_cpu_used.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const nodeCpuUsed: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.used', {
- defaultMessage: 'Used',
- }),
- value: 'average(kubernetes.node.cpu.usage.nanocores)',
- format: {
- id: 'number',
- params: {
- decimals: 1,
- compact: true,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_disk_used.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_disk_used.ts
deleted file mode 100644
index 4f6d07a0a4379..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_disk_used.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const nodeDiskUsed: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.used', {
- defaultMessage: 'Used',
- }),
- value: 'average(kubernetes.node.fs.used.bytes)',
- format: {
- id: 'bytes',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_memory_used.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_memory_used.ts
deleted file mode 100644
index cdcaf32593a3c..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_memory_used.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const nodeMemoryUsed: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.used', {
- defaultMessage: 'Used',
- }),
- value: 'average(kubernetes.node.memory.usage.bytes)',
- format: {
- id: 'bytes',
- params: {
- decimals: 1,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_pod_used.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_pod_used.ts
deleted file mode 100644
index 697ceaca02f67..0000000000000
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_pod_used.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
-
-export const nodePodUsed: FormulaValueConfig = {
- label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.used', {
- defaultMessage: 'Used',
- }),
- value: 'unique_count(kubernetes.pod.uid)',
- format: {
- id: 'number',
- params: {
- decimals: 0,
- },
- },
-};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_pod_capacity.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/pod_capacity.ts
similarity index 56%
rename from x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_pod_capacity.ts
rename to x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/pod_capacity.ts
index 9bf455df9ccf8..903df978bd996 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/node_pod_capacity.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/kubernetes/node/metrics/formulas/pod_capacity.ts
@@ -6,18 +6,23 @@
*/
import { i18n } from '@kbn/i18n';
-import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
+import type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder';
-export const nodePodCapacity: FormulaValueConfig = {
+export const nodePodCapacity: LensBaseLayer = {
label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.capacity', {
defaultMessage: 'Capacity',
}),
value:
"last_value(kubernetes.node.pod.allocatable.total, kql='kubernetes.node.pod.allocatable.total: *')",
- format: {
- id: 'number',
- params: {
- decimals: 0,
- },
- },
+ format: 'number',
+ decimals: 0,
+};
+
+export const nodePodUsed: LensBaseLayer = {
+ label: i18n.translate('xpack.metricsData.assetDetails.formulas.kubernetes.used', {
+ defaultMessage: 'Used',
+ }),
+ value: 'unique_count(kubernetes.pod.uid)',
+ format: 'number',
+ decimals: 0,
};
diff --git a/x-pack/plugins/metrics_data_access/common/inventory_models/types.ts b/x-pack/plugins/metrics_data_access/common/inventory_models/types.ts
index 25bc3ab001b2d..3d35da776028a 100644
--- a/x-pack/plugins/metrics_data_access/common/inventory_models/types.ts
+++ b/x-pack/plugins/metrics_data_access/common/inventory_models/types.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import type { ChartModel, FormulaValueConfig } from '@kbn/lens-embeddable-utils';
+import type { LensBaseLayer, LensConfig } from '@kbn/lens-embeddable-utils/config_builder';
import * as rt from 'io-ts';
export const ItemTypeRT = rt.keyof({
@@ -386,7 +386,7 @@ export interface InventoryMetrics {
}
export interface InventoryMetricsWithDashboards<
- TFormula extends Record,
+ TFormula extends Record,
TDashboard extends Record
> extends InventoryMetrics {
getFormulas: () => Promise;
@@ -419,11 +419,12 @@ export interface InventoryModel {
nodeFilter?: object[];
}
+export type LensConfigWithId = LensConfig & { id: string };
export interface DashboardFn {
get: (...args: any[]) => DashboardModel;
}
export interface DashboardModel {
- charts: ChartModel[];
+ charts: LensConfigWithId[];
dependsOn?: string[];
}
diff --git a/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/register_alerts_table_configuration.tsx b/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/register_alerts_table_configuration.tsx
index 92ef8e46821d1..d20642339eec5 100644
--- a/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/register_alerts_table_configuration.tsx
+++ b/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/register_alerts_table_configuration.tsx
@@ -76,7 +76,6 @@ export function registerAlertsTableConfiguration(
}),
initialWidth: 150,
isSortable: true,
- schema: 'numeric',
},
{
id: ALERT_START,
diff --git a/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/render_cell_value.test.tsx b/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/render_cell_value.test.tsx
new file mode 100644
index 0000000000000..bba6b909863bb
--- /dev/null
+++ b/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/render_cell_value.test.tsx
@@ -0,0 +1,51 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { EuiHealth } from '@elastic/eui';
+import { type FieldFormatsRegistry } from '@kbn/field-formats-plugin/common';
+import { fieldFormatsServiceMock } from '@kbn/field-formats-plugin/public/mocks';
+import React from 'react';
+import { ALERT_ANOMALY_SCORE } from '../../../common/constants/alerts';
+import { getAlertFormatters } from './render_cell_value';
+
+describe('getAlertFormatters', () => {
+ const fieldFormatsMock = fieldFormatsServiceMock.createStartContract();
+
+ const alertFormatter = getAlertFormatters(fieldFormatsMock as FieldFormatsRegistry);
+
+ test('format anomaly score correctly', () => {
+ expect(alertFormatter(ALERT_ANOMALY_SCORE, 50.3)).toEqual(
+
+ 50
+
+ );
+
+ expect(alertFormatter(ALERT_ANOMALY_SCORE, '50.3,89.6')).toEqual(
+
+ 89
+
+ );
+
+ expect(alertFormatter(ALERT_ANOMALY_SCORE, '0.7')).toEqual(
+
+ < 1
+
+ );
+
+ expect(alertFormatter(ALERT_ANOMALY_SCORE, '0')).toEqual(
+
+ < 1
+
+ );
+
+ expect(alertFormatter(ALERT_ANOMALY_SCORE, '')).toEqual(
+
+ < 1
+
+ );
+ });
+});
diff --git a/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/render_cell_value.tsx b/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/render_cell_value.tsx
index e58f8cd69e1b3..6e14a94a5b471 100644
--- a/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/render_cell_value.tsx
+++ b/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/render_cell_value.tsx
@@ -11,7 +11,7 @@ import { isDefined } from '@kbn/ml-is-defined';
import { ALERT_DURATION, ALERT_END, ALERT_START } from '@kbn/rule-data-utils';
import type { GetRenderCellValue } from '@kbn/triggers-actions-ui-plugin/public';
import { FIELD_FORMAT_IDS, FieldFormatsRegistry } from '@kbn/field-formats-plugin/common';
-import { getSeverityColor } from '@kbn/ml-anomaly-utils';
+import { getFormattedSeverityScore, getSeverityColor } from '@kbn/ml-anomaly-utils';
import { EuiHealth } from '@elastic/eui';
import {
alertFieldNameMap,
@@ -74,7 +74,9 @@ export const getRenderCellValue = (fieldFormats: FieldFormatsRegistry): GetRende
export function getAlertFormatters(fieldFormats: FieldFormatsRegistry) {
const getFormatter = getFieldFormatterProvider(fieldFormats);
- return (columnId: string, value: any): React.ReactElement => {
+ return (columnId: string, value: string | number | undefined): React.ReactElement => {
+ if (!isDefined(value)) return <>{'—'}>;
+
switch (columnId) {
case ALERT_START:
case ALERT_END:
@@ -90,9 +92,16 @@ export function getAlertFormatters(fieldFormats: FieldFormatsRegistry) {
>
);
case ALERT_ANOMALY_SCORE:
+ let latestValue: number;
+ if (typeof value === 'number') {
+ latestValue = value;
+ } else {
+ const resultValue: number[] = value.split(',').map(Number);
+ latestValue = resultValue.at(-1) as number;
+ }
return (
-
- {getFormatter(FIELD_FORMAT_IDS.NUMBER)(value)}
+
+ {getFormattedSeverityScore(latestValue)}
);
default:
diff --git a/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/use_alerts_flyout.tsx b/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/use_alerts_flyout.tsx
index 71a04bd78719d..58586bdc1441c 100644
--- a/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/use_alerts_flyout.tsx
+++ b/x-pack/plugins/ml/public/alerting/anomaly_detection_alerts_table/use_alerts_flyout.tsx
@@ -31,7 +31,10 @@ export const getAlertFlyout =
{
- const value = get(alert, column.id)?.[0];
+ const alertFieldValue = get(alert, column.id);
+ const value = (
+ Array.isArray(alertFieldValue) ? alertFieldValue.at(-1) : alertFieldValue
+ ) as string;
return {
title: column.displayAsText as string,
diff --git a/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts b/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts
index 93d4595193bc2..d9a0d5d535191 100644
--- a/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts
+++ b/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts
@@ -498,7 +498,7 @@ export function alertingServiceProvider(
job_id: [...new Set(requestedAnomalies.map((h) => h._source.job_id))][0],
is_interim: requestedAnomalies.some((h) => h._source.is_interim),
anomaly_timestamp: timestamp,
- anomaly_score: topAnomaly._source[getScoreFields(resultType, useInitialScore)],
+ anomaly_score: [topAnomaly._source[getScoreFields(resultType, useInitialScore)]],
top_records: v.record_results.top_record_hits.hits.hits.map((h) => {
const { actual, typical } = getTypicalAndActualValues(h._source);
return pick(
@@ -1015,7 +1015,7 @@ export function alertingServiceProvider(
'xpack.ml.alertTypes.anomalyDetectionAlertingRule.recoveredReason',
{
defaultMessage:
- 'No anomalies have been found in the concecutive bucket after the alert was triggered.',
+ 'No anomalies have been found in the consecutive bucket after the alert was triggered.',
}
);
diff --git a/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts b/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts
index d270ca3166e2f..707486b5b8d1b 100644
--- a/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts
+++ b/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts
@@ -6,6 +6,7 @@
*/
import { i18n } from '@kbn/i18n';
+import { takeRight } from 'lodash';
import { DEFAULT_APP_CATEGORIES, KibanaRequest } from '@kbn/core/server';
import type {
ActionGroup,
@@ -57,7 +58,7 @@ export type AnomalyDetectionAlertBaseContext = AlertInstanceContext & {
// Flattened alert payload for alert-as-data
export type AnomalyDetectionAlertPayload = {
job_id: string;
- anomaly_score?: number;
+ anomaly_score?: number[];
is_interim?: boolean;
anomaly_timestamp?: number;
top_records?: any;
@@ -91,6 +92,8 @@ export type AnomalyScoreMatchGroupId = typeof ANOMALY_SCORE_MATCH_GROUP_ID;
export const ANOMALY_DETECTION_AAD_INDEX_NAME = 'ml.anomaly-detection';
+const ANOMALY_SCORE_HISTORY_LIMIT = 20;
+
export const ANOMALY_DETECTION_AAD_CONFIG: IRuleTypeAlerts = {
context: ANOMALY_DETECTION_AAD_INDEX_NAME,
mappings: {
@@ -100,7 +103,7 @@ export const ANOMALY_DETECTION_AAD_CONFIG: IRuleTypeAlerts ({
id: observabilityFeatureId,
cases: { featureId: casesFeatureId, owner: [observabilityFeatureId] },
- columns,
+ columns: getColumns({ showRuleName: true }),
getRenderCellValue: ({ setFlyoutAlert }) =>
getRenderCellValue({
observabilityRuleTypeRegistry,
@@ -34,7 +34,7 @@ export const getAlertsTableConfiguration = (
}),
sort: [
{
- [TIMESTAMP]: {
+ [ALERT_START]: {
order: 'desc' as SortOrder,
},
},
diff --git a/x-pack/plugins/observability/public/components/alerts_table/common/cell_tooltip.test.tsx b/x-pack/plugins/observability/public/components/alerts_table/common/cell_tooltip.test.tsx
new file mode 100644
index 0000000000000..b4eb7e7f3801e
--- /dev/null
+++ b/x-pack/plugins/observability/public/components/alerts_table/common/cell_tooltip.test.tsx
@@ -0,0 +1,22 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+import { fireEvent, render, screen, waitFor } from '@testing-library/react';
+import { CellTooltip } from './cell_tooltip';
+
+describe('CellTooltip', () => {
+ it('should render tooltipContent on hover', async () => {
+ render();
+
+ fireEvent.mouseOver(screen.getByText('cell value'));
+
+ await waitFor(() => screen.getByTestId('cell-tooltip'));
+
+ expect(screen.getByText('tooltip content')).toBeInTheDocument();
+ });
+});
diff --git a/x-pack/plugins/observability/public/components/alerts_table/common/cell_tooltip.tsx b/x-pack/plugins/observability/public/components/alerts_table/common/cell_tooltip.tsx
new file mode 100644
index 0000000000000..0298f1a3f1d47
--- /dev/null
+++ b/x-pack/plugins/observability/public/components/alerts_table/common/cell_tooltip.tsx
@@ -0,0 +1,22 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+import { EuiToolTip } from '@elastic/eui';
+
+interface Props {
+ value: string;
+ tooltipContent: string;
+}
+
+export function CellTooltip({ value, tooltipContent }: Props) {
+ return (
+
+ <>{value}>
+
+ );
+}
diff --git a/x-pack/plugins/observability/public/components/alerts_table/common/get_columns.tsx b/x-pack/plugins/observability/public/components/alerts_table/common/get_columns.tsx
new file mode 100644
index 0000000000000..2d2c1b1c299cf
--- /dev/null
+++ b/x-pack/plugins/observability/public/components/alerts_table/common/get_columns.tsx
@@ -0,0 +1,131 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+/**
+ * We need to produce types and code transpilation at different folders during the build of the package.
+ * We have types and code at different imports because we don't want to import the whole package in the resulting webpack bundle for the plugin.
+ * This way plugins can do targeted imports to reduce the final code bundle
+ */
+import {
+ ALERT_EVALUATION_VALUE,
+ ALERT_EVALUATION_THRESHOLD,
+ ALERT_DURATION,
+ ALERT_REASON,
+ ALERT_RULE_NAME,
+ ALERT_START,
+ ALERT_STATUS,
+ ALERT_INSTANCE_ID,
+ TAGS,
+} from '@kbn/rule-data-utils';
+import { EuiDataGridColumn } from '@elastic/eui';
+import type { ColumnHeaderOptions } from '@kbn/timelines-plugin/common';
+import { i18n } from '@kbn/i18n';
+
+/**
+ * columns implements a subset of `EuiDataGrid`'s `EuiDataGridColumn` interface,
+ * plus additional TGrid column properties
+ */
+export const getColumns = (
+ {
+ showRuleName,
+ }: {
+ showRuleName?: boolean;
+ } = { showRuleName: false }
+): Array<
+ Pick & ColumnHeaderOptions
+> => {
+ const ruleNameColumn: Array<
+ Pick &
+ ColumnHeaderOptions
+ > = showRuleName
+ ? [
+ {
+ columnHeaderType: 'not-filtered',
+ displayAsText: i18n.translate(
+ 'xpack.observability.alertsTGrid.ruleNameColumnDescription',
+ {
+ defaultMessage: 'Rule name',
+ }
+ ),
+ id: ALERT_RULE_NAME,
+ initialWidth: 150,
+ },
+ ]
+ : [];
+
+ return [
+ {
+ columnHeaderType: 'not-filtered',
+ displayAsText: i18n.translate('xpack.observability.alertsTGrid.statusColumnDescription', {
+ defaultMessage: 'Alert Status',
+ }),
+ id: ALERT_STATUS,
+ initialWidth: 120,
+ },
+ {
+ columnHeaderType: 'not-filtered',
+ displayAsText: i18n.translate('xpack.observability.alertsTGrid.triggeredColumnDescription', {
+ defaultMessage: 'Triggered',
+ }),
+ id: ALERT_START,
+ initialWidth: 190,
+ schema: 'datetime',
+ },
+ {
+ columnHeaderType: 'not-filtered',
+ displayAsText: i18n.translate('xpack.observability.alertsTGrid.durationColumnDescription', {
+ defaultMessage: 'Duration',
+ }),
+ id: ALERT_DURATION,
+ initialWidth: 70,
+ },
+ ...ruleNameColumn,
+ {
+ columnHeaderType: 'not-filtered',
+ displayAsText: i18n.translate('xpack.observability.alertsTGrid.sourceColumnDescription', {
+ defaultMessage: 'Group',
+ }),
+ id: ALERT_INSTANCE_ID,
+ initialWidth: 100,
+ },
+ {
+ columnHeaderType: 'not-filtered',
+ displayAsText: i18n.translate(
+ 'xpack.observability.alertsTGrid.observedValueColumnDescription',
+ {
+ defaultMessage: 'Observed value',
+ }
+ ),
+ id: ALERT_EVALUATION_VALUE,
+ initialWidth: 100,
+ },
+ {
+ columnHeaderType: 'not-filtered',
+ displayAsText: i18n.translate('xpack.observability.alertsTGrid.thresholdColumnDescription', {
+ defaultMessage: 'Threshold',
+ }),
+ id: ALERT_EVALUATION_THRESHOLD,
+ initialWidth: 100,
+ },
+ {
+ columnHeaderType: 'not-filtered',
+ displayAsText: i18n.translate('xpack.observability.alertsTGrid.tagsColumnDescription', {
+ defaultMessage: 'Tags',
+ }),
+ id: TAGS,
+ initialWidth: 150,
+ },
+ {
+ columnHeaderType: 'not-filtered',
+ displayAsText: i18n.translate('xpack.observability.alertsTGrid.reasonColumnDescription', {
+ defaultMessage: 'Reason',
+ }),
+ id: ALERT_REASON,
+ linkField: '*',
+ },
+ ];
+};
diff --git a/x-pack/plugins/observability/public/components/alerts_table/render_cell_value.test.tsx b/x-pack/plugins/observability/public/components/alerts_table/common/render_cell_value.test.tsx
similarity index 93%
rename from x-pack/plugins/observability/public/components/alerts_table/render_cell_value.test.tsx
rename to x-pack/plugins/observability/public/components/alerts_table/common/render_cell_value.test.tsx
index 39ea7dea2ffbd..91c6e8d2c3b4a 100644
--- a/x-pack/plugins/observability/public/components/alerts_table/render_cell_value.test.tsx
+++ b/x-pack/plugins/observability/public/components/alerts_table/common/render_cell_value.test.tsx
@@ -7,8 +7,8 @@
import { ALERT_STATUS, ALERT_STATUS_ACTIVE, ALERT_STATUS_RECOVERED } from '@kbn/rule-data-utils';
import type { DeprecatedCellValueElementProps } from '@kbn/timelines-plugin/common';
-import { createObservabilityRuleTypeRegistryMock } from '../../rules/observability_rule_type_registry_mock';
-import { render } from '../../utils/test_helper';
+import { createObservabilityRuleTypeRegistryMock } from '../../../rules/observability_rule_type_registry_mock';
+import { render } from '../../../utils/test_helper';
import { getRenderCellValue } from './render_cell_value';
interface AlertsTableRow {
diff --git a/x-pack/plugins/observability/public/components/alerts_table/render_cell_value.tsx b/x-pack/plugins/observability/public/components/alerts_table/common/render_cell_value.tsx
similarity index 76%
rename from x-pack/plugins/observability/public/components/alerts_table/render_cell_value.tsx
rename to x-pack/plugins/observability/public/components/alerts_table/common/render_cell_value.tsx
index 258a15d6721be..3bde70900d334 100644
--- a/x-pack/plugins/observability/public/components/alerts_table/render_cell_value.tsx
+++ b/x-pack/plugins/observability/public/components/alerts_table/common/render_cell_value.tsx
@@ -16,16 +16,21 @@ import {
ALERT_REASON,
TIMESTAMP,
ALERT_UUID,
+ ALERT_EVALUATION_VALUE,
+ ALERT_EVALUATION_VALUES,
+ ALERT_RULE_NAME,
+ ALERT_RULE_CATEGORY,
} from '@kbn/rule-data-utils';
import { isEmpty } from 'lodash';
import type { TimelineNonEcsData } from '@kbn/timelines-plugin/common';
-import { asDuration } from '../../../common/utils/formatters';
-import { AlertSeverityBadge } from '../alert_severity_badge';
-import { AlertStatusIndicator } from '../alert_status_indicator';
+import { asDuration } from '../../../../common/utils/formatters';
+import { AlertSeverityBadge } from '../../alert_severity_badge';
+import { AlertStatusIndicator } from '../../alert_status_indicator';
+import { parseAlert } from '../../../pages/alerts/helpers/parse_alert';
+import type { ObservabilityRuleTypeRegistry } from '../../../rules/create_observability_rule_type_registry';
+import { CellTooltip } from './cell_tooltip';
import { TimestampTooltip } from './timestamp_tooltip';
-import { parseAlert } from '../../pages/alerts/helpers/parse_alert';
-import type { ObservabilityRuleTypeRegistry } from '../../rules/create_observability_rule_type_registry';
export const getMappedNonEcsValue = ({
data,
@@ -56,7 +61,7 @@ const getRenderValue = (mappedNonEcsValue: any) => {
return value;
}
- return '—-';
+ return '--';
};
/**
@@ -78,7 +83,6 @@ export const getRenderCellValue = ({
data,
fieldName: columnId,
});
-
const value = getRenderValue(mappedNonEcsValue);
switch (columnId) {
@@ -95,6 +99,12 @@ export const getRenderCellValue = ({
return asDuration(Number(value));
case ALERT_SEVERITY:
return ;
+ case ALERT_EVALUATION_VALUE:
+ const values = getMappedNonEcsValue({
+ data,
+ fieldName: ALERT_EVALUATION_VALUES,
+ });
+ return values ? values : value;
case ALERT_REASON:
const dataFieldEs = data.reduce((acc, d) => ({ ...acc, [d.field]: d.value }), {});
const alert = parseAlert(observabilityRuleTypeRegistry)(dataFieldEs);
@@ -108,6 +118,13 @@ export const getRenderCellValue = ({
{alert.reason}
);
+ case ALERT_RULE_NAME:
+ const ruleCategory = getMappedNonEcsValue({
+ data,
+ fieldName: ALERT_RULE_CATEGORY,
+ });
+ const tooltipContent = getRenderValue(ruleCategory);
+ return ;
default:
return <>{value}>;
}
diff --git a/x-pack/plugins/observability/public/components/alerts_table/timestamp_tooltip.test.tsx b/x-pack/plugins/observability/public/components/alerts_table/common/timestamp_tooltip.test.tsx
similarity index 100%
rename from x-pack/plugins/observability/public/components/alerts_table/timestamp_tooltip.test.tsx
rename to x-pack/plugins/observability/public/components/alerts_table/common/timestamp_tooltip.test.tsx
diff --git a/x-pack/plugins/observability/public/components/alerts_table/timestamp_tooltip.tsx b/x-pack/plugins/observability/public/components/alerts_table/common/timestamp_tooltip.tsx
similarity index 88%
rename from x-pack/plugins/observability/public/components/alerts_table/timestamp_tooltip.tsx
rename to x-pack/plugins/observability/public/components/alerts_table/common/timestamp_tooltip.tsx
index 42a26e9e52b94..7b82455ad5932 100644
--- a/x-pack/plugins/observability/public/components/alerts_table/timestamp_tooltip.tsx
+++ b/x-pack/plugins/observability/public/components/alerts_table/common/timestamp_tooltip.tsx
@@ -7,7 +7,7 @@
import React from 'react';
import { EuiToolTip } from '@elastic/eui';
-import { asAbsoluteDateTime, TimeUnit } from '../../../common/utils/formatters/datetime';
+import { asAbsoluteDateTime, TimeUnit } from '../../../../common/utils/formatters/datetime';
interface Props {
/**
diff --git a/x-pack/plugins/observability/public/components/alerts_table/default_columns.tsx b/x-pack/plugins/observability/public/components/alerts_table/default_columns.tsx
deleted file mode 100644
index 65f1b50092382..0000000000000
--- a/x-pack/plugins/observability/public/components/alerts_table/default_columns.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-/**
- * We need to produce types and code transpilation at different folders during the build of the package.
- * We have types and code at different imports because we don't want to import the whole package in the resulting webpack bundle for the plugin.
- * This way plugins can do targeted imports to reduce the final code bundle
- */
-import { ALERT_DURATION, ALERT_REASON, ALERT_STATUS, TIMESTAMP } from '@kbn/rule-data-utils';
-import { EuiDataGridColumn } from '@elastic/eui';
-import type { ColumnHeaderOptions } from '@kbn/timelines-plugin/common';
-import { i18n } from '@kbn/i18n';
-
-/**
- * columns implements a subset of `EuiDataGrid`'s `EuiDataGridColumn` interface,
- * plus additional TGrid column properties
- */
-export const columns: Array<
- Pick & ColumnHeaderOptions
-> = [
- {
- columnHeaderType: 'not-filtered',
- displayAsText: i18n.translate('xpack.observability.alertsTGrid.statusColumnDescription', {
- defaultMessage: 'Alert Status',
- }),
- id: ALERT_STATUS,
- initialWidth: 140,
- },
- {
- columnHeaderType: 'not-filtered',
- displayAsText: i18n.translate('xpack.observability.alertsTGrid.lastUpdatedColumnDescription', {
- defaultMessage: 'Last updated',
- }),
- id: TIMESTAMP,
- initialWidth: 230,
- schema: 'datetime',
- },
- {
- columnHeaderType: 'not-filtered',
- displayAsText: i18n.translate('xpack.observability.alertsTGrid.durationColumnDescription', {
- defaultMessage: 'Duration',
- }),
- id: ALERT_DURATION,
- initialWidth: 116,
- },
- {
- columnHeaderType: 'not-filtered',
- displayAsText: i18n.translate('xpack.observability.alertsTGrid.reasonColumnDescription', {
- defaultMessage: 'Reason',
- }),
- id: ALERT_REASON,
- linkField: '*',
- },
-];
diff --git a/x-pack/plugins/observability/public/components/alerts_table/register_alerts_table_configuration.tsx b/x-pack/plugins/observability/public/components/alerts_table/register_alerts_table_configuration.tsx
new file mode 100644
index 0000000000000..1ac236f83608b
--- /dev/null
+++ b/x-pack/plugins/observability/public/components/alerts_table/register_alerts_table_configuration.tsx
@@ -0,0 +1,40 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { AlertTableConfigRegistry } from '@kbn/triggers-actions-ui-plugin/public/application/alert_table_config_registry';
+import type { ConfigSchema } from '../../plugin';
+import { ObservabilityRuleTypeRegistry } from '../..';
+import { getAlertsPageTableConfiguration } from './alerts/get_alerts_page_table_configuration';
+import { getRuleDetailsTableConfiguration } from './rule_details/get_rule_details_table_configuration';
+import { getSloAlertsTableConfiguration } from './slo/get_slo_alerts_table_configuration';
+
+export const registerAlertsTableConfiguration = (
+ alertTableConfigRegistry: AlertTableConfigRegistry,
+ observabilityRuleTypeRegistry: ObservabilityRuleTypeRegistry,
+ config: ConfigSchema
+) => {
+ // Alert page
+ const alertsPageAlertsTableConfig = getAlertsPageTableConfiguration(
+ observabilityRuleTypeRegistry,
+ config
+ );
+ alertTableConfigRegistry.register(alertsPageAlertsTableConfig);
+
+ // Rule details page
+ const ruleDetailsAlertsTableConfig = getRuleDetailsTableConfiguration(
+ observabilityRuleTypeRegistry,
+ config
+ );
+ alertTableConfigRegistry.register(ruleDetailsAlertsTableConfig);
+
+ // SLO
+ const sloAlertsTableConfig = getSloAlertsTableConfiguration(
+ observabilityRuleTypeRegistry,
+ config
+ );
+ alertTableConfigRegistry.register(sloAlertsTableConfig);
+};
diff --git a/x-pack/plugins/observability/public/components/alerts_table/rule_details/get_rule_details_table_configuration.tsx b/x-pack/plugins/observability/public/components/alerts_table/rule_details/get_rule_details_table_configuration.tsx
new file mode 100644
index 0000000000000..369a3d4c5c12d
--- /dev/null
+++ b/x-pack/plugins/observability/public/components/alerts_table/rule_details/get_rule_details_table_configuration.tsx
@@ -0,0 +1,59 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+import { TIMESTAMP } from '@kbn/rule-data-utils';
+import { SortOrder } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
+import {
+ AlertsTableConfigurationRegistry,
+ RenderCustomActionsRowArgs,
+} from '@kbn/triggers-actions-ui-plugin/public/types';
+import { RULE_DETAILS_ALERTS_TABLE_CONFIG_ID } from '../../../constants';
+import { casesFeatureId, observabilityFeatureId } from '../../../../common';
+import { AlertActions } from '../../../pages/alerts/components/alert_actions';
+import { useGetAlertFlyoutComponents } from '../../alerts_flyout/use_get_alert_flyout_components';
+import type { ObservabilityRuleTypeRegistry } from '../../../rules/create_observability_rule_type_registry';
+import type { ConfigSchema } from '../../../plugin';
+import { getRenderCellValue } from '../common/render_cell_value';
+import { getColumns } from '../common/get_columns';
+
+export const getRuleDetailsTableConfiguration = (
+ observabilityRuleTypeRegistry: ObservabilityRuleTypeRegistry,
+ config: ConfigSchema
+): AlertsTableConfigurationRegistry => ({
+ id: RULE_DETAILS_ALERTS_TABLE_CONFIG_ID,
+ cases: { featureId: casesFeatureId, owner: [observabilityFeatureId] },
+ columns: getColumns(),
+ getRenderCellValue: ({ setFlyoutAlert }) =>
+ getRenderCellValue({
+ observabilityRuleTypeRegistry,
+ setFlyoutAlert,
+ }),
+ sort: [
+ {
+ [TIMESTAMP]: {
+ order: 'desc' as SortOrder,
+ },
+ },
+ ],
+ useActionsColumn: () => ({
+ renderCustomActionsRow: (props: RenderCustomActionsRowArgs) => {
+ return (
+
+ );
+ },
+ }),
+ useInternalFlyout: () => {
+ const { header, body, footer } = useGetAlertFlyoutComponents(observabilityRuleTypeRegistry);
+ return { header, body, footer };
+ },
+ ruleTypeIds: observabilityRuleTypeRegistry.list(),
+});
diff --git a/x-pack/plugins/observability/public/components/alerts_table/slo/get_slo_alerts_table_configuration.tsx b/x-pack/plugins/observability/public/components/alerts_table/slo/get_slo_alerts_table_configuration.tsx
index d43c12c4627ed..9bebb82234df6 100644
--- a/x-pack/plugins/observability/public/components/alerts_table/slo/get_slo_alerts_table_configuration.tsx
+++ b/x-pack/plugins/observability/public/components/alerts_table/slo/get_slo_alerts_table_configuration.tsx
@@ -5,32 +5,32 @@
* 2.0.
*/
-import type { GetRenderCellValue } from '@kbn/triggers-actions-ui-plugin/public';
-import { TIMESTAMP } from '@kbn/rule-data-utils';
import { SortOrder } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
+import { ALERT_DURATION } from '@kbn/rule-data-utils';
import { AlertsTableConfigurationRegistry } from '@kbn/triggers-actions-ui-plugin/public/types';
import { casesFeatureId, observabilityFeatureId } from '../../../../common';
-import { getRenderCellValue } from './render_cell_value';
+import { getRenderCellValue } from '../common/render_cell_value';
import { columns } from './default_columns';
import { useGetAlertFlyoutComponents } from '../../alerts_flyout/use_get_alert_flyout_components';
import type { ObservabilityRuleTypeRegistry } from '../../../rules/create_observability_rule_type_registry';
import type { ConfigSchema } from '../../../plugin';
-import type { TopAlert } from '../../../typings/alerts';
-import { SLO_ALERTS_TABLE_CONFID } from '../../../embeddable/slo/constants';
+import { SLO_ALERTS_TABLE_CONFIG_ID } from '../../../embeddable/slo/constants';
export const getSloAlertsTableConfiguration = (
observabilityRuleTypeRegistry: ObservabilityRuleTypeRegistry,
config: ConfigSchema
): AlertsTableConfigurationRegistry => ({
- id: SLO_ALERTS_TABLE_CONFID,
+ id: SLO_ALERTS_TABLE_CONFIG_ID,
cases: { featureId: casesFeatureId, owner: [observabilityFeatureId] },
columns,
- getRenderCellValue: (({ setFlyoutAlert }: { setFlyoutAlert: (data: TopAlert) => void }) => {
- return getRenderCellValue({ observabilityRuleTypeRegistry, setFlyoutAlert });
- }) as unknown as GetRenderCellValue,
+ getRenderCellValue: ({ setFlyoutAlert }) =>
+ getRenderCellValue({
+ observabilityRuleTypeRegistry,
+ setFlyoutAlert,
+ }),
sort: [
{
- [TIMESTAMP]: {
+ [ALERT_DURATION]: {
order: 'desc' as SortOrder,
},
},
diff --git a/x-pack/plugins/observability/public/components/alerts_table/slo/render_cell_value.tsx b/x-pack/plugins/observability/public/components/alerts_table/slo/render_cell_value.tsx
deleted file mode 100644
index a7c5f7c71d535..0000000000000
--- a/x-pack/plugins/observability/public/components/alerts_table/slo/render_cell_value.tsx
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-import { EuiLink } from '@elastic/eui';
-import React from 'react';
-import {
- ALERT_DURATION,
- ALERT_RULE_NAME,
- ALERT_STATUS,
- ALERT_STATUS_ACTIVE,
- ALERT_STATUS_RECOVERED,
- ALERT_REASON,
- TIMESTAMP,
-} from '@kbn/rule-data-utils';
-import { isEmpty } from 'lodash';
-import type {
- DeprecatedCellValueElementProps,
- TimelineNonEcsData,
-} from '@kbn/timelines-plugin/common';
-
-import { asDuration } from '../../../../common/utils/formatters';
-import { AlertStatusIndicator } from '../../alert_status_indicator';
-import { TimestampTooltip } from '../timestamp_tooltip';
-import { parseAlert } from '../../../pages/alerts/helpers/parse_alert';
-import type { ObservabilityRuleTypeRegistry } from '../../../rules/create_observability_rule_type_registry';
-import type { TopAlert } from '../../../typings/alerts';
-
-export const getMappedNonEcsValue = ({
- data,
- fieldName,
-}: {
- data: TimelineNonEcsData[];
- fieldName: string;
-}): string[] | undefined => {
- const item = data.find((d) => d.field === fieldName);
- if (item != null && item.value != null) {
- return item.value;
- }
- return undefined;
-};
-
-const getRenderValue = (mappedNonEcsValue: any) => {
- // can be updated when working on https://github.com/elastic/kibana/issues/140819
- const value = Array.isArray(mappedNonEcsValue) ? mappedNonEcsValue.join() : mappedNonEcsValue;
-
- if (!isEmpty(value)) {
- if (typeof value === 'object') {
- return JSON.stringify(value);
- }
- return value;
- }
-
- return '—';
-};
-
-/**
- * This implementation of `EuiDataGrid`'s `renderCellValue`
- * accepts `EuiDataGridCellValueElementProps`, plus `data`
- * from the TGrid
- */
-
-export const getRenderCellValue = ({
- setFlyoutAlert,
- observabilityRuleTypeRegistry,
-}: {
- setFlyoutAlert: (data: TopAlert) => void;
- observabilityRuleTypeRegistry: ObservabilityRuleTypeRegistry;
-}) => {
- return ({ columnId, data }: DeprecatedCellValueElementProps) => {
- if (!data) return null;
- const mappedNonEcsValue = getMappedNonEcsValue({
- data,
- fieldName: columnId,
- });
- const value = getRenderValue(mappedNonEcsValue);
-
- switch (columnId) {
- case ALERT_STATUS:
- if (value !== ALERT_STATUS_ACTIVE && value !== ALERT_STATUS_RECOVERED) {
- // NOTE: This should only be needed to narrow down the type.
- // Status should be either "active" or "recovered".
- return null;
- }
- return ;
- case TIMESTAMP:
- return ;
- case ALERT_DURATION:
- return asDuration(Number(value));
- case ALERT_RULE_NAME:
- return value;
- case ALERT_REASON:
- const dataFieldEs = data.reduce((acc, d) => ({ ...acc, [d.field]: d.value }), {});
- const alert = parseAlert(observabilityRuleTypeRegistry)(dataFieldEs);
-
- return (
- setFlyoutAlert && setFlyoutAlert(alert)}
- >
- {alert.reason}
-
- );
- default:
- return <>{value}>;
- }
- };
-};
diff --git a/x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.tsx b/x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.tsx
index 3369cb6ac63ae..d5022c2dc1f7d 100644
--- a/x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.tsx
+++ b/x-pack/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.tsx
@@ -83,6 +83,9 @@ export default function AlertDetailsAppSection({
};
const timeRange = getPaddedAlertTimeRange(alert.fields[ALERT_START]!, alert.fields[ALERT_END]);
const alertEnd = alert.fields[ALERT_END] ? moment(alert.fields[ALERT_END]).valueOf() : undefined;
+ const groups = alert.fields[ALERT_GROUP];
+ const tags = alert.fields[TAGS];
+
const annotations = [
{
- const groups = alert.fields[ALERT_GROUP];
- const tags = alert.fields[TAGS];
const alertSummaryFields = [];
if (groups) {
alertSummaryFields.push({
@@ -141,7 +142,7 @@ export default function AlertDetailsAppSection({
});
setAlertSummaryFields(alertSummaryFields);
- }, [alert, rule, ruleLink, setAlertSummaryFields]);
+ }, [groups, tags, rule, ruleLink, setAlertSummaryFields]);
const derivedIndexPattern = useMemo(
() => ({
diff --git a/x-pack/plugins/observability/public/components/slo/burn_rate/alert_details/alert_details_app_section.tsx b/x-pack/plugins/observability/public/components/slo/burn_rate/alert_details/alert_details_app_section.tsx
index 44f1e60a06f72..26512aef807d5 100644
--- a/x-pack/plugins/observability/public/components/slo/burn_rate/alert_details/alert_details_app_section.tsx
+++ b/x-pack/plugins/observability/public/components/slo/burn_rate/alert_details/alert_details_app_section.tsx
@@ -43,6 +43,7 @@ export default function AlertDetailsAppSection({
const sloId = alert.fields['kibana.alert.rule.parameters']!.sloId as string;
const instanceId = alert.fields['kibana.alert.instance.id']!;
const { isLoading, data: slo } = useFetchSloDetails({ sloId, instanceId });
+ const alertLink = alert.link;
useEffect(() => {
setAlertSummaryFields([
@@ -54,7 +55,7 @@ export default function AlertDetailsAppSection({
}
),
value: (
-
+
{slo?.name ?? '-'}
),
@@ -73,7 +74,7 @@ export default function AlertDetailsAppSection({
),
},
]);
- }, [alert, rule, ruleLink, setAlertSummaryFields, basePath, slo]);
+ }, [alertLink, rule, ruleLink, setAlertSummaryFields, basePath, slo]);
return (
diff --git a/x-pack/plugins/observability/public/constants.ts b/x-pack/plugins/observability/public/constants.ts
index 40d24b18340bc..cea913c2e548b 100644
--- a/x-pack/plugins/observability/public/constants.ts
+++ b/x-pack/plugins/observability/public/constants.ts
@@ -9,3 +9,5 @@ export const DEFAULT_INTERVAL = '60s';
export const DEFAULT_DATE_FORMAT = 'YYYY-MM-DD HH:mm';
export const SLO_LONG_REFETCH_INTERVAL = 60 * 1000; // 1 minute
export const SLO_SHORT_REFETCH_INTERVAL = 5 * 1000; // 5 seconds
+
+export const RULE_DETAILS_ALERTS_TABLE_CONFIG_ID = `rule-details-alerts-table`;
diff --git a/x-pack/plugins/observability/public/embeddable/slo/alerts/components/slo_alerts_table.tsx b/x-pack/plugins/observability/public/embeddable/slo/alerts/components/slo_alerts_table.tsx
index 9df76482e4f39..d0d7739729903 100644
--- a/x-pack/plugins/observability/public/embeddable/slo/alerts/components/slo_alerts_table.tsx
+++ b/x-pack/plugins/observability/public/embeddable/slo/alerts/components/slo_alerts_table.tsx
@@ -11,7 +11,7 @@ import { ALL_VALUE } from '@kbn/slo-schema';
import { AlertsTableStateProps } from '@kbn/triggers-actions-ui-plugin/public/application/sections/alerts_table/alerts_table_state';
import { SloEmbeddableDeps } from '../slo_alerts_embeddable';
import type { SloItem } from '../types';
-import { SLO_ALERTS_TABLE_CONFID } from '../../constants';
+import { SLO_ALERTS_TABLE_CONFIG_ID } from '../../constants';
const ALERTS_PER_PAGE = 10;
const ALERTS_TABLE_ID = 'xpack.observability.sloAlertsEmbeddable.alert.table';
@@ -86,7 +86,7 @@ export function SloAlertsTable({ slos, deps, timeRange, onLoaded, lastReloadRequ
{
+ return mixKqlWithTags(kqlQuery, tags);
+ }, [kqlQuery, tags]);
+
const { isInitialLoading, isLoading, isError, isSuccess, isRefetching, data } = useQuery({
queryKey: sloKeys.list({
- kqlQuery,
+ kqlQuery: kqlQueryValue,
page,
perPage,
sortBy,
@@ -82,7 +89,7 @@ export function useFetchSloList({
queryFn: async ({ signal }) => {
return await http.get(`/api/observability/slos`, {
query: {
- ...(kqlQuery && { kqlQuery }),
+ ...(kqlQueryValue && { kqlQuery: kqlQueryValue }),
...(sortBy && { sortBy }),
...(sortDirection && { sortDirection }),
...(page && { page }),
@@ -123,3 +130,28 @@ export function useFetchSloList({
isError,
};
}
+
+const mixKqlWithTags = (kqlQuery: string, tags: SearchState['tags']) => {
+ if (!tags) {
+ return kqlQuery;
+ }
+ const tagsKqlIncluded = tags.included?.join(' or ') || '';
+ const excludedTagsKql = tags.excluded?.join(' or ') || '';
+
+ let tagsQuery = '';
+ if (tagsKqlIncluded && excludedTagsKql) {
+ tagsQuery = `slo.tags: (${excludedTagsKql}) and not slo.tags: (${tagsKqlIncluded})`;
+ }
+ if (!excludedTagsKql && tagsKqlIncluded) {
+ tagsQuery = `slo.tags: (${tagsKqlIncluded})`;
+ }
+ if (!tagsKqlIncluded && excludedTagsKql) {
+ tagsQuery = `not slo.tags: (${excludedTagsKql})`;
+ }
+
+ if (!kqlQuery) {
+ return tagsQuery;
+ }
+
+ return `${kqlQuery} and ${tagsQuery}`;
+};
diff --git a/x-pack/plugins/observability/public/pages/alert_details/alert_details.tsx b/x-pack/plugins/observability/public/pages/alert_details/alert_details.tsx
index feb7e06e0ae51..6ce338358c646 100644
--- a/x-pack/plugins/observability/public/pages/alert_details/alert_details.tsx
+++ b/x-pack/plugins/observability/public/pages/alert_details/alert_details.tsx
@@ -161,9 +161,9 @@ export function AlertDetails() {
- {AlertDetailsAppSection && rule && (
+ {AlertDetailsAppSection && rule && alertDetail?.formatted && (
>>(
- SORT_OPTIONS.map((option) => ({
- ...option,
- checked: option.type === initialState.sort.by ? 'on' : undefined,
- }))
- );
-
- const selectedSort = sortOptions.find((option) => option.checked === 'on');
-
- const handleToggleSortButton = () => setSortPopoverOpen(!isSortPopoverOpen);
- const handleChangeSort = (newOptions: Array- >) => {
- setSortOptions(newOptions);
- setSortPopoverOpen(false);
- onStateChange({
- page: 0,
- sort: { by: newOptions.find((o) => o.checked)!.type, direction: initialState.sort.direction },
- });
- };
-
return (
-
-
- {i18n.translate('xpack.observability.slo.list.sortByType', {
- defaultMessage: 'Sort by {type}',
- values: { type: selectedSort?.label.toLowerCase() ?? '' },
- })}
-
- }
- isOpen={isSortPopoverOpen}
- closePopover={handleToggleSortButton}
- panelPaddingSize="none"
- anchorPosition="downCenter"
- >
-
-
- {i18n.translate('xpack.observability.slo.list.sortBy', {
- defaultMessage: 'Sort by',
- })}
-
- >
- singleSelection="always"
- options={sortOptions}
- onChange={handleChangeSort}
- isLoading={loading}
- >
- {(list) => list}
-
-
-
-
+ {
+ onStateChange({
+ page: 0,
+ sort: { by: evt.target.value as SortField, direction: initialState.sort.direction },
+ });
+ }}
+ />
);
}
-const SORT_OPTIONS: Array- > = [
+const SORT_OPTIONS: EuiSelectOption[] = [
{
- label: i18n.translate('xpack.observability.slo.list.sortBy.sliValue', {
+ text: i18n.translate('xpack.observability.slo.list.sortBy.sliValue', {
defaultMessage: 'SLI value',
}),
- type: 'sli_value',
+ value: 'sli_value',
},
{
- label: i18n.translate('xpack.observability.slo.list.sortBy.sloStatus', {
+ text: i18n.translate('xpack.observability.slo.list.sortBy.sloStatus', {
defaultMessage: 'SLO status',
}),
- type: 'status',
+ value: 'status',
},
{
- label: i18n.translate('xpack.observability.slo.list.sortBy.errorBudgetConsumed', {
+ text: i18n.translate('xpack.observability.slo.list.sortBy.errorBudgetConsumed', {
defaultMessage: 'Error budget consumed',
}),
- type: 'error_budget_consumed',
+ value: 'error_budget_consumed',
},
{
- label: i18n.translate('xpack.observability.slo.list.sortBy.errorBudgetRemaining', {
+ text: i18n.translate('xpack.observability.slo.list.sortBy.errorBudgetRemaining', {
defaultMessage: 'Error budget remaining',
}),
- type: 'error_budget_remaining',
+ value: 'error_budget_remaining',
},
];
+
+const SORT_BY_LABEL = i18n.translate('xpack.observability.slo.list.sortByTypeLabel', {
+ defaultMessage: 'Sort by',
+});
diff --git a/x-pack/plugins/observability/public/pages/slos/components/common/tags_filter.tsx b/x-pack/plugins/observability/public/pages/slos/components/common/tags_filter.tsx
new file mode 100644
index 0000000000000..0456db56e15a4
--- /dev/null
+++ b/x-pack/plugins/observability/public/pages/slos/components/common/tags_filter.tsx
@@ -0,0 +1,48 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { EuiFilterGroup } from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
+import React from 'react';
+import { FieldValueSuggestions } from '@kbn/observability-shared-plugin/public';
+import { SLO_SUMMARY_DESTINATION_INDEX_NAME } from '../../../../../common/slo/constants';
+import { SearchState } from '../../hooks/use_url_search_state';
+
+interface Props {
+ initialState: SearchState;
+ loading: boolean;
+ onStateChange: (newState: Partial) => void;
+}
+
+export function TagsFilter({ initialState, onStateChange, loading }: Props) {
+ return (
+
+ {
+ onStateChange({
+ tags: {
+ included: val,
+ excluded: excludedValue,
+ },
+ });
+ }}
+ />
+
+ );
+}
+
+const TAGS_LABEL = i18n.translate('xpack.observability.slo.list.tags', {
+ defaultMessage: 'Tags',
+});
diff --git a/x-pack/plugins/observability/public/pages/slos/components/compact_view/slo_list_compact_view.tsx b/x-pack/plugins/observability/public/pages/slos/components/compact_view/slo_list_compact_view.tsx
index d884de55aed54..177be6f062923 100644
--- a/x-pack/plugins/observability/public/pages/slos/components/compact_view/slo_list_compact_view.tsx
+++ b/x-pack/plugins/observability/public/pages/slos/components/compact_view/slo_list_compact_view.tsx
@@ -22,7 +22,6 @@ import React, { useState } from 'react';
import { useCloneSlo } from '../../../../hooks/slo/use_clone_slo';
import { rulesLocatorID, sloFeatureId } from '../../../../../common';
import { SLO_BURN_RATE_RULE_TYPE_ID } from '../../../../../common/constants';
-import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n';
import { paths } from '../../../../../common/locators/paths';
import { SloDeleteConfirmationModal } from '../../../../components/slo/delete_confirmation_modal/slo_delete_confirmation_modal';
import { SloStatusBadge } from '../../../../components/slo/slo_status_badge';
@@ -41,6 +40,7 @@ import { SloRulesBadge } from '../badges/slo_rules_badge';
import { SloListEmpty } from '../slo_list_empty';
import { SloListError } from '../slo_list_error';
import { SloSparkline } from '../slo_sparkline';
+import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n';
export interface Props {
sloList: SLOWithSummaryResponse[];
@@ -374,7 +374,12 @@ export function SloListCompactView({ sloList, loading, error }: Props) {
return (
<>
- items={sloList} columns={columns} />
+
+ items={sloList}
+ columns={columns}
+ loading={loading}
+ noItemsMessage={loading ? LOADING_SLOS_LABEL : NO_SLOS_FOUND}
+ />
{sloToAddRule ? (
);
}
+
+const LOADING_SLOS_LABEL = i18n.translate('xpack.observability.slo.loadingSlosLabel', {
+ defaultMessage: 'Loading SLOs ...',
+});
+
+const NO_SLOS_FOUND = i18n.translate('xpack.observability.slo.noSlosFound', {
+ defaultMessage: 'No SLOs found',
+});
diff --git a/x-pack/plugins/observability/public/pages/slos/components/slo_list.tsx b/x-pack/plugins/observability/public/pages/slos/components/slo_list.tsx
index 893f866b3990b..592dcfa09f120 100644
--- a/x-pack/plugins/observability/public/pages/slos/components/slo_list.tsx
+++ b/x-pack/plugins/observability/public/pages/slos/components/slo_list.tsx
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { EuiFlexGroup, EuiFlexItem, EuiTablePagination } from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTablePagination } from '@elastic/eui';
import { useIsMutating } from '@tanstack/react-query';
import React from 'react';
import { CreateSloBtn } from './common/create_slo_btn';
@@ -17,7 +17,7 @@ import { ToggleSLOView } from './toggle_slo_view';
export function SloList() {
const { state, store: storeState } = useUrlSearchState();
- const { view, page, perPage, kqlQuery, filters, compact: isCompact } = state;
+ const { view, page, perPage, kqlQuery, filters, compact: isCompact, tags } = state;
const {
isLoading,
@@ -25,6 +25,7 @@ export function SloList() {
isError,
data: sloList,
} = useFetchSloList({
+ tags,
perPage,
filters,
page: page + 1,
@@ -63,6 +64,7 @@ export function SloList() {
+
onStateChange({ view: newView })}
onToggleCompactView={() => onStateChange({ compact: !isCompact })}
isCompact={isCompact}
+ loading={isLoading || isCreatingSlo || isCloningSlo || isUpdatingSlo || isDeletingSlo}
+ onStateChange={onStateChange}
+ initialState={state}
/>
(
-
+
)}
filters={filters}
onFiltersUpdated={(newFilters) => {
diff --git a/x-pack/plugins/observability/public/pages/slos/components/toggle_slo_view.tsx b/x-pack/plugins/observability/public/pages/slos/components/toggle_slo_view.tsx
index 15d376f1f0d10..b5fbadea522e5 100644
--- a/x-pack/plugins/observability/public/pages/slos/components/toggle_slo_view.tsx
+++ b/x-pack/plugins/observability/public/pages/slos/components/toggle_slo_view.tsx
@@ -10,6 +10,8 @@ import { i18n } from '@kbn/i18n';
import { EuiButtonGroup, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { FindSLOResponse } from '@kbn/slo-schema';
+import { SearchState } from '../hooks/use_url_search_state';
+import { SortBySelect } from './common/sort_by_select';
import { SLOViewSettings } from './slo_view_settings';
export type SLOView = 'cardView' | 'listView';
@@ -20,6 +22,9 @@ interface Props {
isCompact: boolean;
sloView: SLOView;
sloList?: FindSLOResponse;
+ loading: boolean;
+ initialState: SearchState;
+ onStateChange: (newState: Partial) => void;
}
const toggleButtonsIcons = [
@@ -43,6 +48,9 @@ export function ToggleSLOView({
onToggleCompactView,
isCompact = true,
sloList,
+ loading,
+ initialState,
+ onStateChange,
}: Props) {
const total = sloList?.total ?? 0;
const pageSize = sloList?.perPage ?? 0;
@@ -73,8 +81,12 @@ export function ToggleSLOView({
/>
+
+
+
{
+ return registerAlertsTableConfiguration(
+ alertsTableConfigurationRegistry,
+ this.observabilityRuleTypeRegistry,
+ config
+ );
+ });
pluginsStart.observabilityShared.updateGlobalNavigation({
capabilities: application.capabilities,
@@ -442,30 +460,6 @@ export class Plugin
updater$: this.appUpdater$,
});
- const getAsyncO11yAlertsTableConfiguration = async () => {
- const { getAlertsTableConfiguration } = await import(
- './components/alerts_table/get_alerts_table_configuration'
- );
- return getAlertsTableConfiguration(this.observabilityRuleTypeRegistry, config);
- };
-
- const { alertsTableConfigurationRegistry } = pluginsStart.triggersActionsUi;
-
- getAsyncO11yAlertsTableConfiguration().then((alertsTableConfig) => {
- alertsTableConfigurationRegistry.register(alertsTableConfig);
- });
-
- const getAsyncSloEmbeddableAlertsTableConfiguration = async () => {
- const { getSloAlertsTableConfiguration } = await import(
- './components/alerts_table/slo/get_slo_alerts_table_configuration'
- );
- return getSloAlertsTableConfiguration(this.observabilityRuleTypeRegistry, config);
- };
-
- getAsyncSloEmbeddableAlertsTableConfiguration().then((alertsTableConfig) => {
- alertsTableConfigurationRegistry.register(alertsTableConfig);
- });
-
return {
observabilityRuleTypeRegistry: this.observabilityRuleTypeRegistry,
useRulesLink: createUseRulesLink(),
diff --git a/x-pack/plugins/observability_ai_assistant/common/utils/throw_serialized_chat_completion_errors.ts b/x-pack/plugins/observability_ai_assistant/common/utils/throw_serialized_chat_completion_errors.ts
index 2a5099fa65b34..e79039c7e153d 100644
--- a/x-pack/plugins/observability_ai_assistant/common/utils/throw_serialized_chat_completion_errors.ts
+++ b/x-pack/plugins/observability_ai_assistant/common/utils/throw_serialized_chat_completion_errors.ts
@@ -11,13 +11,13 @@ import {
ChatCompletionErrorCode,
type StreamingChatResponseEvent,
StreamingChatResponseEventType,
- type StreamingChatResponseEventWithoutError,
+ type ChatCompletionErrorEvent,
} from '../conversation_complete';
export function throwSerializedChatCompletionErrors() {
- return (
+ return (
source$: Observable
- ): Observable => {
+ ): Observable> => {
return source$.pipe(
tap((event) => {
if (event.type === StreamingChatResponseEventType.ChatCompletionError) {
@@ -27,7 +27,7 @@ export function throwSerializedChatCompletionErrors() {
}
}),
filter(
- (event): event is StreamingChatResponseEventWithoutError =>
+ (event): event is Exclude =>
event.type !== StreamingChatResponseEventType.ChatCompletionError
)
);
diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.stories.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.stories.tsx
index 6d6b11b0ab097..69910bf74950e 100644
--- a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.stories.tsx
+++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.stories.tsx
@@ -61,7 +61,6 @@ const defaultProps: ComponentStoryObj = {
selectConnector: () => {},
reloadConnectors: () => {},
},
- connectorsManagementHref: '',
currentUser: {
username: 'elastic',
},
diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.tsx
index 15cd44119ce28..7906c63e823e2 100644
--- a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.tsx
+++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.tsx
@@ -34,7 +34,7 @@ import { ChatTimeline } from './chat_timeline';
import { Feedback } from '../feedback_buttons';
import { IncorrectLicensePanel } from './incorrect_license_panel';
import { WelcomeMessage } from './welcome_message';
-import { EMPTY_CONVERSATION_TITLE } from '../../i18n';
+import { ASSISTANT_SETUP_TITLE, EMPTY_CONVERSATION_TITLE, UPGRADE_LICENSE_TITLE } from '../../i18n';
import { ChatActionClickType } from './types';
import type { StartedFrom } from '../../utils/get_timeline_items_from_conversation';
import { TELEMETRY, sendEvent } from '../../analytics';
@@ -93,7 +93,6 @@ export function ChatBody({
initialConversationId,
connectors,
knowledgeBase,
- connectorsManagementHref,
currentUser,
startedFrom,
onConversationUpdate,
@@ -103,7 +102,6 @@ export function ChatBody({
initialConversationId?: string;
connectors: UseGenAIConnectorsResult;
knowledgeBase: UseKnowledgeBaseResult;
- connectorsManagementHref: string;
currentUser?: Pick;
startedFrom?: StartedFrom;
onConversationUpdate: (conversation: { conversation: Conversation['conversation'] }) => void;
@@ -135,6 +133,18 @@ export function ChatBody({
conversation.loading
);
+ let title = conversation.value?.conversation.title || initialTitle;
+
+ if (!title) {
+ if (!connectors.selectedConnector) {
+ title = ASSISTANT_SETUP_TITLE;
+ } else if (!hasCorrectLicense && !initialConversationId) {
+ title = UPGRADE_LICENSE_TITLE;
+ } else {
+ title = EMPTY_CONVERSATION_TITLE;
+ }
+ }
+
const containerClassName = css`
max-height: 100%;
max-width: ${startedFrom === 'conversationView'
@@ -391,12 +401,9 @@ export function ChatBody({
? conversation.value.conversation.id
: undefined
}
- connectorsManagementHref={connectorsManagementHref}
- knowledgeBase={knowledgeBase}
licenseInvalid={!hasCorrectLicense && !initialConversationId}
loading={isLoading}
- startedFrom={startedFrom}
- title={conversation.value?.conversation.title || initialTitle || EMPTY_CONVERSATION_TITLE}
+ title={title}
onCopyConversation={handleCopyConversation}
onSaveTitle={(newTitle) => {
saveTitle(newTitle);
diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_flyout.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_flyout.tsx
index babc7ec0f632c..050a17b14a820 100644
--- a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_flyout.tsx
+++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_flyout.tsx
@@ -11,10 +11,8 @@ import React, { useState } from 'react';
import type { Message } from '../../../common/types';
import { useCurrentUser } from '../../hooks/use_current_user';
import { useGenAIConnectors } from '../../hooks/use_genai_connectors';
-import { useKibana } from '../../hooks/use_kibana';
import { useKnowledgeBase } from '../../hooks/use_knowledge_base';
import { useObservabilityAIAssistantRouter } from '../../hooks/use_observability_ai_assistant_router';
-import { getConnectorsManagementHref } from '../../utils/get_connectors_management_href';
import { StartedFrom } from '../../utils/get_timeline_items_from_conversation';
import { ChatBody } from './chat_body';
@@ -39,10 +37,6 @@ export function ChatFlyout({
startedFrom: StartedFrom;
onClose: () => void;
}) {
- const {
- services: { http },
- } = useKibana();
-
const { euiTheme } = useEuiTheme();
const currentUser = useCurrentUser();
@@ -105,7 +99,6 @@ export function ChatFlyout({
initialTitle={initialTitle}
initialMessages={initialMessages}
currentUser={currentUser}
- connectorsManagementHref={getConnectorsManagementHref(http)}
knowledgeBase={knowledgeBase}
startedFrom={startedFrom}
onConversationUpdate={(conversation) => {
diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_header.stories.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_header.stories.tsx
index 5bf9cd3577de4..0a61e16070232 100644
--- a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_header.stories.tsx
+++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_header.stories.tsx
@@ -30,18 +30,6 @@ export const ChatHeaderLoaded: ComponentStoryObj = {
selectConnector: () => {},
reloadConnectors: () => {},
},
- knowledgeBase: {
- status: {
- loading: false,
- value: {
- ready: true,
- },
- refresh: () => {},
- },
- isInstalling: false,
- installError: undefined,
- install: async () => {},
- },
},
render: (props) => {
return (
diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_header.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_header.tsx
index c7501f1b5880b..9867958b27d1f 100644
--- a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_header.tsx
+++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_header.tsx
@@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import React, { useRef } from 'react';
+import React, { useEffect, useState } from 'react';
import {
EuiFlexGroup,
EuiFlexItem,
@@ -17,11 +17,7 @@ import { i18n } from '@kbn/i18n';
import { css } from '@emotion/css';
import { AssistantAvatar } from '../assistant_avatar';
import { ChatActionsMenu } from './chat_actions_menu';
-import { ASSISTANT_SETUP_TITLE, EMPTY_CONVERSATION_TITLE, UPGRADE_LICENSE_TITLE } from '../../i18n';
-import { useUnmountAndRemountWhenPropChanges } from '../../hooks/use_unmount_and_remount_when_prop_changes';
import type { UseGenAIConnectorsResult } from '../../hooks/use_genai_connectors';
-import type { UseKnowledgeBaseResult } from '../../hooks/use_knowledge_base';
-import { StartedFrom } from '../../utils/get_timeline_items_from_conversation';
// needed to prevent InlineTextEdit component from expanding container
const minWidthClassName = css`
@@ -38,39 +34,25 @@ export function ChatHeader({
loading,
licenseInvalid,
connectors,
- connectorsManagementHref,
conversationId,
- knowledgeBase,
- startedFrom,
- onSaveTitle,
onCopyConversation,
+ onSaveTitle,
}: {
title: string;
loading: boolean;
licenseInvalid: boolean;
connectors: UseGenAIConnectorsResult;
- connectorsManagementHref: string;
conversationId?: string;
- knowledgeBase: UseKnowledgeBaseResult;
- startedFrom?: StartedFrom;
onCopyConversation: () => void;
- onSaveTitle?: (title: string) => void;
+ onSaveTitle: (title: string) => void;
}) {
- const hasTitle = !!title;
-
- const displayedTitle = !connectors.selectedConnector
- ? ASSISTANT_SETUP_TITLE
- : licenseInvalid
- ? UPGRADE_LICENSE_TITLE
- : title || EMPTY_CONVERSATION_TITLE;
-
const theme = useEuiTheme();
- // Component only works uncontrolled at the moment, so need to unmount and remount on prop change.
- // https://github.com/elastic/eui/issues/7084
- const shouldRender = useUnmountAndRemountWhenPropChanges(displayedTitle);
+ const [newTitle, setNewTitle] = useState(title);
- const inputRef = useRef(null);
+ useEffect(() => {
+ setNewTitle(title);
+ }, [title]);
return (
- {shouldRender ? (
- {
+ setNewTitle(e.currentTarget.nodeValue || '');
+ }}
+ onSave={(e) => {
+ if (onSaveTitle) {
+ onSaveTitle(e);
}
- onSave={onSaveTitle}
- />
- ) : null}
+ }}
+ onCancel={(previousTitle: string) => {
+ setNewTitle(previousTitle);
+ }}
+ />
{
- if (prevPropRef.current !== currentProp) {
- setShouldRender(false);
- }
- }, [prevPropRef, currentProp]);
-
- useEffect(() => {
- if (!shouldRender) {
- setShouldRender(true);
- }
- }, [shouldRender]);
-
- useEffect(() => {
- prevPropRef.current = currentProp;
- }, [currentProp]);
-
- return shouldRender;
-}
diff --git a/x-pack/plugins/observability_ai_assistant/public/routes/conversations/conversation_view.tsx b/x-pack/plugins/observability_ai_assistant/public/routes/conversations/conversation_view.tsx
index b360b136272da..4505632245191 100644
--- a/x-pack/plugins/observability_ai_assistant/public/routes/conversations/conversation_view.tsx
+++ b/x-pack/plugins/observability_ai_assistant/public/routes/conversations/conversation_view.tsx
@@ -25,7 +25,6 @@ import { useObservabilityAIAssistant } from '../../hooks/use_observability_ai_as
import { useObservabilityAIAssistantParams } from '../../hooks/use_observability_ai_assistant_params';
import { useObservabilityAIAssistantRouter } from '../../hooks/use_observability_ai_assistant_router';
import { EMPTY_CONVERSATION_TITLE } from '../../i18n';
-import { getConnectorsManagementHref } from '../../utils/get_connectors_management_href';
const containerClassName = css`
max-width: 100%;
@@ -51,7 +50,7 @@ export function ConversationView() {
const { path } = useObservabilityAIAssistantParams('/conversations/*');
const {
- services: { http, notifications },
+ services: { notifications },
} = useKibana();
const { element: confirmDeleteElement, confirm: confirmDeleteFunction } = useConfirmModal({
@@ -227,7 +226,6 @@ export function ConversationView() {
key={chatBodyKeyRef.current}
currentUser={currentUser}
connectors={connectors}
- connectorsManagementHref={getConnectorsManagementHref(http)}
initialConversationId={conversationId}
knowledgeBase={knowledgeBase}
startedFrom="conversationView"
diff --git a/x-pack/plugins/observability_ai_assistant/scripts/evaluation/kibana_client.ts b/x-pack/plugins/observability_ai_assistant/scripts/evaluation/kibana_client.ts
index 926dc36a15995..8fea2862e3faa 100644
--- a/x-pack/plugins/observability_ai_assistant/scripts/evaluation/kibana_client.ts
+++ b/x-pack/plugins/observability_ai_assistant/scripts/evaluation/kibana_client.ts
@@ -6,17 +6,20 @@
*/
import axios, { AxiosInstance, AxiosResponse } from 'axios';
-import { last, pick, remove } from 'lodash';
+import { pick, remove } from 'lodash';
import { filter, lastValueFrom, map, toArray } from 'rxjs';
import { format, parse, UrlObject } from 'url';
import { Message, MessageRole } from '../../common';
import {
+ ChatCompletionChunkEvent,
+ ChatCompletionErrorEvent,
ConversationCreateEvent,
MessageAddEvent,
StreamingChatResponseEvent,
StreamingChatResponseEventType,
} from '../../common/conversation_complete';
import { FunctionDefinition } from '../../common/types';
+import { concatenateChatCompletionChunks } from '../../common/utils/concatenate_chat_completion_chunks';
import { throwSerializedChatCompletionErrors } from '../../common/utils/throw_serialized_chat_completion_errors';
import { APIReturnType, ObservabilityAIAssistantAPIClientRequestParamsOf } from '../../public';
import { getAssistantSetupMessage } from '../../public/service/get_assistant_setup_message';
@@ -27,7 +30,7 @@ type InnerMessage = Message['message'];
type StringOrMessageList = string | InnerMessage[];
export interface ChatClient {
- chat: (message: StringOrMessageList) => Promise;
+ chat: (message: StringOrMessageList) => Promise;
complete: (
...args: [StringOrMessageList] | [string, InnerMessage[]]
) => Promise<{ conversationId?: string; messages: InnerMessage[] }>;
@@ -132,21 +135,14 @@ export class KibanaClient {
)
).data
).pipe(
- map((line) => JSON.parse(line) as StreamingChatResponseEvent),
- throwSerializedChatCompletionErrors()
+ map((line) => JSON.parse(line) as ChatCompletionChunkEvent | ChatCompletionErrorEvent),
+ throwSerializedChatCompletionErrors(),
+ concatenateChatCompletionChunks()
);
- const messageEvents = await lastValueFrom(
- stream$.pipe(
- filter(
- (event): event is MessageAddEvent =>
- event.type === StreamingChatResponseEventType.MessageAdd
- ),
- toArray()
- )
- );
+ const message = await lastValueFrom(stream$);
- return messageEvents.map((event) => event.message.message);
+ return message.message;
}
const results: EvaluationResult[] = [];
@@ -223,27 +219,26 @@ export class KibanaClient {
};
},
evaluate: async ({ messages, conversationId }, criteria) => {
- const message = last(
- await chat({
- messages: [
- {
- '@timestamp': new Date().toISOString(),
- message: {
- role: MessageRole.System,
- content: `You are a critical assistant for evaluating conversations with the Elastic Observability AI Assistant,
+ const message = await chat({
+ messages: [
+ {
+ '@timestamp': new Date().toISOString(),
+ message: {
+ role: MessageRole.System,
+ content: `You are a critical assistant for evaluating conversations with the Elastic Observability AI Assistant,
which helps our users make sense of their Observability data.
Your goal is to verify whether a conversation between the user and the assistant matches the given criteria.
For each criterion, calculate a score. Explain your score, by describing what the assistant did right, and what the
assistant did wrong, where it could improve, and what the root cause was in case of a failure.`,
- },
},
- {
- '@timestamp': new Date().toString(),
- message: {
- role: MessageRole.User,
- content: `Evaluate the conversation according to the following criteria:
+ },
+ {
+ '@timestamp': new Date().toString(),
+ message: {
+ role: MessageRole.User,
+ content: `Evaluate the conversation according to the following criteria:
${criteria.map((criterion, index) => {
return `${index}: ${criterion}`;
@@ -252,48 +247,47 @@ export class KibanaClient {
This is the conversation:
${JSON.stringify(messages)}`,
- },
},
- ],
- functions: [
- {
- name: 'scores',
- parameters: {
- type: 'object',
- properties: {
- criteria: {
- type: 'array',
- items: {
- type: 'object',
- properties: {
- index: {
- type: 'number',
- description: 'The number of the criterion',
- },
- score: {
- type: 'number',
- description:
- 'A score of either 0 (criterion failed) or 1 (criterion succeeded)',
- },
- reasoning: {
- type: 'string',
- description:
- 'Your reasoning for the score. Explain your score by mentioning what you expected to happen and what did happen.',
- },
+ },
+ ],
+ functions: [
+ {
+ name: 'scores',
+ parameters: {
+ type: 'object',
+ properties: {
+ criteria: {
+ type: 'array',
+ items: {
+ type: 'object',
+ properties: {
+ index: {
+ type: 'number',
+ description: 'The number of the criterion',
+ },
+ score: {
+ type: 'number',
+ description:
+ 'A score of either 0 (criterion failed) or 1 (criterion succeeded)',
+ },
+ reasoning: {
+ type: 'string',
+ description:
+ 'Your reasoning for the score. Explain your score by mentioning what you expected to happen and what did happen.',
},
- required: ['index', 'score', 'reasoning'],
},
+ required: ['index', 'score', 'reasoning'],
},
},
- required: ['criteria'],
},
- contexts: [],
- description: 'Call this function to return scores for the criteria',
+ required: ['criteria'],
},
- ],
- functionCall: 'scores',
- })
- )!;
+ contexts: [],
+ description: 'Call this function to return scores for the criteria',
+ },
+ ],
+ functionCall: 'scores',
+ });
const scoredCriteria = (
JSON.parse(message.function_call!.arguments!) as {
diff --git a/x-pack/plugins/observability_ai_assistant/server/functions/esql/correct_common_esql_mistakes.test.ts b/x-pack/plugins/observability_ai_assistant/server/functions/esql/correct_common_esql_mistakes.test.ts
new file mode 100644
index 0000000000000..ded551bd84171
--- /dev/null
+++ b/x-pack/plugins/observability_ai_assistant/server/functions/esql/correct_common_esql_mistakes.test.ts
@@ -0,0 +1,60 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+import dedent from 'dedent';
+import { noop } from 'lodash';
+import { correctCommonEsqlMistakes } from './correct_common_esql_mistakes';
+
+describe('correctCommonEsqlMistakes', () => {
+ const fakeLogger = {
+ debug: noop,
+ } as any;
+
+ function renderQuery(query: string) {
+ return '```esql\n' + dedent(query) + '\n```';
+ }
+
+ function expectQuery(input: string, expectedOutput: string) {
+ expect(correctCommonEsqlMistakes(renderQuery(input), fakeLogger)).toEqual(
+ renderQuery(expectedOutput)
+ );
+ }
+
+ it('replaces aliasing via the AS keyword with the = operator', () => {
+ expectQuery(`FROM logs-* | STATS COUNT() AS count`, 'FROM logs-*\n| STATS count = COUNT()');
+ expectQuery(
+ `FROM logs-* | STATS AVG(transaction.duration.histogram) AS avg_request_latency, PERCENTILE(transaction.duration.histogram, 95) AS p95`,
+ `FROM logs-*
+ | STATS avg_request_latency = AVG(transaction.duration.histogram), p95 = PERCENTILE(transaction.duration.histogram, 95)`
+ );
+
+ expectQuery(
+ `FROM traces-apm*
+ | WHERE @timestamp >= NOW() - 24 hours
+ | STATS AVG(transaction.duration.us) AS avg_duration, SUM(success) AS total_successes, COUNT(*) AS total_requests BY service.name`,
+ `FROM traces-apm*
+ | WHERE @timestamp >= NOW() - 24 hours
+ | STATS avg_duration = AVG(transaction.duration.us), total_successes = SUM(success), total_requests = COUNT(*) BY service.name`
+ );
+ });
+
+ it(`replaces " or ' escaping in FROM statements with backticks`, () => {
+ expectQuery(`FROM "logs-*" | LIMIT 10`, 'FROM `logs-*`\n| LIMIT 10');
+ expectQuery(`FROM 'logs-*' | LIMIT 10`, 'FROM `logs-*`\n| LIMIT 10');
+ expectQuery(`FROM logs-* | LIMIT 10`, 'FROM logs-*\n| LIMIT 10');
+ });
+
+ it('replaces single-quote escaped strings with double-quote escaped strings', () => {
+ expectQuery(
+ `FROM nyc_taxis
+ | WHERE DATE_EXTRACT('hour', dropoff_datetime) >= 6 AND DATE_EXTRACT('hour', dropoff_datetime) < 10
+ | LIMIT 10`,
+ `FROM nyc_taxis
+ | WHERE DATE_EXTRACT("hour", dropoff_datetime) >= 6 AND DATE_EXTRACT("hour", dropoff_datetime) < 10
+ | LIMIT 10`
+ );
+ });
+});
diff --git a/x-pack/plugins/observability_ai_assistant/server/functions/esql/correct_common_esql_mistakes.ts b/x-pack/plugins/observability_ai_assistant/server/functions/esql/correct_common_esql_mistakes.ts
new file mode 100644
index 0000000000000..62add102ae58b
--- /dev/null
+++ b/x-pack/plugins/observability_ai_assistant/server/functions/esql/correct_common_esql_mistakes.ts
@@ -0,0 +1,108 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { Logger } from '@kbn/logging';
+
+const DELIMITER_TOKENS = ['`', "'", '"'];
+const ESCAPE_TOKEN = '\\\\';
+
+function splitIntoCommands(query: string) {
+ const commands: string[] = [];
+
+ let delimiterToken: string | undefined;
+ let currentCommand: string = '';
+
+ const trimmed = query.trim();
+
+ // @ts-expect-error
+ // eslint-disable-next-line guard-for-in
+ for (const indexAsString in trimmed) {
+ const index = Number(indexAsString);
+ const char = trimmed[index];
+
+ if (!delimiterToken && char === '|') {
+ commands.push(currentCommand.trim());
+ currentCommand = '';
+ continue;
+ }
+
+ currentCommand += char;
+
+ if (delimiterToken === char) {
+ // end identifier
+ delimiterToken = undefined;
+ } else if (
+ !delimiterToken &&
+ DELIMITER_TOKENS.includes(char) &&
+ trimmed.substring(index - 2, index - 1) !== ESCAPE_TOKEN
+ ) {
+ // start identifier
+ delimiterToken = char;
+ continue;
+ }
+ }
+
+ if (currentCommand) {
+ commands.push(currentCommand.trim());
+ }
+
+ return commands;
+}
+
+function replaceSingleQuotesWithDoubleQuotes(command: string) {
+ const regex = /(? {
+ return `STATS ${statsOperations.replaceAll(
+ /(,\s*)?(.*?)\sAS\s([`a-zA-Z0-9.\-_]+)/g,
+ '$1$3 = $2'
+ )}`;
+ });
+}
+
+export function correctCommonEsqlMistakes(content: string, log: Logger) {
+ return content.replaceAll(/```esql\n(.*?)\n```/gms, (_, query: string) => {
+ const commands = splitIntoCommands(query);
+
+ const correctedFormattedQuery = commands
+ .map((command) => {
+ const commandName = command.match(/^([A-Za-z]+)/)?.[1];
+
+ let formattedCommand = command;
+
+ switch (commandName) {
+ case 'FROM':
+ formattedCommand = formattedCommand
+ .replaceAll(/FROM "(.*)"/g, 'FROM `$1`')
+ .replaceAll(/FROM '(.*)'/g, 'FROM `$1`');
+ break;
+
+ case 'WHERE':
+ case 'EVAL':
+ formattedCommand = replaceSingleQuotesWithDoubleQuotes(formattedCommand);
+ break;
+
+ case 'STATS':
+ formattedCommand = replaceAsKeywordWithAssignments(formattedCommand);
+ break;
+ }
+ return formattedCommand;
+ })
+ .join('\n| ');
+
+ const originalFormattedQuery = commands.join('\n| ');
+
+ if (originalFormattedQuery !== correctedFormattedQuery) {
+ log.debug(`Modified query from: ${originalFormattedQuery}\nto:\n${correctedFormattedQuery}`);
+ }
+
+ return '```esql\n' + correctedFormattedQuery + '\n```';
+ });
+}
diff --git a/x-pack/plugins/observability_ai_assistant/server/functions/esql/index.ts b/x-pack/plugins/observability_ai_assistant/server/functions/esql/index.ts
index 90216253844b6..7e20d1f78c871 100644
--- a/x-pack/plugins/observability_ai_assistant/server/functions/esql/index.ts
+++ b/x-pack/plugins/observability_ai_assistant/server/functions/esql/index.ts
@@ -9,16 +9,14 @@ import Fs from 'fs';
import { keyBy, mapValues, once, pick } from 'lodash';
import pLimit from 'p-limit';
import Path from 'path';
-import { lastValueFrom, Observable } from 'rxjs';
+import { lastValueFrom, type Observable } from 'rxjs';
import { promisify } from 'util';
import type { FunctionRegistrationParameters } from '..';
-import {
- ChatCompletionChunkEvent,
- StreamingChatResponseEventType,
-} from '../../../common/conversation_complete';
+import type { ChatCompletionChunkEvent } from '../../../common/conversation_complete';
import { FunctionVisibility, MessageRole } from '../../../common/types';
import { concatenateChatCompletionChunks } from '../../../common/utils/concatenate_chat_completion_chunks';
import { emitWithConcatenatedMessage } from '../../../common/utils/emit_with_concatenated_message';
+import { correctCommonEsqlMistakes } from './correct_common_esql_mistakes';
const readFile = promisify(Fs.readFile);
const readdir = promisify(Fs.readdir);
@@ -208,52 +206,24 @@ export function registerEsqlFunction({
\`\`\`
- Prefer to use commands and functions for which you have documentation.
-
- Pay special attention to these instructions. Not following these instructions to the tee
- will lead to excruciating consequences for the user.
-
- #1
- Directive: ONLY use aggregation functions in STATS commands, and use ONLY aggregation functions in stats commands, NOT in SORT or EVAL.
- Rationale: Only aggregation functions are supported in STATS commands, and aggregation functions are only supported in STATS commands.
- Action: Create new columns using EVAL first and then aggregate over them in STATS commands. Do not use aggregation functions anywhere else, such as SORT or EVAL.
- Example: EVAL is_failure_as_number = CASE(event.outcome == "failure", 1, 0) | STATS total_failures = SUM(is_failure_as_number) BY my_grouping_name
-
- #2
- Directive: Use the \`=\` operator to create new columns in STATS and EVAL, DO NOT UNDER ANY CIRCUMSTANCES use \`AS\`.
- Rationale: The \`=\` operator is used for aliasing. Using \`AS\` leads to syntax errors.
- Action: When creating a new column in a command, use the = operator.
- Example: STATS total_requests = COUNT(*)
+ Prefer to use commands and functions for which you have requested documentation.
- #3
- Directive: Use placeholder values for information that is missing.
- Rationale: It is critical to generate a syntactically valid query.
- Action: When you don't know the arguments to a function because information is missing, use placeholder values.
- Example: "Here's an ES|QL query that generates a timeseries of 50 buckets calculating the average duration. I've used
- "2023-01-23T12:15:00.000Z" and "2023-01-23T12:30:00.000Z" as placeholder values. Replace them with the start
- and end date that work for your use case."
-
- #4
- Directive: Wrap string literals in double quotes.
- Rationale: It is critical to generate a syntactically valid query.
- Action: When using string literals in function calls, wrap them in double quotes, not single quotes.
- Example: DATE_EXTRACT("year", @timestamp)
-
- At the start of every message, YOU MUST, for every instruction that is relevant to the query you want to construct,
- repeat its directives, verbatim, at the start of every message. Exclude the rationales, actions, and examples. Follow
- it up by using a delimiter: --
+ DO NOT UNDER ANY CIRCUMSTANCES use commands or functions that are not a capability of ES|QL
+ as mentioned in the system message and documentation.
+ Directive: ONLY use aggregation functions in STATS commands, and use ONLY aggregation
+ functions in stats commands, NOT in SORT or EVAL.
+ Rationale: Only aggregation functions are supported in STATS commands, and aggregation
+ functions are only supported in STATS commands.
+ Action: Create new columns using EVAL first and then aggregate over them in STATS commands.
+ Do not use aggregation functions anywhere else, such as SORT or EVAL.
Example:
+ \`\`\`esql
+ EVAL is_failure_as_number = CASE(event.outcome == "failure", 1, 0)
+ | STATS total_failures = SUM(is_failure_as_number) BY my_grouping_name
+ \`\`\`
- #1:
- #2:
- #3:
-
- --
-
- Here is an ES|QL query that you can use:
-
- `
+ `
),
{
'@timestamp': new Date().toISOString(),
@@ -282,58 +252,28 @@ export function registerEsqlFunction({
signal,
});
- return esqlResponse$.pipe((source) => {
- return new Observable((subscriber) => {
- let cachedContent: string = '';
- let id: string = '';
-
- function includesDivider() {
- const firstDividerIndex = cachedContent.indexOf('--');
- return firstDividerIndex !== -1;
- }
+ return esqlResponse$.pipe(
+ emitWithConcatenatedMessage((msg) => {
+ const esqlQuery = msg.message.content.match(/```esql([\s\S]*?)```/)?.[1];
- source.subscribe({
- next: (message) => {
- id = message.id;
- if (includesDivider()) {
- subscriber.next(message);
- }
- cachedContent += message.message.content || '';
- },
- complete: () => {
- if (!includesDivider()) {
- subscriber.next({
- id,
- message: {
- content: cachedContent,
- },
- type: StreamingChatResponseEventType.ChatCompletionChunk,
- });
- }
-
- const esqlQuery = cachedContent.match(/```esql([\s\S]*?)```/)?.[1];
-
- if (esqlQuery && args.execute) {
- subscriber.next({
- id,
- message: {
+ return {
+ ...msg,
+ message: {
+ ...msg.message,
+ content: correctCommonEsqlMistakes(msg.message.content, resources.logger),
+ ...(esqlQuery && args.execute
+ ? {
function_call: {
name: 'execute_query',
arguments: JSON.stringify({ query: esqlQuery }),
+ trigger: MessageRole.Assistant as const,
},
- },
- type: StreamingChatResponseEventType.ChatCompletionChunk,
- });
- }
-
- subscriber.complete();
- },
- error: (error) => {
- subscriber.error(error);
+ }
+ : {}),
},
- });
- }).pipe(emitWithConcatenatedMessage());
- });
+ };
+ })
+ );
}
);
}
diff --git a/x-pack/plugins/observability_ai_assistant/server/service/client/index.test.ts b/x-pack/plugins/observability_ai_assistant/server/service/client/index.test.ts
index 2dc69333c8502..2e88cb55f9dd5 100644
--- a/x-pack/plugins/observability_ai_assistant/server/service/client/index.test.ts
+++ b/x-pack/plugins/observability_ai_assistant/server/service/client/index.test.ts
@@ -1267,11 +1267,15 @@ describe('Observability AI Assistant client', () => {
await requestAlertsFunctionCall();
+ await requestAlertsFunctionCall();
+
+ await requestAlertsFunctionCall();
+
await finished(stream);
});
it('executed the function no more than three times', () => {
- expect(functionClientMock.executeFunction).toHaveBeenCalledTimes(3);
+ expect(functionClientMock.executeFunction).toHaveBeenCalledTimes(5);
});
it('does not give the LLM the choice to call a function anymore', () => {
diff --git a/x-pack/plugins/observability_ai_assistant/server/service/client/index.ts b/x-pack/plugins/observability_ai_assistant/server/service/client/index.ts
index 8cb24b589f816..e82ea13ece099 100644
--- a/x-pack/plugins/observability_ai_assistant/server/service/client/index.ts
+++ b/x-pack/plugins/observability_ai_assistant/server/service/client/index.ts
@@ -147,7 +147,7 @@ export class ObservabilityAIAssistantClient {
let numFunctionsCalled: number = 0;
- const MAX_FUNCTION_CALLS = 3;
+ const MAX_FUNCTION_CALLS = 5;
const MAX_FUNCTION_RESPONSE_TOKEN_COUNT = 4000;
const next = async (nextMessages: Message[]): Promise => {
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/__stories__/field_value_selection.stories.tsx b/x-pack/plugins/observability_shared/public/components/field_value_suggestions/__stories__/field_value_selection.stories.tsx
similarity index 100%
rename from x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/__stories__/field_value_selection.stories.tsx
rename to x-pack/plugins/observability_shared/public/components/field_value_suggestions/__stories__/field_value_selection.stories.tsx
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_combobox.tsx b/x-pack/plugins/observability_shared/public/components/field_value_suggestions/field_value_combobox.tsx
similarity index 93%
rename from x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_combobox.tsx
rename to x-pack/plugins/observability_shared/public/components/field_value_suggestions/field_value_combobox.tsx
index e4aa34475fffd..32fb6c2980602 100644
--- a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_combobox.tsx
+++ b/x-pack/plugins/observability_shared/public/components/field_value_suggestions/field_value_combobox.tsx
@@ -70,10 +70,13 @@ export function FieldValueCombobox({
fullWidth
singleSelection={singleSelection ? { asPlainText: true } : false}
compressed={compressed}
- placeholder={i18n.translate('xpack.exploratoryView.fieldValueSelection.placeholder.search', {
- defaultMessage: 'Search {label}',
- values: { label },
- })}
+ placeholder={i18n.translate(
+ 'xpack.observabilityShared.fieldValueSelection.placeholder.search',
+ {
+ defaultMessage: 'Search {label}',
+ values: { label },
+ }
+ )}
isLoading={loading}
onSearchChange={(searchVal) => {
setQuery(searchVal);
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.test.tsx b/x-pack/plugins/observability_shared/public/components/field_value_suggestions/field_value_selection.test.tsx
similarity index 100%
rename from x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.test.tsx
rename to x-pack/plugins/observability_shared/public/components/field_value_suggestions/field_value_selection.test.tsx
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.tsx b/x-pack/plugins/observability_shared/public/components/field_value_suggestions/field_value_selection.tsx
similarity index 92%
rename from x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.tsx
rename to x-pack/plugins/observability_shared/public/components/field_value_suggestions/field_value_selection.tsx
index 4cf81e2a9976d..aebb3a145371e 100644
--- a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.tsx
+++ b/x-pack/plugins/observability_shared/public/components/field_value_suggestions/field_value_selection.tsx
@@ -134,7 +134,7 @@ export function FieldValueSelection({
const filterButton = (
- {i18n.translate('xpack.exploratoryView.fieldValueSelection.loading', {
+ {i18n.translate('xpack.observabilityShared.fieldValueSelection.loading', {
defaultMessage: 'Loading',
})}{' '}
@@ -221,7 +224,7 @@ export function FieldValueSelection({
color: euiTheme.colors.subduedText,
}}
label={i18n.translate(
- 'xpack.exploratoryView.fieldValueSelection.logicalAnd',
+ 'xpack.observabilityShared.fieldValueSelection.logicalAnd',
{
defaultMessage: 'Use logical AND',
}
@@ -241,7 +244,7 @@ export function FieldValueSelection({
- {i18n.translate('xpack.exploratoryView.fieldValueSelection.apply', {
+ {i18n.translate('xpack.observabilityShared.fieldValueSelection.apply', {
defaultMessage: 'Apply',
})}
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/index.test.tsx b/x-pack/plugins/observability_shared/public/components/field_value_suggestions/index.test.tsx
similarity index 97%
rename from x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/index.test.tsx
rename to x-pack/plugins/observability_shared/public/components/field_value_suggestions/index.test.tsx
index e18819f8b7225..4cc1375b22db2 100644
--- a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/index.test.tsx
+++ b/x-pack/plugins/observability_shared/public/components/field_value_suggestions/index.test.tsx
@@ -9,7 +9,7 @@ import React from 'react';
import { FieldValueSuggestions } from '.';
import { render, screen, fireEvent, waitForElementToBeRemoved } from '@testing-library/react';
import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
-import * as obsHooks from '@kbn/observability-shared-plugin/public/hooks/use_es_search';
+import * as obsHooks from '../../hooks/use_es_search';
jest.setTimeout(30000);
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/index.tsx b/x-pack/plugins/observability_shared/public/components/field_value_suggestions/index.tsx
similarity index 97%
rename from x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/index.tsx
rename to x-pack/plugins/observability_shared/public/components/field_value_suggestions/index.tsx
index ea414260a4380..25a4c370ea5cd 100644
--- a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/index.tsx
+++ b/x-pack/plugins/observability_shared/public/components/field_value_suggestions/index.tsx
@@ -6,7 +6,7 @@
*/
import React, { useState } from 'react';
-import { useValuesList } from '../../../hooks/use_values_list';
+import { useValuesList } from '../../hooks/use_values_list';
import { FieldValueSelection } from './field_value_selection';
import { FieldValueSuggestionsProps } from './types';
import { FieldValueCombobox } from './field_value_combobox';
diff --git a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/types.ts b/x-pack/plugins/observability_shared/public/components/field_value_suggestions/types.ts
similarity index 100%
rename from x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/types.ts
rename to x-pack/plugins/observability_shared/public/components/field_value_suggestions/types.ts
diff --git a/x-pack/plugins/observability_shared/public/components/index.tsx b/x-pack/plugins/observability_shared/public/components/index.tsx
new file mode 100644
index 0000000000000..732bc9be690ff
--- /dev/null
+++ b/x-pack/plugins/observability_shared/public/components/index.tsx
@@ -0,0 +1,34 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React, { lazy, Suspense } from 'react';
+import type {
+ FieldValueSuggestionsProps,
+ FieldValueSelectionProps,
+} from './field_value_suggestions/types';
+
+const FieldValueSelectionLazy = lazy(
+ () => import('./field_value_suggestions/field_value_selection')
+);
+
+export function FieldValueSelection(props: FieldValueSelectionProps) {
+ return (
+
+
+
+ );
+}
+
+const FieldValueSuggestionsLazy = lazy(() => import('./field_value_suggestions'));
+
+export function FieldValueSuggestions(props: FieldValueSuggestionsProps) {
+ return (
+
+
+
+ );
+}
diff --git a/x-pack/plugins/exploratory_view/public/hooks/use_values_list.ts b/x-pack/plugins/observability_shared/public/hooks/use_values_list.ts
similarity index 95%
rename from x-pack/plugins/exploratory_view/public/hooks/use_values_list.ts
rename to x-pack/plugins/observability_shared/public/hooks/use_values_list.ts
index 8173e8bacfa55..913070815ec70 100644
--- a/x-pack/plugins/exploratory_view/public/hooks/use_values_list.ts
+++ b/x-pack/plugins/observability_shared/public/hooks/use_values_list.ts
@@ -9,9 +9,9 @@ import { capitalize, uniqBy } from 'lodash';
import { useEffect, useState } from 'react';
import useDebounce from 'react-use/lib/useDebounce';
import type { ESFilter } from '@kbn/es-types';
-import { useEsSearch, createEsParams } from '@kbn/observability-shared-plugin/public';
import { IInspectorInfo } from '@kbn/data-plugin/common';
-import { TRANSACTION_URL } from '../components/shared/exploratory_view/configurations/constants/elasticsearch_fieldnames';
+import { TRANSACTION_URL } from '../../common';
+import { useEsSearch, createEsParams } from './use_es_search';
export interface Props {
sourceField: string;
diff --git a/x-pack/plugins/observability_shared/public/index.ts b/x-pack/plugins/observability_shared/public/index.ts
index 564cb210ea271..3c9d2fe5a8eec 100644
--- a/x-pack/plugins/observability_shared/public/index.ts
+++ b/x-pack/plugins/observability_shared/public/index.ts
@@ -20,8 +20,8 @@ export type {
ObservabilityPageTemplateProps,
LazyObservabilityPageTemplateProps,
NavigationSection,
+ NavigationEntry,
} from './components/page_template/page_template';
-export type { NavigationEntry } from './components/page_template/page_template';
export { HeaderMenuPortal } from './components/header_menu';
export { useObservabilityTourContext, observTourStepStorageKey } from './components/tour';
export { ActionMenu, ActionMenuDivider } from './components/action_menu/action_menu';
@@ -45,6 +45,7 @@ export { useInspectorContext } from './contexts/inspector/use_inspector_context'
export { useTheme } from './hooks/use_theme';
export { useEditableSettings } from './hooks/use_editable_settings';
export { useEsSearch, createEsParams } from './hooks/use_es_search';
+export { useValuesList } from './hooks/use_values_list';
export { useFetcher, FETCH_STATUS } from './hooks/use_fetcher';
export type { FetcherResult } from './hooks/use_fetcher';
export { useKibanaSpace } from './hooks/use_kibana_space';
@@ -94,3 +95,4 @@ export {
export { ProfilingEmptyState } from './components/profiling/profiling_empty_state';
export { FeatureFeedbackButton } from './components/feature_feedback_button/feature_feedback_button';
export { BottomBarActions } from './components/bottom_bar_actions/bottom_bar_actions';
+export { FieldValueSelection, FieldValueSuggestions } from './components';
diff --git a/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_key_flyout.tsx b/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_key_flyout.tsx
index 18bc6db281939..fb7ba2b6c40a3 100644
--- a/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_key_flyout.tsx
+++ b/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_key_flyout.tsx
@@ -38,7 +38,7 @@ import useAsyncFn from 'react-use/lib/useAsyncFn';
import { CodeEditorField } from '@kbn/code-editor';
import { i18n } from '@kbn/i18n';
import { FormattedDate, FormattedMessage } from '@kbn/i18n-react';
-import { useKibana } from '@kbn/kibana-react-plugin/public';
+import { useDarkMode, useKibana } from '@kbn/kibana-react-plugin/public';
import type { KibanaServerError } from '@kbn/kibana-utils-plugin/public';
import type { CategorizedApiKey } from './api_keys_grid_page';
@@ -146,6 +146,7 @@ export const ApiKeyFlyout: FunctionComponent = ({
}) => {
const { euiTheme } = useEuiTheme();
const { services } = useKibana();
+ const isDarkMode = useDarkMode();
const { value: currentUser, loading: isLoadingCurrentUser } = useCurrentUser();
const [{ value: roles, loading: isLoadingRoles }, getRoles] = useAsyncFn(
() => new RolesAPIClient(services.http!).getRoles(),
@@ -662,6 +663,7 @@ export const ApiKeyFlyout: FunctionComponent = ({
fullWidth
languageId="xjson"
height={200}
+ useDarkTheme={isDarkMode}
/>
@@ -749,6 +751,7 @@ export const ApiKeyFlyout: FunctionComponent = ({
fullWidth
languageId="xjson"
height={200}
+ useDarkTheme={isDarkMode}
/>
>
@@ -833,6 +836,7 @@ export const ApiKeyFlyout: FunctionComponent = ({
fullWidth
languageId="xjson"
height={200}
+ useDarkTheme={isDarkMode}
/>
>
diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.test.tsx
index 24f30dd9c4064..64e332bd130bd 100644
--- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.test.tsx
+++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.test.tsx
@@ -28,6 +28,7 @@ jest.mock('@kbn/kibana-react-plugin/public', () => ({
useKibana: jest.fn().mockReturnValue({
services: { docLinks: { links: { apis: { createRoleMapping: 'createRoleMappingLink' } } } },
}),
+ useDarkMode: jest.fn().mockReturnValue(false),
}));
describe('JSONRuleEditor', () => {
diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.tsx
index ccf748735e23c..963bbf3a35cfc 100644
--- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.tsx
+++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.tsx
@@ -15,7 +15,7 @@ import React, { Fragment, useState } from 'react';
import { CodeEditorField } from '@kbn/code-editor';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
-import { useKibana } from '@kbn/kibana-react-plugin/public';
+import { useDarkMode, useKibana } from '@kbn/kibana-react-plugin/public';
import { XJsonLang } from '@kbn/monaco';
import type { Rule } from '../../model';
@@ -30,6 +30,7 @@ interface Props {
export const JSONRuleEditor = (props: Props) => {
const docLinks = useKibana().services.docLinks!;
+ const isDarkMode = useDarkMode();
const [rawRules, setRawRules] = useState(
JSON.stringify(props.rules ? props.rules.toRaw() : {}, null, 2)
);
@@ -105,6 +106,7 @@ export const JSONRuleEditor = (props: Props) => {
onChange={onRulesChange}
fullWidth={true}
height="300px"
+ useDarkTheme={isDarkMode}
options={{
accessibilitySupport: 'off',
lineNumbers: 'on',
diff --git a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx
index 37b6183520432..293b90259b2ab 100644
--- a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx
+++ b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx
@@ -37,7 +37,7 @@ import type { KibanaFeature } from '@kbn/features-plugin/common';
import type { FeaturesPluginStart } from '@kbn/features-plugin/public';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
-import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public';
+import { reactRouterNavigate, useDarkMode } from '@kbn/kibana-react-plugin/public';
import type { Cluster } from '@kbn/remote-clusters-plugin/public';
import { REMOTE_CLUSTERS_PATH } from '@kbn/remote-clusters-plugin/public';
import type { Space, SpacesApiUi } from '@kbn/spaces-plugin/public';
@@ -304,6 +304,8 @@ export const EditRolePage: FunctionComponent = ({
history,
spacesApiUi,
}) => {
+ const isDarkMode = useDarkMode();
+
if (!dataViews) {
// The dataViews plugin is technically marked as an optional dependency because we don't need to pull it in for Anonymous pages (such
// as the login page). That said, it _is_ required for this page to function correctly, so we throw an error here if it's not available.
@@ -483,6 +485,7 @@ export const EditRolePage: FunctionComponent = ({
license={license}
docLinks={docLinks}
canUseRemoteIndices={featureCheckState.value?.canUseRemoteIndices}
+ isDarkMode={isDarkMode}
/>
);
diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx
index 99ce696212888..295324a9e531c 100644
--- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx
+++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx
@@ -42,6 +42,7 @@ interface Props {
indexPatterns: string[];
remoteClusters?: Cluster[];
canUseRemoteIndices?: boolean;
+ isDarkMode?: boolean;
}
export class ElasticsearchPrivileges extends Component {
@@ -173,6 +174,7 @@ export class ElasticsearchPrivileges extends Component {
onChange={onChange}
availableIndexPrivileges={builtinESPrivileges.index}
editable={editable}
+ isDarkMode={this.props.isDarkMode}
/>
{canUseRemoteIndices && (
@@ -208,6 +210,7 @@ export class ElasticsearchPrivileges extends Component {
onChange={onChange}
availableIndexPrivileges={builtinESPrivileges.index}
editable={editable}
+ isDarkMode={this.props.isDarkMode}
/>
>
)}
diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.tsx
index 93775ff303438..30e1c6423d1ff 100644
--- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.tsx
+++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.tsx
@@ -48,6 +48,7 @@ interface Props {
allowDocumentLevelSecurity: boolean;
allowFieldLevelSecurity: boolean;
validator: RoleValidator;
+ isDarkMode?: boolean;
}
interface State {
@@ -460,6 +461,7 @@ export class IndexPrivilegeForm extends Component {
)}
value={indexPrivilege.query ?? ''}
onChange={this.onQueryChange}
+ useDarkTheme={this.props.isDarkMode}
options={{
readOnly: this.props.isRoleReadOnly,
minimap: {
diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.tsx
index 435e094999c24..56bd760ae793e 100644
--- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.tsx
+++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.tsx
@@ -29,6 +29,7 @@ interface Props {
onChange: (role: Role) => void;
validator: RoleValidator;
editable?: boolean;
+ isDarkMode?: boolean;
}
interface State {
@@ -94,6 +95,7 @@ export class IndexPrivileges extends Component {
remoteClusters={remoteClusters}
onChange={this.onIndexPrivilegeChange(i)}
onDelete={this.onIndexPrivilegeDelete(i)}
+ isDarkMode={this.props.isDarkMode}
/>
))}
{this.props.editable && (
diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/list_route.ts b/x-pack/plugins/security_solution/common/api/endpoint/actions/list_route.ts
index e2eabc39246ce..1f6ffe4e50613 100644
--- a/x-pack/plugins/security_solution/common/api/endpoint/actions/list_route.ts
+++ b/x-pack/plugins/security_solution/common/api/endpoint/actions/list_route.ts
@@ -9,6 +9,7 @@
import type { TypeOf } from '@kbn/config-schema';
import { schema } from '@kbn/config-schema';
import {
+ RESPONSE_ACTION_AGENT_TYPE,
RESPONSE_ACTION_API_COMMANDS_NAMES,
RESPONSE_ACTION_STATUS,
RESPONSE_ACTION_TYPE,
@@ -26,6 +27,11 @@ const statusesSchema = schema.oneOf(RESPONSE_ACTION_STATUS.map((status) => schem
// @ts-expect-error TS2769: No overload matches this call
const typesSchema = schema.oneOf(RESPONSE_ACTION_TYPE.map((type) => schema.literal(type)));
+const agentTypesSchema = schema.oneOf(
+ // @ts-expect-error TS2769: No overload matches this call
+ RESPONSE_ACTION_AGENT_TYPE.map((agentType) => schema.literal(agentType))
+);
+
export const EndpointActionListRequestSchema = {
query: schema.object({
agentIds: schema.maybe(
@@ -34,6 +40,14 @@ export const EndpointActionListRequestSchema = {
schema.string({ minLength: 1 }),
])
),
+ agentTypes: schema.maybe(
+ schema.oneOf([
+ schema.arrayOf(agentTypesSchema, {
+ minSize: 1,
+ }),
+ agentTypesSchema,
+ ])
+ ),
commands: schema.maybe(
schema.oneOf([schema.arrayOf(commandsSchema, { minSize: 1 }), commandsSchema])
),
diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/actions.test.ts b/x-pack/plugins/security_solution/common/endpoint/schema/actions.test.ts
index 5ba4ef7994459..b523d00336c4f 100644
--- a/x-pack/plugins/security_solution/common/endpoint/schema/actions.test.ts
+++ b/x-pack/plugins/security_solution/common/endpoint/schema/actions.test.ts
@@ -7,7 +7,10 @@
import { v4 as uuidv4 } from 'uuid';
-import { RESPONSE_ACTION_API_COMMANDS_NAMES } from '../service/response_actions/constants';
+import {
+ RESPONSE_ACTION_AGENT_TYPE,
+ RESPONSE_ACTION_API_COMMANDS_NAMES,
+} from '../service/response_actions/constants';
import { createHapiReadableStreamMock } from '../../../server/endpoint/services/actions/mocks';
import type { HapiReadableStream } from '../../../server/types';
import { EndpointActionListRequestSchema, UploadActionRequestSchema } from '../../api/endpoint';
@@ -88,6 +91,73 @@ describe('actions schemas', () => {
}).not.toThrow();
});
+ it('should accept undefined agentTypes ', () => {
+ expect(() => {
+ EndpointActionListRequestSchema.query.validate({ agentTypes: undefined });
+ }).not.toThrow();
+ });
+
+ it('should not accept empty agentTypes list', () => {
+ expect(() => {
+ EndpointActionListRequestSchema.query.validate({ agentTypes: [] });
+ }).toThrow();
+ });
+
+ it('should not accept invalid agentTypes list', () => {
+ expect(() => {
+ EndpointActionListRequestSchema.query.validate({ agentTypes: ['x'] });
+ }).toThrow();
+ });
+
+ it('should not accept invalid string agentTypes ', () => {
+ expect(() => {
+ EndpointActionListRequestSchema.query.validate({ agentTypes: 'non-agent' });
+ }).toThrow();
+ });
+
+ it('should not accept empty string agentTypes ', () => {
+ expect(() => {
+ EndpointActionListRequestSchema.query.validate({ agentTypes: '' });
+ }).toThrow();
+ });
+
+ it.each(RESPONSE_ACTION_AGENT_TYPE)('should accept allowed %s agentTypes ', (agentTypes) => {
+ expect(() => {
+ EndpointActionListRequestSchema.query.validate({ agentTypes });
+ }).not.toThrow();
+ });
+
+ it.each(RESPONSE_ACTION_AGENT_TYPE)(
+ 'should accept allowed %s agentTypes in a list',
+ (agentTypes) => {
+ expect(() => {
+ EndpointActionListRequestSchema.query.validate({ agentTypes: [agentTypes] });
+ }).not.toThrow();
+ }
+ );
+
+ it('should accept allowed agentTypes in list', () => {
+ expect(() => {
+ EndpointActionListRequestSchema.query.validate({ agentTypes: RESPONSE_ACTION_AGENT_TYPE });
+ }).not.toThrow();
+ });
+
+ it('should not accept invalid agentTypes in list', () => {
+ expect(() => {
+ EndpointActionListRequestSchema.query.validate({
+ agentTypes: [...RESPONSE_ACTION_AGENT_TYPE, 'non-agent'],
+ });
+ }).toThrow();
+ });
+
+ it('should not accept `undefined` agentTypes in list', () => {
+ expect(() => {
+ EndpointActionListRequestSchema.query.validate({
+ agentTypes: [undefined],
+ });
+ }).toThrow();
+ });
+
it('should work with all required query params', () => {
expect(() => {
EndpointActionListRequestSchema.query.validate({
diff --git a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/constants.ts b/x-pack/plugins/security_solution/common/endpoint/service/response_actions/constants.ts
index 67a29b7a185a2..6f8daab94e186 100644
--- a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/constants.ts
+++ b/x-pack/plugins/security_solution/common/endpoint/service/response_actions/constants.ts
@@ -92,7 +92,7 @@ export const RESPONSE_CONSOLE_ACTION_COMMANDS_TO_RBAC_FEATURE_CONTROL: Record<
upload: 'writeFileOperations',
});
-export const RESPONSE_ACTION_API_COMMANDS_TO_CONSOLE_COMMAND_MAP = Object.freeze<
+export const RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP = Object.freeze<
Record
>({
isolate: 'isolate',
@@ -105,6 +105,19 @@ export const RESPONSE_ACTION_API_COMMANDS_TO_CONSOLE_COMMAND_MAP = Object.freeze
upload: 'upload',
});
+export const RESPONSE_CONSOLE_COMMAND_TO_API_COMMAND_MAP = Object.freeze<
+ Record
+>({
+ isolate: 'isolate',
+ release: 'unisolate',
+ execute: 'execute',
+ 'get-file': 'get-file',
+ processes: 'running-processes',
+ 'kill-process': 'kill-process',
+ 'suspend-process': 'suspend-process',
+ upload: 'upload',
+});
+
export const RESPONSE_CONSOLE_ACTION_COMMANDS_TO_ENDPOINT_CAPABILITY = Object.freeze<
Record
>({
diff --git a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/is_response_action_supported.ts b/x-pack/plugins/security_solution/common/endpoint/service/response_actions/is_response_action_supported.ts
new file mode 100644
index 0000000000000..6b4688c3ffaa5
--- /dev/null
+++ b/x-pack/plugins/security_solution/common/endpoint/service/response_actions/is_response_action_supported.ts
@@ -0,0 +1,79 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { getRbacControl } from './utils';
+import type { EndpointPrivileges } from '../../types';
+import {
+ RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP,
+ type ResponseActionAgentType,
+ type ResponseActionsApiCommandNames,
+ type ResponseActionType,
+} from './constants';
+
+type SupportMap = Record<
+ ResponseActionsApiCommandNames,
+ Record>
+>;
+
+/** @private */
+const getResponseActionsSupportMap = ({
+ agentType,
+ actionName,
+ actionType,
+ privileges,
+}: {
+ agentType: ResponseActionAgentType;
+ actionName: ResponseActionsApiCommandNames;
+ actionType: ResponseActionType;
+ privileges: EndpointPrivileges;
+}): boolean => {
+ const commandName = RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[actionName];
+ const RESPONSE_ACTIONS_SUPPORT_MAP = {
+ [actionName]: {
+ automated: {
+ [agentType]:
+ agentType === 'endpoint'
+ ? getRbacControl({
+ commandName,
+ privileges,
+ })
+ : false,
+ },
+ manual: {
+ [agentType]:
+ agentType === 'endpoint'
+ ? getRbacControl({
+ commandName,
+ privileges,
+ })
+ : actionName === 'isolate' || actionName === 'unisolate',
+ },
+ },
+ } as SupportMap;
+ return RESPONSE_ACTIONS_SUPPORT_MAP[actionName][actionType][agentType];
+};
+
+/**
+ * Determine if a given response action is currently supported
+ * @param agentType
+ * @param actionName
+ * @param actionType
+ * @param privileges
+ */
+export const isResponseActionSupported = (
+ agentType: ResponseActionAgentType,
+ actionName: ResponseActionsApiCommandNames,
+ actionType: ResponseActionType,
+ privileges: EndpointPrivileges
+): boolean => {
+ return getResponseActionsSupportMap({
+ privileges,
+ actionName,
+ actionType,
+ agentType,
+ });
+};
diff --git a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/utils.ts b/x-pack/plugins/security_solution/common/endpoint/service/response_actions/utils.ts
new file mode 100644
index 0000000000000..71a05b5a09713
--- /dev/null
+++ b/x-pack/plugins/security_solution/common/endpoint/service/response_actions/utils.ts
@@ -0,0 +1,22 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import {
+ type ConsoleResponseActionCommands,
+ RESPONSE_CONSOLE_ACTION_COMMANDS_TO_REQUIRED_AUTHZ,
+} from './constants';
+import type { EndpointPrivileges } from '../../types';
+
+export const getRbacControl = ({
+ commandName,
+ privileges,
+}: {
+ commandName: ConsoleResponseActionCommands;
+ privileges: EndpointPrivileges;
+}): boolean => {
+ return Boolean(privileges[RESPONSE_CONSOLE_ACTION_COMMANDS_TO_REQUIRED_AUTHZ[commandName]]);
+};
diff --git a/x-pack/plugins/security_solution/common/endpoint/types/actions.ts b/x-pack/plugins/security_solution/common/endpoint/types/actions.ts
index 9b89954ee6974..785681a18c2b7 100644
--- a/x-pack/plugins/security_solution/common/endpoint/types/actions.ts
+++ b/x-pack/plugins/security_solution/common/endpoint/types/actions.ts
@@ -7,7 +7,7 @@
import type { TypeOf } from '@kbn/config-schema';
import type { EcsError } from '@kbn/ecs';
-import type { FileJSON, BaseFileMetadata, FileCompression } from '@kbn/files-plugin/common';
+import type { BaseFileMetadata, FileCompression, FileJSON } from '@kbn/files-plugin/common';
import type { ResponseActionBodySchema, UploadActionApiRequestBody } from '../../api/endpoint';
import type { ActionStatusRequestSchema } from '../../api/endpoint/actions/action_status_route';
import type {
@@ -15,9 +15,9 @@ import type {
NoParametersRequestSchema,
} from '../../api/endpoint/actions/common/base';
import type {
- ResponseActionStatus,
- ResponseActionsApiCommandNames,
ResponseActionAgentType,
+ ResponseActionsApiCommandNames,
+ ResponseActionStatus,
} from '../service/response_actions/constants';
export type ISOLATION_ACTIONS = 'isolate' | 'unisolate';
@@ -289,6 +289,7 @@ export interface ActivityLogAction {
data: EndpointAction;
};
}
+
export interface ActivityLogActionResponse {
type: typeof ActivityLogItemTypes.FLEET_RESPONSE;
item: {
@@ -328,6 +329,7 @@ export interface HostIsolationResponse {
}
export type ProcessesRequestBody = TypeOf;
+
export interface ResponseActionApiResponse<
TOutputContent extends EndpointActionResponseDataOutput = EndpointActionResponseDataOutput
> {
@@ -437,6 +439,7 @@ export interface ActionListApiResponse {
page: number | undefined;
pageSize: number | undefined;
startDate: string | undefined;
+ agentTypes: ResponseActionAgentType[] | undefined;
elasticAgentIds: string[] | undefined;
endDate: string | undefined;
userIds: string[] | undefined; // users that requested the actions
diff --git a/x-pack/plugins/security_solution/common/types/index.ts b/x-pack/plugins/security_solution/common/types/index.ts
index 42a3c10fc48e4..877c7c4f0247f 100644
--- a/x-pack/plugins/security_solution/common/types/index.ts
+++ b/x-pack/plugins/security_solution/common/types/index.ts
@@ -12,6 +12,7 @@ export * from './detail_panel';
export * from './header_actions';
export * from './session_view';
export * from './bulk_actions';
+export * from './third_party_agent';
export const FILTER_OPEN: Status = 'open';
export const FILTER_CLOSED: Status = 'closed';
diff --git a/x-pack/plugins/security_solution/common/types/third_party_agent/index.ts b/x-pack/plugins/security_solution/common/types/third_party_agent/index.ts
new file mode 100644
index 0000000000000..a7f3315be04e5
--- /dev/null
+++ b/x-pack/plugins/security_solution/common/types/third_party_agent/index.ts
@@ -0,0 +1,24 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import type { ResponseActionAgentType } from '../../endpoint/service/response_actions/constants';
+
+export interface ThirdPartyAgentInfo {
+ agent: {
+ id: string;
+ type: ResponseActionAgentType;
+ };
+ host: {
+ name: string;
+ os: {
+ name: string;
+ family: string;
+ version: string;
+ };
+ };
+ lastCheckin: string;
+}
diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/endpoint_agent_status/endpoint_agent_status.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/endpoint_agent_status/endpoint_agent_status.tsx
index a90a2a2c4b4a8..c9aa9b3bfffad 100644
--- a/x-pack/plugins/security_solution/public/common/components/endpoint/endpoint_agent_status/endpoint_agent_status.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/endpoint/endpoint_agent_status/endpoint_agent_status.tsx
@@ -20,11 +20,13 @@ import { i18n } from '@kbn/i18n';
import { DEFAULT_POLL_INTERVAL } from '../../../../management/common/constants';
import { HOST_STATUS_TO_BADGE_COLOR } from '../../../../management/pages/endpoint_hosts/view/host_constants';
import { getEmptyValue } from '../../empty_value';
-import type { ResponseActionsApiCommandNames } from '../../../../../common/endpoint/service/response_actions/constants';
-import { RESPONSE_ACTION_API_COMMANDS_TO_CONSOLE_COMMAND_MAP } from '../../../../../common/endpoint/service/response_actions/constants';
+import {
+ RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP,
+ type ResponseActionsApiCommandNames,
+} from '../../../../../common/endpoint/service/response_actions/constants';
import { useGetEndpointPendingActionsSummary } from '../../../../management/hooks/response_actions/use_get_endpoint_pending_actions_summary';
import { useTestIdGenerator } from '../../../../management/hooks/use_test_id_generator';
-import type { HostInfo, EndpointPendingActions } from '../../../../../common/endpoint/types';
+import type { EndpointPendingActions, HostInfo } from '../../../../../common/endpoint/types';
import { useGetEndpointDetails } from '../../../../management/hooks';
import { getAgentStatusText } from '../agent_status_text';
@@ -219,7 +221,7 @@ const EndpointHostResponseActionsStatus = memo {
matches: false,
media: query,
onchange: null,
- addListener: jest.fn(),
- removeListener: jest.fn(),
+ addListener: jest.fn(), // deprecated
+ removeListener: jest.fn(), // deprecated
+ addEventListener: jest.fn(),
+ removeEventListener: jest.fn(),
};
});
diff --git a/x-pack/plugins/security_solution/public/common/translations.ts b/x-pack/plugins/security_solution/public/common/translations.ts
index 824b86cd8bb55..534e553824ad6 100644
--- a/x-pack/plugins/security_solution/public/common/translations.ts
+++ b/x-pack/plugins/security_solution/public/common/translations.ts
@@ -6,6 +6,10 @@
*/
import { i18n } from '@kbn/i18n';
+import type {
+ ConsoleResponseActionCommands,
+ ResponseActionAgentType,
+} from '../../common/endpoint/service/response_actions/constants';
export const SOLUTION_NAME = i18n.translate('xpack.securitySolution.pages.common.solutionName', {
defaultMessage: 'Security',
@@ -29,13 +33,24 @@ export const UPDATE_ALERT_STATUS_FAILED_DETAILED = (updated: number, conflicts:
because { conflicts, plural, =1 {it was} other {they were}} already being modified.`,
});
-export const UPGRADE_ENDPOINT_FOR_RESPONDER = i18n.translate(
- 'xpack.securitySolution.endpoint.actions.disabledResponder.tooltip',
- {
- defaultMessage:
- 'The current version of the Agent does not support this feature. Upgrade your Agent through Fleet to use this feature and new response actions such as killing and suspending processes.',
+export const UPGRADE_AGENT_FOR_RESPONDER = (
+ _agentType: ResponseActionAgentType,
+ command: ConsoleResponseActionCommands
+) => {
+ const agentType = getAgentTypeName(_agentType);
+
+ if (_agentType === 'endpoint') {
+ return i18n.translate('xpack.securitySolution.endpoint.actions.unsupported.message', {
+ defaultMessage: `The current version of the {agentType} Agent does not support {command}. Upgrade your Elastic Agent through Fleet to the latest version to enable this response action.`,
+ values: { agentType, command },
+ });
}
-);
+
+ return i18n.translate('xpack.securitySolution.agent.actions.unsupported.message', {
+ defaultMessage: `Support for {command} is not currently available for {agentType}.`,
+ values: { agentType, command },
+ });
+};
export const INSUFFICIENT_PRIVILEGES_FOR_COMMAND = i18n.translate(
'xpack.securitySolution.endpoint.actions.insufficientPrivileges.error',
@@ -58,3 +73,14 @@ export const UNSAVED_TIMELINE_SAVE_PROMPT_TITLE = i18n.translate(
defaultMessage: 'Unsaved changes',
}
);
+
+const getAgentTypeName = (agentType: ResponseActionAgentType) => {
+ switch (agentType) {
+ case 'endpoint':
+ return 'Endpoint';
+ case 'sentinel_one':
+ return 'SentinelOne';
+ default:
+ return agentType;
+ }
+};
diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_diff_tab.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_diff_tab.tsx
index 0da09e7e3d0ff..fc1fa754f9694 100644
--- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_diff_tab.tsx
+++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_diff_tab.tsx
@@ -6,7 +6,7 @@
*/
import React, { useMemo } from 'react';
-import { omit } from 'lodash';
+import { omit, pick } from 'lodash';
import stringify from 'json-stable-stringify';
import {
EuiSpacer,
@@ -16,13 +16,113 @@ import {
EuiTitle,
EuiIconTip,
} from '@elastic/eui';
+import type { Filter } from '@kbn/es-query';
+import { normalizeMachineLearningJobIds } from '../../../../../common/detection_engine/utils';
+import {
+ formatScheduleStepData,
+ filterEmptyThreats,
+} from '../../../rule_creation_ui/pages/rule_creation/helpers';
import type { RuleResponse } from '../../../../../common/api/detection_engine/model/rule_schema/rule_schemas.gen';
import { DiffView } from './json_diff/diff_view';
import * as i18n from './json_diff/translations';
+import { getHumanizedDuration } from '../../../../detections/pages/detection_engine/rules/helpers';
+
+/* Inclding these properties in diff display might be confusing to users. */
+const HIDDEN_PROPERTIES = [
+ /*
+ By default, prebuilt rules don't have any actions or exception lists. So if a user has defined actions or exception lists for a rule, it'll show up as diff. This looks confusing as the user might think that their actions and exceptions lists will get removed after the upgrade, which is not the case - they will be preserved.
+ */
+ 'actions',
+ 'exceptions_list',
+
+ /*
+ Most prebuilt rules are installed as "disabled". Once user enables a rule, it'll show as diff, which doesn't add value.
+ */
+ 'enabled',
+
+ /* Technical property. Hidden because it can be confused with "version" by users. */
+ 'revision',
+
+ /*
+ "updated_at" value is regenerated on every '/upgrade/_review' endpoint run
+ and will therefore always show a diff. It adds no value to display it to the user.
+ */
+ 'updated_at',
+];
const sortAndStringifyJson = (jsObject: Record): string =>
stringify(jsObject, { space: 2 });
+/**
+ * Normalizes the rule object, making it suitable for comparison with another normalized rule.
+ *
+ * Normalization is needed to avoid showing diffs for semantically equal property values.
+ * Saving a rule via the rule editing UI might change the format of some properties or set default values.
+ * This function compensates for those changes.
+ *
+ * @param {RuleResponse} originalRule - Rule of a RuleResponse type.
+ * @returns {RuleResponse} - The updated normalized rule object.
+ */
+const normalizeRule = (originalRule: RuleResponse): RuleResponse => {
+ const rule = { ...originalRule };
+
+ /*
+ Convert the "from" property value to a humanized duration string, like 'now-1m' or 'now-2h'.
+ Conversion is needed to skip showing the diff for the "from" property when the same
+ duration is represented in different time units. For instance, 'now-1h' and 'now-3600s'
+ indicate a one-hour duration.
+ The same helper is used in the rule editing UI to format "from" before submitting the edits.
+ So, after the rule is saved, the "from" property unit/value might differ from what's in the package.
+ */
+ rule.from = formatScheduleStepData({
+ interval: rule.interval,
+ from: getHumanizedDuration(rule.from, rule.interval),
+ to: rule.to,
+ }).from;
+
+ /*
+ Default "note" to an empty string if it's not present.
+ Sometimes, in a new version of a rule, the "note" value equals an empty string, while
+ in the old version, it wasn't specified at all (undefined becomes ''). In this case,
+ it doesn't make sense to show diff, so we default falsy values to ''.
+ */
+ rule.note = rule.note ?? '';
+
+ /*
+ Removes empty arrays (techniques, subtechniques) from the MITRE ATT&CK value.
+ The same processing is done in the rule editing UI before submitting the edits.
+ */
+ rule.threat = filterEmptyThreats(rule.threat);
+
+ /*
+ The "machine_learning_job_id" property is converted from the legacy string format
+ to the new array format during installation and upgrade. Thus, all installed rules
+ use the new format. For correct comparison, we must ensure that the rule update is
+ also in the new format before showing the diff.
+ */
+ if ('machine_learning_job_id' in rule) {
+ rule.machine_learning_job_id = normalizeMachineLearningJobIds(rule.machine_learning_job_id);
+ }
+
+ /*
+ Default the "alias" property to null for all threat filters that don't have it.
+ Setting a default is needed to match the behavior of the rule editing UI,
+ which also defaults the "alias" property to null.
+ */
+ if (rule.type === 'threat_match' && Array.isArray(rule.threat_filters)) {
+ const threatFiltersWithDefaultMeta = (rule.threat_filters as Filter[]).map((filter) => {
+ if (!filter.meta.alias) {
+ return { ...filter, meta: { ...filter.meta, alias: null } };
+ }
+ return filter;
+ });
+
+ rule.threat_filters = threatFiltersWithDefaultMeta;
+ }
+
+ return rule;
+};
+
interface RuleDiffTabProps {
oldRule: RuleResponse;
newRule: RuleResponse;
@@ -30,8 +130,11 @@ interface RuleDiffTabProps {
export const RuleDiffTab = ({ oldRule, newRule }: RuleDiffTabProps) => {
const [oldSource, newSource] = useMemo(() => {
- const visibleOldRuleProperties = omit(oldRule, 'revision');
- const visibleNewRuleProperties = omit(newRule, 'revision');
+ const visibleNewRuleProperties = omit(normalizeRule(newRule), ...HIDDEN_PROPERTIES);
+ const visibleOldRuleProperties = omit(
+ /* Only compare properties that are present in the update. */
+ pick(normalizeRule(oldRule), Object.keys(visibleNewRuleProperties))
+ );
return [
sortAndStringifyJson(visibleOldRuleProperties),
diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/action_type_field.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/action_type_field.tsx
index cdc9fe8ef8d64..fa40754f222c4 100644
--- a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/action_type_field.tsx
+++ b/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/action_type_field.tsx
@@ -13,13 +13,15 @@ import { SuperSelectField } from '@kbn/es-ui-shared-plugin/static/forms/componen
import { fieldValidators } from '@kbn/es-ui-shared-plugin/static/forms/helpers';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiLink } from '@elastic/eui';
+import { getRbacControl } from '../../../../common/endpoint/service/response_actions/utils';
import { useKibana } from '../../../common/lib/kibana';
import { CHOOSE_FROM_THE_LIST, LEARN_MORE } from './translations';
import { EndpointActionText } from './utils';
-import { getUiCommand } from '../../../management/components/endpoint_response_actions_list/components/hooks';
-import { getRbacControl } from '../../../management/components/endpoint_responder/lib/console_commands_definition';
import { useUserPrivileges } from '../../../common/components/user_privileges';
-import { ENABLED_AUTOMATED_RESPONSE_ACTION_COMMANDS } from '../../../../common/endpoint/service/response_actions/constants';
+import {
+ ENABLED_AUTOMATED_RESPONSE_ACTION_COMMANDS,
+ RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP,
+} from '../../../../common/endpoint/service/response_actions/constants';
interface ActionTypeFieldProps {
basePath: string;
@@ -46,7 +48,7 @@ const ActionTypeFieldComponent = ({
() =>
ENABLED_AUTOMATED_RESPONSE_ACTION_COMMANDS.map((name) => {
const missingRbac = !getRbacControl({
- commandName: getUiCommand(name),
+ commandName: RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[name],
privileges: endpointPrivileges,
});
const commandAlreadyExists = map(data.responseActions, 'params.command').includes(name);
diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.ts
index 838b4992e26ff..2fe8fb81fa169 100644
--- a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.ts
+++ b/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.ts
@@ -5,9 +5,9 @@
* 2.0.
*/
-import type { RuleResponseAction } from '../../../../common/api/detection_engine/model/rule_response_actions';
-import { getRbacControl } from '../../../management/components/endpoint_responder/lib/console_commands_definition';
-import { getUiCommand } from '../../../management/components/endpoint_response_actions_list/components/hooks';
+import { RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP } from '../../../../common/endpoint/service/response_actions/constants';
+import type { RuleResponseAction } from '../../../../common/api/detection_engine';
+import { getRbacControl } from '../../../../common/endpoint/service/response_actions/utils';
import { useUserPrivileges } from '../../../common/components/user_privileges';
export const useCheckEndpointPermissions = (action: RuleResponseAction) => {
@@ -15,7 +15,7 @@ export const useCheckEndpointPermissions = (action: RuleResponseAction) => {
if (action?.actionTypeId === '.endpoint' && action?.params?.command) {
return !getRbacControl({
- commandName: getUiCommand(action.params.command),
+ commandName: RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[action.params.command],
privileges: endpointPrivileges,
});
}
diff --git a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_data.ts b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_data.ts
index 8a35bf420a5ba..8a4d98ae76f90 100644
--- a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_data.ts
+++ b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_data.ts
@@ -6,53 +6,104 @@
*/
import type { ReactNode } from 'react';
import { useCallback, useMemo } from 'react';
-import { useGetEndpointDetails, useWithShowEndpointResponder } from '../../../management/hooks';
+import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common';
+import { getSentinelOneAgentId } from '../../../common/utils/sentinelone_alert_check';
+import type { ThirdPartyAgentInfo } from '../../../../common/types';
+import type { ResponseActionAgentType } from '../../../../common/endpoint/service/response_actions/constants';
+import { useGetEndpointDetails, useWithShowResponder } from '../../../management/hooks';
import { HostStatus } from '../../../../common/endpoint/types';
import {
- NOT_FROM_ENDPOINT_HOST_TOOLTIP,
- LOADING_ENDPOINT_DATA_TOOLTIP,
HOST_ENDPOINT_UNENROLLED_TOOLTIP,
+ LOADING_ENDPOINT_DATA_TOOLTIP,
METADATA_API_ERROR_TOOLTIP,
+ NOT_FROM_ENDPOINT_HOST_TOOLTIP,
} from './translations';
+import { getFieldValue } from '../host_isolation/helpers';
export interface ResponderContextMenuItemProps {
endpointId: string;
onClick?: () => void;
+ agentType?: ResponseActionAgentType;
+ eventData?: TimelineEventsDetailsItem[] | null;
}
+const getThirdPartyAgentInfo = (
+ eventData: TimelineEventsDetailsItem[] | null
+): ThirdPartyAgentInfo => {
+ return {
+ agent: {
+ id: getSentinelOneAgentId(eventData) || '',
+ type: getFieldValue(
+ { category: 'event', field: 'event.module' },
+ eventData
+ ) as ResponseActionAgentType,
+ },
+ host: {
+ name: getFieldValue({ category: 'host', field: 'host.os.name' }, eventData),
+ os: {
+ name: getFieldValue({ category: 'host', field: 'host.os.name' }, eventData),
+ family: getFieldValue({ category: 'host', field: 'host.os.family' }, eventData),
+ version: getFieldValue({ category: 'host', field: 'host.os.version' }, eventData),
+ },
+ },
+ lastCheckin: getFieldValue(
+ { category: 'kibana', field: 'kibana.alert.last_detected' },
+ eventData
+ ),
+ };
+};
+
+/**
+ * This hook is used to get the data needed to show the context menu items for the responder
+ * actions.
+ * @param endpointId the id of the endpoint
+ * @param onClick the callback to handle the click event
+ * @param agentType the type of agent, defaults to 'endpoint'
+ * @param eventData the event data, exists only when agentType !== 'endpoint'
+ * @returns an object with the data needed to show the context menu item
+ */
+
export const useResponderActionData = ({
endpointId,
onClick,
+ agentType = 'endpoint',
+ eventData,
}: ResponderContextMenuItemProps): {
handleResponseActionsClick: () => void;
isDisabled: boolean;
tooltip: ReactNode;
} => {
- const showEndpointResponseActionsConsole = useWithShowEndpointResponder();
+ const isEndpointHost = agentType === 'endpoint';
+ const showResponseActionsConsole = useWithShowResponder();
const {
- data: endpointHostInfo,
+ data: hostInfo,
isFetching,
error,
} = useGetEndpointDetails(endpointId, { enabled: Boolean(endpointId) });
const [isDisabled, tooltip]: [disabled: boolean, tooltip: ReactNode] = useMemo(() => {
- // Still loading Endpoint host info
+ if (!isEndpointHost) {
+ return [false, undefined];
+ }
+
+ // Still loading host info
if (isFetching) {
return [true, LOADING_ENDPOINT_DATA_TOOLTIP];
}
- // if we got an error, and it's a 404 it means the endpoint is not from the endpoint host
+ // if we got an error, and it's a 404, it means the endpoint is not from the endpoint host
if (error && error.body?.statusCode === 404) {
return [true, NOT_FROM_ENDPOINT_HOST_TOOLTIP];
}
- // if we got an error and it's a 400 with unenrolled in the error message (alerts can exist for endpoint that are no longer around)
+ // if we got an error and,
+ // it's a 400 with unenrolled in the error message (alerts can exist for endpoint that are no longer around)
// or,
// the Host status is `unenrolled`
if (
(error && error.body?.statusCode === 400 && error.body?.message.includes('unenrolled')) ||
- endpointHostInfo?.host_status === HostStatus.UNENROLLED
+ hostInfo?.host_status === HostStatus.UNENROLLED
) {
return [true, HOST_ENDPOINT_UNENROLLED_TOOLTIP];
}
@@ -63,12 +114,34 @@ export const useResponderActionData = ({
}
return [false, undefined];
- }, [endpointHostInfo, error, isFetching]);
+ }, [isEndpointHost, isFetching, error, hostInfo?.host_status]);
const handleResponseActionsClick = useCallback(() => {
- if (endpointHostInfo) showEndpointResponseActionsConsole(endpointHostInfo.metadata);
+ if (!isEndpointHost) {
+ const agentInfoFromAlert = getThirdPartyAgentInfo(eventData || null);
+ showResponseActionsConsole({
+ agentId: agentInfoFromAlert.agent.id,
+ agentType,
+ capabilities: ['isolation'],
+ hostName: agentInfoFromAlert.host.name,
+ platform: agentInfoFromAlert.host.os.family,
+ lastCheckin: agentInfoFromAlert.lastCheckin,
+ });
+ }
+ if (hostInfo) {
+ showResponseActionsConsole({
+ agentId: hostInfo.metadata.agent.id,
+ agentType: 'endpoint',
+ capabilities: hostInfo.metadata.Endpoint.capabilities ?? [],
+ hostName: hostInfo.metadata.host.name,
+ });
+ }
if (onClick) onClick();
- }, [endpointHostInfo, onClick, showEndpointResponseActionsConsole]);
+ }, [isEndpointHost, hostInfo, onClick, eventData, showResponseActionsConsole, agentType]);
- return { handleResponseActionsClick, isDisabled, tooltip };
+ return {
+ handleResponseActionsClick,
+ isDisabled,
+ tooltip,
+ };
};
diff --git a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_item.tsx b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_item.tsx
index 737a862b12809..41fad6fd2e174 100644
--- a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_item.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_item.tsx
@@ -8,6 +8,8 @@
import React, { useMemo } from 'react';
import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common';
import { FormattedMessage } from '@kbn/i18n-react';
+import { isAlertFromSentinelOneEvent } from '../../../common/utils/sentinelone_alert_check';
+import type { ResponseActionAgentType } from '../../../../common/endpoint/service/response_actions/constants';
import { useUserPrivileges } from '../../../common/components/user_privileges';
import { isTimelineEventItemAnAlert } from '../../../common/utils/endpoint_alert_check';
import { getFieldValue } from '../host_isolation/helpers';
@@ -25,14 +27,26 @@ export const useResponderActionItem = (
return isTimelineEventItemAnAlert(eventDetailsData || []);
}, [eventDetailsData]);
- const endpointId = useMemo(
+ const endpointId: string = useMemo(
() => getFieldValue({ category: 'agent', field: 'agent.id' }, eventDetailsData),
[eventDetailsData]
);
+ const agentType: ResponseActionAgentType = useMemo(
+ () =>
+ eventDetailsData
+ ? isAlertFromSentinelOneEvent({ data: eventDetailsData })
+ ? 'sentinel_one'
+ : 'endpoint'
+ : 'endpoint',
+ [eventDetailsData]
+ );
+
const { handleResponseActionsClick, isDisabled, tooltip } = useResponderActionData({
endpointId,
onClick,
+ agentType,
+ eventData: agentType !== 'endpoint' ? eventDetailsData : null,
});
return useMemo(() => {
diff --git a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx
index a3e7b942953fb..b5cd65abb28a2 100644
--- a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx
@@ -18,7 +18,7 @@ import { TimelineId } from '../../../../common/types/timeline';
import { TestProviders } from '../../../common/mock';
import { mockTimelines } from '../../../common/mock/mock_timelines_plugin';
import { createStartServicesMock } from '../../../common/lib/kibana/kibana_react.mock';
-import { useKibana, useHttp } from '../../../common/lib/kibana';
+import { useHttp, useKibana } from '../../../common/lib/kibana';
import { mockCasesContract } from '@kbn/cases-plugin/public/mocks';
import { initialUserPrivilegesState as mockInitialUserPrivilegesState } from '../../../common/components/user_privileges/user_privileges_context';
import { useUserPrivileges } from '../../../common/components/user_privileges';
@@ -30,8 +30,8 @@ import {
import { endpointMetadataHttpMocks } from '../../../management/pages/endpoint_hosts/mocks';
import type { HttpSetup } from '@kbn/core/public';
import {
- isAlertFromEndpointEvent,
isAlertFromEndpointAlert,
+ isAlertFromEndpointEvent,
} from '../../../common/utils/endpoint_alert_check';
import { getUserPrivilegesMockDefaultValue } from '../../../common/components/user_privileges/__mocks__';
import { allCasesPermissions } from '../../../cases_test_utils';
@@ -62,7 +62,7 @@ jest.mock('../../../common/hooks/use_app_toasts', () => ({
}));
jest.mock('../../../common/hooks/use_license', () => ({
- useLicense: jest.fn().mockReturnValue({ isPlatinumPlus: () => true }),
+ useLicense: jest.fn().mockReturnValue({ isPlatinumPlus: () => true, isEnterprise: () => false }),
}));
jest.mock('../../../common/hooks/use_experimental_features', () => ({
diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx
index 8e49e90c4cadd..1a05128de67ca 100644
--- a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx
+++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx
@@ -36,12 +36,15 @@ import { useInitRiskEngineMutation } from '../api/hooks/use_init_risk_engine_mut
import { useEnableRiskEngineMutation } from '../api/hooks/use_enable_risk_engine_mutation';
import { useDisableRiskEngineMutation } from '../api/hooks/use_disable_risk_engine_mutation';
import { RiskEngineStatus, MAX_SPACES_COUNT } from '../../../common/entity_analytics/risk_engine';
-
+import { useAppToasts } from '../../common/hooks/use_app_toasts';
import { RiskInformationFlyout } from './risk_information';
import { useOnOpenCloseHandler } from '../../helper_hooks';
import type { RiskEngineMissingPrivilegesResponse } from '../hooks/use_missing_risk_engine_privileges';
const MIN_WIDTH_TO_PREVENT_LABEL_FROM_MOVING = '50px';
+const toastOptions = {
+ toastLifeTimeMs: 5000,
+};
const RiskScoreErrorPanel = ({ errors }: { errors: string[] }) => (
<>
@@ -189,16 +192,28 @@ const RiskEngineStatusRow: React.FC<{
export const RiskScoreEnableSection: React.FC<{
privileges: RiskEngineMissingPrivilegesResponse;
}> = ({ privileges }) => {
+ const { addSuccess } = useAppToasts();
const [isModalVisible, setIsModalVisible] = useState(false);
const { data: riskEngineStatus, isFetching: isStatusLoading } = useRiskEngineStatus();
const initRiskEngineMutation = useInitRiskEngineMutation({
+ onSuccess: () => {
+ addSuccess(i18n.RISK_SCORE_MODULE_TURNED_ON, toastOptions);
+ },
onSettled: () => {
setIsModalVisible(false);
},
});
- const enableRiskEngineMutation = useEnableRiskEngineMutation();
- const disableRiskEngineMutation = useDisableRiskEngineMutation();
+ const enableRiskEngineMutation = useEnableRiskEngineMutation({
+ onSuccess: () => {
+ addSuccess(i18n.RISK_SCORE_MODULE_TURNED_ON, toastOptions);
+ },
+ });
+ const disableRiskEngineMutation = useDisableRiskEngineMutation({
+ onSuccess: () => {
+ addSuccess(i18n.RISK_SCORE_MODULE_TURNED_OFF, toastOptions);
+ },
+ });
const currentRiskEngineStatus = riskEngineStatus?.risk_engine_status;
diff --git a/x-pack/plugins/security_solution/public/entity_analytics/translations.ts b/x-pack/plugins/security_solution/public/entity_analytics/translations.ts
index 533f28f207de6..8d8e46d9dcfdc 100644
--- a/x-pack/plugins/security_solution/public/entity_analytics/translations.ts
+++ b/x-pack/plugins/security_solution/public/entity_analytics/translations.ts
@@ -288,3 +288,17 @@ export const NEED_TO_HAVE = i18n.translate(
defaultMessage: 'You need to have:',
}
);
+
+export const RISK_SCORE_MODULE_TURNED_ON = i18n.translate(
+ 'xpack.securitySolution.riskScore.moduleTurnedOn',
+ {
+ defaultMessage: 'Entity risk score has been turned on',
+ }
+);
+
+export const RISK_SCORE_MODULE_TURNED_OFF = i18n.translate(
+ 'xpack.securitySolution.riskScore.moduleTurnedOff',
+ {
+ defaultMessage: 'Entity risk score has been turned off',
+ }
+);
diff --git a/x-pack/plugins/security_solution/public/helpers.test.tsx b/x-pack/plugins/security_solution/public/helpers.test.tsx
index a305434a1ff11..1e053c84ba91d 100644
--- a/x-pack/plugins/security_solution/public/helpers.test.tsx
+++ b/x-pack/plugins/security_solution/public/helpers.test.tsx
@@ -15,6 +15,7 @@ import {
isSubPluginAvailable,
getSubPluginRoutesByCapabilities,
getField,
+ isDashboardViewPath,
} from './helpers';
import type { StartedSubPlugins } from './types';
import {
@@ -257,3 +258,23 @@ describe('public helpers getField', () => {
expect(signalQuery).toEqual(aadQuery);
});
});
+
+describe('isDashboardViewPath', () => {
+ it('returns true for dashboard view path', () => {
+ expect(isDashboardViewPath('/dashboards/59c085c3-394d-49ab-a83a-56a63f38aa5f')).toEqual(true);
+ });
+
+ it('returns true for dashboard edit path', () => {
+ expect(isDashboardViewPath('/dashboards/59c085c3-394d-49ab-a83a-56a63f38aa5f/edit')).toEqual(
+ true
+ );
+ });
+
+ it('returns true for dashboard creation path', () => {
+ expect(isDashboardViewPath('/dashboards/create')).toEqual(true);
+ });
+
+ it('returns false for dashboard listing path', () => {
+ expect(isDashboardViewPath('/dashboards')).toEqual(false);
+ });
+});
diff --git a/x-pack/plugins/security_solution/public/helpers.tsx b/x-pack/plugins/security_solution/public/helpers.tsx
index 09ad6612bdb06..5794263282fec 100644
--- a/x-pack/plugins/security_solution/public/helpers.tsx
+++ b/x-pack/plugins/security_solution/public/helpers.tsx
@@ -176,7 +176,7 @@ export const isDetectionsPath = (pathname: string): boolean => {
export const isDashboardViewPath = (pathname: string): boolean =>
matchPath(pathname, {
- path: `/${DASHBOARDS_PATH}/:id`,
+ path: `${DASHBOARDS_PATH}/:detailName`,
exact: false,
strict: false,
}) != null;
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx
index 095710e50466a..81d408e229bbd 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx
@@ -55,7 +55,7 @@ export const GetProcessesActionResult = memo(
comment: command.args.args?.comment?.[0],
}
: undefined;
- }, [command.args.args?.comment, endpointId]);
+ }, [endpointId, command.args.args?.comment]);
const { result, actionDetails: completedActionDetails } = useConsoleActionSubmitter<
ProcessesRequestBody,
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/execute_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/execute_action.test.tsx
index f789e078da8a2..68388ec1c9ff1 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/execute_action.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/execute_action.test.tsx
@@ -21,7 +21,10 @@ import { waitFor } from '@testing-library/react';
import { EXECUTE_ROUTE } from '../../../../../../common/endpoint/constants';
import { getEndpointAuthzInitialStateMock } from '../../../../../../common/endpoint/service/authz/mocks';
import type { EndpointPrivileges } from '../../../../../../common/endpoint/types';
-import { INSUFFICIENT_PRIVILEGES_FOR_COMMAND } from '../../../../../common/translations';
+import {
+ INSUFFICIENT_PRIVILEGES_FOR_COMMAND,
+ UPGRADE_AGENT_FOR_RESPONDER,
+} from '../../../../../common/translations';
import type { HttpFetchOptionsWithPath } from '@kbn/core-http-browser';
import { endpointActionResponseCodes } from '../../lib/endpoint_action_response_codes';
import { EndpointActionGenerator } from '../../../../../../common/endpoint/data_generators/endpoint_action_generator';
@@ -54,6 +57,7 @@ describe('When using execute action from response actions console', () => {
consoleProps: {
'data-test-subj': 'test',
commands: getEndpointConsoleCommands({
+ agentType: 'endpoint',
endpointAgentId: 'a.b.c',
endpointCapabilities: [...capabilities],
endpointPrivileges,
@@ -78,7 +82,7 @@ describe('When using execute action from response actions console', () => {
enterConsoleCommand(renderResult, 'execute --command="ls -al"');
expect(renderResult.getByTestId('test-validationError-message').textContent).toEqual(
- 'The current version of the Agent does not support this feature. Upgrade your Agent through Fleet to use this feature and new response actions such as killing and suspending processes.'
+ UPGRADE_AGENT_FOR_RESPONDER('endpoint', 'execute')
);
});
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx
index 3a9c83c244341..9c6e49818daf6 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx
@@ -25,7 +25,10 @@ import type {
EndpointPrivileges,
ResponseActionGetFileOutputContent,
} from '../../../../../../common/endpoint/types';
-import { INSUFFICIENT_PRIVILEGES_FOR_COMMAND } from '../../../../../common/translations';
+import {
+ INSUFFICIENT_PRIVILEGES_FOR_COMMAND,
+ UPGRADE_AGENT_FOR_RESPONDER,
+} from '../../../../../common/translations';
import type { HttpFetchOptionsWithPath } from '@kbn/core-http-browser';
import { endpointActionResponseCodes } from '../../lib/endpoint_action_response_codes';
@@ -57,6 +60,7 @@ describe('When using get-file action from response actions console', () => {
consoleProps: {
'data-test-subj': 'test',
commands: getEndpointConsoleCommands({
+ agentType: 'endpoint',
endpointAgentId: 'a.b.c',
endpointCapabilities: [...capabilities],
endpointPrivileges,
@@ -81,7 +85,7 @@ describe('When using get-file action from response actions console', () => {
enterConsoleCommand(renderResult, 'get-file --path="one/two"');
expect(renderResult.getByTestId('test-validationError-message').textContent).toEqual(
- 'The current version of the Agent does not support this feature. Upgrade your Agent through Fleet to use this feature and new response actions such as killing and suspending processes.'
+ UPGRADE_AGENT_FOR_RESPONDER('endpoint', 'get-file')
);
});
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx
index 2851ac8640fb7..e063aa1245900 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx
@@ -19,6 +19,7 @@ import { waitFor } from '@testing-library/react';
import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz';
import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants';
import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants';
+import { UPGRADE_AGENT_FOR_RESPONDER } from '../../../../../common/translations';
jest.mock('../../../../../common/experimental_features_service');
@@ -45,6 +46,7 @@ describe('When using processes action from response actions console', () => {
consoleProps: {
'data-test-subj': 'test',
commands: getEndpointConsoleCommands({
+ agentType: 'endpoint',
endpointAgentId: 'a.b.c',
endpointCapabilities: [...capabilities],
endpointPrivileges: {
@@ -75,7 +77,7 @@ describe('When using processes action from response actions console', () => {
enterConsoleCommand(renderResult, 'processes');
expect(renderResult.getByTestId('test-validationError-message').textContent).toEqual(
- 'The current version of the Agent does not support this feature. Upgrade your Agent through Fleet to use this feature and new response actions such as killing and suspending processes.'
+ UPGRADE_AGENT_FOR_RESPONDER('endpoint', 'processes')
);
});
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx
index c09807ee2479b..77e70fc14180c 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx
@@ -20,6 +20,7 @@ import { getDeferred } from '../../../../mocks/utils';
import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz';
import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants';
import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants';
+import { UPGRADE_AGENT_FOR_RESPONDER } from '../../../../../common/translations';
jest.mock('../../../../../common/experimental_features_service');
@@ -47,6 +48,7 @@ describe.skip('When using isolate action from response actions console', () => {
consoleProps: {
'data-test-subj': 'test',
commands: getEndpointConsoleCommands({
+ agentType: 'endpoint',
endpointAgentId: 'a.b.c',
endpointCapabilities: [...capabilities],
endpointPrivileges: {
@@ -75,7 +77,7 @@ describe.skip('When using isolate action from response actions console', () => {
enterConsoleCommand(renderResult, 'isolate');
expect(renderResult.getByTestId('test-validationError-message').textContent).toEqual(
- 'The current version of the Agent does not support this feature. Upgrade your Agent through Fleet to use this feature and new response actions such as killing and suspending processes.'
+ UPGRADE_AGENT_FOR_RESPONDER('endpoint', 'isolate')
);
});
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx
index 3f8160f5cf19c..5b10bb38f8a42 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx
@@ -24,6 +24,7 @@ import type {
KillProcessActionOutputContent,
} from '../../../../../../common/endpoint/types';
import { endpointActionResponseCodes } from '../../lib/endpoint_action_response_codes';
+import { UPGRADE_AGENT_FOR_RESPONDER } from '../../../../../common/translations';
jest.mock('../../../../../common/experimental_features_service');
@@ -50,6 +51,7 @@ describe('When using the kill-process action from response actions console', ()
consoleProps: {
'data-test-subj': 'test',
commands: getEndpointConsoleCommands({
+ agentType: 'endpoint',
endpointAgentId: 'a.b.c',
endpointCapabilities: [...capabilities],
endpointPrivileges: {
@@ -80,7 +82,7 @@ describe('When using the kill-process action from response actions console', ()
enterConsoleCommand(renderResult, 'kill-process --pid 123');
expect(renderResult.getByTestId('test-validationError-message').textContent).toEqual(
- 'The current version of the Agent does not support this feature. Upgrade your Agent through Fleet to use this feature and new response actions such as killing and suspending processes.'
+ UPGRADE_AGENT_FOR_RESPONDER('endpoint', 'kill-process')
);
});
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx
index 7e7c4cec2c06b..d1a45611a1ac1 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx
@@ -20,6 +20,7 @@ import { getDeferred } from '../../../../mocks/utils';
import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz';
import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants';
import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants';
+import { UPGRADE_AGENT_FOR_RESPONDER } from '../../../../../common/translations';
jest.mock('../../../../../common/experimental_features_service');
@@ -46,6 +47,7 @@ describe('When using the release action from response actions console', () => {
consoleProps: {
'data-test-subj': 'test',
commands: getEndpointConsoleCommands({
+ agentType: 'endpoint',
endpointAgentId: 'a.b.c',
endpointCapabilities: [...capabilities],
endpointPrivileges: {
@@ -74,7 +76,7 @@ describe('When using the release action from response actions console', () => {
enterConsoleCommand(renderResult, 'release');
expect(renderResult.getByTestId('test-validationError-message').textContent).toEqual(
- 'The current version of the Agent does not support this feature. Upgrade your Agent through Fleet to use this feature and new response actions such as killing and suspending processes.'
+ UPGRADE_AGENT_FOR_RESPONDER('endpoint', 'release')
);
});
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/status_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/status_action.test.tsx
index 3888af95da704..11bdab2518b54 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/status_action.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/status_action.test.tsx
@@ -90,6 +90,7 @@ describe('When using processes action from response actions console', () => {
consoleProps: {
'data-test-subj': 'test',
commands: getEndpointConsoleCommands({
+ agentType: 'endpoint',
endpointAgentId: 'a.b.c',
endpointCapabilities: [...capabilities],
endpointPrivileges: {
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx
index fead471cd0c13..be2cd5327185b 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx
@@ -24,6 +24,7 @@ import type {
KillProcessActionOutputContent,
} from '../../../../../../common/endpoint/types';
import { endpointActionResponseCodes } from '../../lib/endpoint_action_response_codes';
+import { UPGRADE_AGENT_FOR_RESPONDER } from '../../../../../common/translations';
jest.mock('../../../../../common/experimental_features_service');
@@ -50,6 +51,7 @@ describe('When using the suspend-process action from response actions console',
consoleProps: {
'data-test-subj': 'test',
commands: getEndpointConsoleCommands({
+ agentType: 'endpoint',
endpointAgentId: 'a.b.c',
endpointCapabilities: [...capabilities],
endpointPrivileges: {
@@ -80,7 +82,7 @@ describe('When using the suspend-process action from response actions console',
enterConsoleCommand(renderResult, 'suspend-process --pid 123');
expect(renderResult.getByTestId('test-validationError-message').textContent).toEqual(
- 'The current version of the Agent does not support this feature. Upgrade your Agent through Fleet to use this feature and new response actions such as killing and suspending processes.'
+ UPGRADE_AGENT_FOR_RESPONDER('endpoint', 'suspend-process')
);
});
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/upload_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/upload_action.test.tsx
index 5ca81a8b58064..1f2065197bb31 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/upload_action.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/upload_action.test.tsx
@@ -6,8 +6,8 @@
*/
import {
- type EndpointCapabilities,
ENDPOINT_CAPABILITIES,
+ type EndpointCapabilities,
} from '../../../../../../common/endpoint/service/response_actions/constants';
import {
type AppContextTestRender,
@@ -19,9 +19,9 @@ import {
getConsoleManagerMockRenderResultQueriesAndActions,
} from '../../../console/components/console_manager/mocks';
import type {
+ ActionDetailsApiResponse,
EndpointPrivileges,
ResponseActionUploadOutputContent,
- ActionDetailsApiResponse,
} from '../../../../../../common/endpoint/types';
import { getEndpointAuthzInitialStateMock } from '../../../../../../common/endpoint/service/authz/mocks';
import { getEndpointConsoleCommands } from '../..';
@@ -34,7 +34,7 @@ import { UPLOAD_ROUTE } from '../../../../../../common/endpoint/constants';
import type { HttpFetchOptionsWithPath } from '@kbn/core-http-browser';
import {
INSUFFICIENT_PRIVILEGES_FOR_COMMAND,
- UPGRADE_ENDPOINT_FOR_RESPONDER,
+ UPGRADE_AGENT_FOR_RESPONDER,
} from '../../../../../common/translations';
import { endpointActionResponseCodes } from '../../lib/endpoint_action_response_codes';
@@ -71,6 +71,7 @@ describe('When using `upload` response action', () => {
consoleProps: {
'data-test-subj': 'test',
commands: getEndpointConsoleCommands({
+ agentType: 'endpoint',
endpointAgentId: 'a.b.c',
endpointCapabilities,
endpointPrivileges,
@@ -202,7 +203,7 @@ describe('When using `upload` response action', () => {
await waitFor(() => {
expect(getByTestId('test-validationError-message').textContent).toEqual(
- UPGRADE_ENDPOINT_FOR_RESPONDER
+ UPGRADE_AGENT_FOR_RESPONDER('endpoint', 'upload')
);
});
});
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx
index 84bc9b9a6cae9..d4755a204482b 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx
@@ -6,25 +6,36 @@
*/
import { memo, useMemo } from 'react';
+import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features';
import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter';
import type { ActionRequestComponentProps } from '../types';
import { useSendIsolateEndpointRequest } from '../../../hooks/response_actions/use_send_isolate_endpoint_request';
export const IsolateActionResult = memo(
({ command, setStore, store, status, setStatus, ResultComponent }) => {
+ const isSentinelOneV1Enabled = useIsExperimentalFeatureEnabled(
+ 'responseActionsSentinelOneV1Enabled'
+ );
const isolateHostApi = useSendIsolateEndpointRequest();
const actionRequestBody = useMemo(() => {
const endpointId = command.commandDefinition?.meta?.endpointId;
const comment = command.args.args?.comment?.[0];
+ const agentType = command.commandDefinition?.meta?.agentType;
return endpointId
? {
+ agent_type: isSentinelOneV1Enabled ? agentType : undefined,
endpoint_ids: [endpointId],
comment,
}
: undefined;
- }, [command.args.args?.comment, command.commandDefinition?.meta?.endpointId]);
+ }, [
+ command.args.args?.comment,
+ command.commandDefinition?.meta?.agentType,
+ command.commandDefinition?.meta?.endpointId,
+ isSentinelOneV1Enabled,
+ ]);
return useConsoleActionSubmitter({
ResultComponent,
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx
index b0f2db75b7986..5f250ea656414 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx
@@ -6,25 +6,36 @@
*/
import { memo, useMemo } from 'react';
+import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features';
import type { ActionRequestComponentProps } from '../types';
import { useSendReleaseEndpointRequest } from '../../../hooks/response_actions/use_send_release_endpoint_request';
import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter';
export const ReleaseActionResult = memo(
({ command, setStore, store, status, setStatus, ResultComponent }) => {
+ const isSentinelOneV1Enabled = useIsExperimentalFeatureEnabled(
+ 'responseActionsSentinelOneV1Enabled'
+ );
const releaseHostApi = useSendReleaseEndpointRequest();
const actionRequestBody = useMemo(() => {
const endpointId = command.commandDefinition?.meta?.endpointId;
const comment = command.args.args?.comment?.[0];
+ const agentType = command.commandDefinition?.meta?.agentType;
return endpointId
? {
+ agent_type: isSentinelOneV1Enabled ? agentType : undefined,
endpoint_ids: [endpointId],
comment,
}
: undefined;
- }, [command.args.args?.comment, command.commandDefinition?.meta?.endpointId]);
+ }, [
+ command.args.args?.comment,
+ command.commandDefinition?.meta?.agentType,
+ command.commandDefinition?.meta?.endpointId,
+ isSentinelOneV1Enabled,
+ ]);
return useConsoleActionSubmitter({
ResultComponent,
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx
index 02b125294a66a..fbb18aabd7b00 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx
@@ -8,8 +8,8 @@
import { memo, useMemo } from 'react';
import { parsedPidOrEntityIdParameter } from '../lib/utils';
import type {
- SuspendProcessActionOutputContent,
KillOrSuspendProcessRequestBody,
+ SuspendProcessActionOutputContent,
} from '../../../../../common/endpoint/types';
import { useSendSuspendProcessRequest } from '../../../hooks/response_actions/use_send_suspend_process_endpoint_request';
import type { ActionRequestComponentProps } from '../types';
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/upload_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/upload_action.tsx
index 6c2a5c8ea2276..5f27cb285ed17 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/upload_action.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/upload_action.tsx
@@ -7,8 +7,8 @@
import React, { memo, useMemo } from 'react';
import type {
- ResponseActionUploadParameters,
ResponseActionUploadOutputContent,
+ ResponseActionUploadParameters,
} from '../../../../../common/endpoint/types';
import { EndpointUploadActionResult } from '../../endpoint_upload_action_result';
import type { UploadActionUIRequestBody } from '../../../../../common/api/endpoint';
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx
index 79307689033dd..192ac750ca6f1 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx
@@ -42,11 +42,11 @@ export const ActionLogButton = memo((p
>
- {UX_MESSAGES.flyoutTitle(props.meta.endpoint.host.hostname)}
+ {UX_MESSAGES.flyoutTitle(props.meta.hostName)}
-
+
)}
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.tsx
deleted file mode 100644
index e51989ce0cb7e..0000000000000
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import React, { memo } from 'react';
-import {
- EuiFlexGroup,
- EuiFlexItem,
- EuiSkeletonText,
- EuiSpacer,
- EuiText,
- EuiToolTip,
-} from '@elastic/eui';
-import { euiStyled } from '@kbn/kibana-react-plugin/common';
-import { FormattedMessage, FormattedRelative } from '@kbn/i18n-react';
-import { useGetEndpointDetails } from '../../../hooks/endpoint/use_get_endpoint_details';
-import { EndpointAgentStatus } from '../../../../common/components/endpoint/endpoint_agent_status';
-import { useGetEndpointPendingActionsSummary } from '../../../hooks/response_actions/use_get_endpoint_pending_actions_summary';
-import type { Platform } from './platforms';
-import { PlatformIcon } from './platforms';
-
-const IconContainer = euiStyled.div`
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
-`;
-
-interface HeaderEndpointInfoProps {
- endpointId: string;
-}
-
-export const HeaderEndpointInfo = memo(({ endpointId }) => {
- const { data: endpointDetails, isFetching } = useGetEndpointDetails(endpointId, {
- refetchInterval: 10000,
- });
- const { data: endpointPendingActions } = useGetEndpointPendingActionsSummary([endpointId], {
- refetchInterval: 10000,
- });
-
- if (isFetching && endpointPendingActions === undefined) {
- return ;
- }
-
- if (!endpointDetails) {
- return null;
- }
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
- {endpointDetails.metadata.host.name}
-
-
-
-
-
-
-
-
-
-
-
- ,
- }}
- />
-
-
-
-
-
- );
-});
-
-HeaderEndpointInfo.displayName = 'HeaderEndpointInfo';
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.test.tsx
similarity index 69%
rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.test.tsx
rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.test.tsx
index 5a1c8bab4c05c..c6c79a503150c 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.test.tsx
@@ -6,17 +6,17 @@
*/
import React from 'react';
-import { EndpointActionGenerator } from '../../../../../common/endpoint/data_generators/endpoint_action_generator';
-import type { HostInfo } from '../../../../../common/endpoint/types';
-import type { AppContextTestRender } from '../../../../common/mock/endpoint';
-import { createAppRootMockRenderer } from '../../../../common/mock/endpoint';
-import { useGetEndpointDetails } from '../../../hooks/endpoint/use_get_endpoint_details';
-import { useGetEndpointPendingActionsSummary } from '../../../hooks/response_actions/use_get_endpoint_pending_actions_summary';
-import { mockEndpointDetailsApiResult } from '../../../pages/endpoint_hosts/store/mock_endpoint_result_list';
+import { EndpointActionGenerator } from '../../../../../../../common/endpoint/data_generators/endpoint_action_generator';
+import type { HostInfo } from '../../../../../../../common/endpoint/types';
+import type { AppContextTestRender } from '../../../../../../common/mock/endpoint';
+import { createAppRootMockRenderer } from '../../../../../../common/mock/endpoint';
+import { useGetEndpointDetails } from '../../../../../hooks/endpoint/use_get_endpoint_details';
+import { useGetEndpointPendingActionsSummary } from '../../../../../hooks/response_actions/use_get_endpoint_pending_actions_summary';
+import { mockEndpointDetailsApiResult } from '../../../../../pages/endpoint_hosts/store/mock_endpoint_result_list';
import { HeaderEndpointInfo } from './header_endpoint_info';
-jest.mock('../../../hooks/endpoint/use_get_endpoint_details');
-jest.mock('../../../hooks/response_actions/use_get_endpoint_pending_actions_summary');
+jest.mock('../../../../../hooks/endpoint/use_get_endpoint_details');
+jest.mock('../../../../../hooks/response_actions/use_get_endpoint_pending_actions_summary');
const getEndpointDetails = useGetEndpointDetails as jest.Mock;
const getPendingActions = useGetEndpointPendingActionsSummary as jest.Mock;
@@ -49,7 +49,7 @@ describe('Responder header endpoint info', () => {
jest.clearAllMocks();
});
it('should show endpoint name', async () => {
- const name = await renderResult.findByTestId('responderHeaderEndpointName');
+ const name = await renderResult.findByTestId('responderHeaderHostName');
expect(name.textContent).toBe(`${endpointDetails.metadata.host.name}`);
});
it('should show agent and isolation status', async () => {
@@ -63,7 +63,7 @@ describe('Responder header endpoint info', () => {
expect(lastUpdated).toBeTruthy();
});
it('should show platform icon', async () => {
- const platformIcon = await renderResult.findByTestId('responderHeaderEndpointPlatformIcon');
+ const platformIcon = await renderResult.findByTestId('responderHeaderHostPlatformIcon');
expect(platformIcon).toBeTruthy();
});
});
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.tsx
new file mode 100644
index 0000000000000..ab9a0ff4a3f64
--- /dev/null
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.tsx
@@ -0,0 +1,46 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React, { memo } from 'react';
+import { EuiSkeletonText } from '@elastic/eui';
+import { EndpointAgentStatus } from '../../../../../../common/components/endpoint/endpoint_agent_status';
+import { HeaderAgentInfo } from '../header_agent_info';
+import { useGetEndpointDetails } from '../../../../../hooks';
+import type { Platform } from '../platforms';
+
+interface HeaderEndpointInfoProps {
+ endpointId: string;
+}
+
+export const HeaderEndpointInfo = memo(({ endpointId }) => {
+ const { data: endpointDetails, isLoading } = useGetEndpointDetails(endpointId, {
+ refetchInterval: 10000,
+ });
+
+ if (isLoading) {
+ return ;
+ }
+
+ if (!endpointDetails) {
+ return null;
+ }
+
+ return (
+
+
+
+ );
+});
+
+HeaderEndpointInfo.displayName = 'HeaderEndpointInfo';
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/header_agent_info.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/header_agent_info.tsx
new file mode 100644
index 0000000000000..d116cba56db03
--- /dev/null
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/header_agent_info.tsx
@@ -0,0 +1,63 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React, { memo } from 'react';
+import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText, EuiToolTip } from '@elastic/eui';
+import { FormattedMessage, FormattedRelative } from '@kbn/i18n-react';
+import type { Platform } from './platforms';
+import { PlatformIcon } from './platforms';
+
+interface HeaderAgentInfoProps {
+ platform: Platform;
+ hostName: string;
+ lastCheckin: string;
+ children: React.ReactNode;
+}
+
+export const HeaderAgentInfo = memo(
+ ({ platform, hostName, lastCheckin, children }) => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {hostName}
+
+
+
+ {children}
+
+
+
+
+
+ ,
+ }}
+ />
+
+
+
+
+
+ );
+ }
+);
+
+HeaderAgentInfo.displayName = 'HeaderAgentInfo';
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/index.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/index.tsx
similarity index 100%
rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/index.tsx
rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/index.tsx
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/logos/linux.svg b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/logos/linux.svg
similarity index 100%
rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/logos/linux.svg
rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/logos/linux.svg
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/logos/macos.svg b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/logos/macos.svg
similarity index 100%
rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/logos/macos.svg
rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/logos/macos.svg
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/logos/windows.svg b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/logos/windows.svg
similarity index 100%
rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/logos/windows.svg
rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/logos/windows.svg
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/platform_icon.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/platform_icon.test.tsx
similarity index 86%
rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/platform_icon.test.tsx
rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/platform_icon.test.tsx
index c528134f2f106..84652cc2d2d72 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/platform_icon.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/platform_icon.test.tsx
@@ -6,8 +6,8 @@
*/
import React from 'react';
-import type { AppContextTestRender } from '../../../../../common/mock/endpoint';
-import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint';
+import type { AppContextTestRender } from '../../../../../../common/mock/endpoint';
+import { createAppRootMockRenderer } from '../../../../../../common/mock/endpoint';
import { PlatformIcon, type PlatformIconProps } from './platform_icon';
describe('PlatformIcon', () => {
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/platform_icon.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/platform_icon.tsx
similarity index 100%
rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/platforms/platform_icon.tsx
rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/platform_icon.tsx
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/sentinel_one/header_sentinel_one_info.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/sentinel_one/header_sentinel_one_info.tsx
new file mode 100644
index 0000000000000..3df76ff169f52
--- /dev/null
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/sentinel_one/header_sentinel_one_info.tsx
@@ -0,0 +1,38 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React, { memo } from 'react';
+import { SentinelOneAgentStatus } from '../../../../../../detections/components/host_isolation/sentinel_one_agent_status';
+import type { ThirdPartyAgentInfo } from '../../../../../../../common/types';
+import { HeaderAgentInfo } from '../header_agent_info';
+import type { Platform } from '../platforms';
+
+interface HeaderSentinelOneInfoProps {
+ agentId: ThirdPartyAgentInfo['agent']['id'];
+ platform: ThirdPartyAgentInfo['host']['os']['family'];
+ hostName: ThirdPartyAgentInfo['host']['name'];
+ lastCheckin: ThirdPartyAgentInfo['lastCheckin'];
+}
+
+export const HeaderSentinelOneInfo = memo(
+ ({ agentId, platform, hostName, lastCheckin }) => {
+ return (
+
+
+
+ );
+ }
+);
+
+HeaderSentinelOneInfo.displayName = 'HeaderSentinelOneInfo';
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts
index 2fb9c4fd76941..e2d4906069a4e 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts
@@ -7,5 +7,5 @@
export { getEndpointConsoleCommands } from './lib/console_commands_definition';
export { ActionLogButton } from './components/action_log_button';
-export { HeaderEndpointInfo } from './components/header_endpoint_info';
+export { HeaderEndpointInfo } from './components/header_info/endpoint/header_endpoint_info';
export { OfflineCallout } from './components/offline_callout';
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts
index fd64cff764966..9e429ab6a383c 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts
@@ -6,14 +6,17 @@
*/
import { i18n } from '@kbn/i18n';
+import { getRbacControl } from '../../../../../common/endpoint/service/response_actions/utils';
import { UploadActionResult } from '../command_render_components/upload_action';
import { ArgumentFileSelector } from '../../console_argument_selectors';
import type { ParsedArgData } from '../../console/service/types';
import { ExperimentalFeaturesService } from '../../../../common/experimental_features_service';
import type {
- EndpointCapabilities,
ConsoleResponseActionCommands,
+ EndpointCapabilities,
+ ResponseActionAgentType,
} from '../../../../../common/endpoint/service/response_actions/constants';
+import { RESPONSE_CONSOLE_ACTION_COMMANDS_TO_ENDPOINT_CAPABILITY } from '../../../../../common/endpoint/service/response_actions/constants';
import { GetFileActionResult } from '../command_render_components/get_file_action';
import type { Command, CommandDefinition } from '../../console';
import { IsolateActionResult } from '../command_render_components/isolate_action';
@@ -29,15 +32,11 @@ import {
import type { EndpointPrivileges, ImmutableArray } from '../../../../../common/endpoint/types';
import {
INSUFFICIENT_PRIVILEGES_FOR_COMMAND,
- UPGRADE_ENDPOINT_FOR_RESPONDER,
+ UPGRADE_AGENT_FOR_RESPONDER,
} from '../../../../common/translations';
import { getCommandAboutInfo } from './get_command_about_info';
import { validateUnitOfTime } from './utils';
-import {
- RESPONSE_CONSOLE_ACTION_COMMANDS_TO_ENDPOINT_CAPABILITY,
- RESPONSE_CONSOLE_ACTION_COMMANDS_TO_REQUIRED_AUTHZ,
-} from '../../../../../common/endpoint/service/response_actions/constants';
const emptyArgumentValidator = (argData: ParsedArgData): true | string => {
if (argData?.length > 0 && typeof argData[0] === 'string' && argData[0]?.trim().length > 0) {
@@ -73,39 +72,34 @@ const executeTimeoutValidator = (argData: ParsedArgData): true | string => {
}
};
-export const getRbacControl = ({
- commandName,
- privileges,
-}: {
- commandName: ConsoleResponseActionCommands;
- privileges: EndpointPrivileges;
-}): boolean => {
- return Boolean(privileges[RESPONSE_CONSOLE_ACTION_COMMANDS_TO_REQUIRED_AUTHZ[commandName]]);
-};
-
-const capabilitiesAndPrivilegesValidator = (command: Command): true | string => {
- const privileges = command.commandDefinition.meta.privileges;
- const endpointCapabilities: EndpointCapabilities[] = command.commandDefinition.meta.capabilities;
- const commandName = command.commandDefinition.name as ConsoleResponseActionCommands;
- const responderCapability = RESPONSE_CONSOLE_ACTION_COMMANDS_TO_ENDPOINT_CAPABILITY[commandName];
- let errorMessage = '';
- if (!responderCapability) {
- errorMessage = errorMessage.concat(UPGRADE_ENDPOINT_FOR_RESPONDER);
- }
- if (responderCapability) {
- if (!endpointCapabilities.includes(responderCapability)) {
- errorMessage = errorMessage.concat(UPGRADE_ENDPOINT_FOR_RESPONDER);
+const capabilitiesAndPrivilegesValidator = (
+ agentType: ResponseActionAgentType
+): ((command: Command) => string | true) => {
+ return (command: Command) => {
+ const privileges = command.commandDefinition.meta.privileges;
+ const agentCapabilities: EndpointCapabilities[] = command.commandDefinition.meta.capabilities;
+ const commandName = command.commandDefinition.name as ConsoleResponseActionCommands;
+ const responderCapability =
+ RESPONSE_CONSOLE_ACTION_COMMANDS_TO_ENDPOINT_CAPABILITY[commandName];
+ let errorMessage = '';
+ if (!responderCapability) {
+ errorMessage = errorMessage.concat(UPGRADE_AGENT_FOR_RESPONDER(agentType, commandName));
+ }
+ if (responderCapability) {
+ if (!agentCapabilities.includes(responderCapability)) {
+ errorMessage = errorMessage.concat(UPGRADE_AGENT_FOR_RESPONDER(agentType, commandName));
+ }
+ }
+ if (!getRbacControl({ commandName, privileges })) {
+ errorMessage = errorMessage.concat(INSUFFICIENT_PRIVILEGES_FOR_COMMAND);
}
- }
- if (getRbacControl({ commandName, privileges }) !== true) {
- errorMessage = errorMessage.concat(INSUFFICIENT_PRIVILEGES_FOR_COMMAND);
- }
- if (errorMessage.length) {
- return errorMessage;
- }
+ if (errorMessage.length) {
+ return errorMessage;
+ }
- return true;
+ return true;
+ };
};
export const HELP_GROUPS = Object.freeze({
@@ -134,10 +128,12 @@ const COMMENT_ARG_ABOUT = i18n.translate(
export const getEndpointConsoleCommands = ({
endpointAgentId,
+ agentType,
endpointCapabilities,
endpointPrivileges,
}: {
endpointAgentId: string;
+ agentType: ResponseActionAgentType;
endpointCapabilities: ImmutableArray;
endpointPrivileges: EndpointPrivileges;
}): CommandDefinition[] => {
@@ -165,13 +161,14 @@ export const getEndpointConsoleCommands = ({
}),
RenderComponent: IsolateActionResult,
meta: {
+ agentType,
endpointId: endpointAgentId,
capabilities: endpointCapabilities,
privileges: endpointPrivileges,
},
exampleUsage: 'isolate --comment "isolate this host"',
exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION,
- validate: capabilitiesAndPrivilegesValidator,
+ validate: capabilitiesAndPrivilegesValidator(agentType),
args: {
comment: {
required: false,
@@ -195,13 +192,14 @@ export const getEndpointConsoleCommands = ({
}),
RenderComponent: ReleaseActionResult,
meta: {
+ agentType,
endpointId: endpointAgentId,
capabilities: endpointCapabilities,
privileges: endpointPrivileges,
},
exampleUsage: 'release --comment "release this host"',
exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION,
- validate: capabilitiesAndPrivilegesValidator,
+ validate: capabilitiesAndPrivilegesValidator(agentType),
args: {
comment: {
required: false,
@@ -228,13 +226,14 @@ export const getEndpointConsoleCommands = ({
}),
RenderComponent: KillProcessActionResult,
meta: {
+ agentType,
endpointId: endpointAgentId,
capabilities: endpointCapabilities,
privileges: endpointPrivileges,
},
exampleUsage: 'kill-process --pid 123 --comment "kill this process"',
exampleInstruction: ENTER_PID_OR_ENTITY_ID_INSTRUCTION,
- validate: capabilitiesAndPrivilegesValidator,
+ validate: capabilitiesAndPrivilegesValidator(agentType),
mustHaveArgs: true,
args: {
comment: {
@@ -283,13 +282,14 @@ export const getEndpointConsoleCommands = ({
}),
RenderComponent: SuspendProcessActionResult,
meta: {
+ agentType,
endpointId: endpointAgentId,
capabilities: endpointCapabilities,
privileges: endpointPrivileges,
},
exampleUsage: 'suspend-process --pid 123 --comment "suspend this process"',
exampleInstruction: ENTER_PID_OR_ENTITY_ID_INSTRUCTION,
- validate: capabilitiesAndPrivilegesValidator,
+ validate: capabilitiesAndPrivilegesValidator(agentType),
mustHaveArgs: true,
args: {
comment: {
@@ -357,13 +357,14 @@ export const getEndpointConsoleCommands = ({
}),
RenderComponent: GetProcessesActionResult,
meta: {
+ agentType,
endpointId: endpointAgentId,
capabilities: endpointCapabilities,
privileges: endpointPrivileges,
},
exampleUsage: 'processes --comment "get the processes"',
exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION,
- validate: capabilitiesAndPrivilegesValidator,
+ validate: capabilitiesAndPrivilegesValidator(agentType),
args: {
comment: {
required: false,
@@ -387,13 +388,14 @@ export const getEndpointConsoleCommands = ({
}),
RenderComponent: GetFileActionResult,
meta: {
+ agentType,
endpointId: endpointAgentId,
capabilities: endpointCapabilities,
privileges: endpointPrivileges,
},
exampleUsage: 'get-file --path "/full/path/to/file.txt" --comment "Possible malware"',
exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION,
- validate: capabilitiesAndPrivilegesValidator,
+ validate: capabilitiesAndPrivilegesValidator(agentType),
mustHaveArgs: true,
args: {
path: {
@@ -434,13 +436,14 @@ export const getEndpointConsoleCommands = ({
}),
RenderComponent: ExecuteActionResult,
meta: {
+ agentType,
endpointId: endpointAgentId,
capabilities: endpointCapabilities,
privileges: endpointPrivileges,
},
exampleUsage: 'execute --command "ls -al" --timeout 2s --comment "Get list of all files"',
exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION,
- validate: capabilitiesAndPrivilegesValidator,
+ validate: capabilitiesAndPrivilegesValidator(agentType),
mustHaveArgs: true,
args: {
command: {
@@ -492,13 +495,14 @@ export const getEndpointConsoleCommands = ({
}),
RenderComponent: UploadActionResult,
meta: {
+ agentType,
endpointId: endpointAgentId,
capabilities: endpointCapabilities,
privileges: endpointPrivileges,
},
exampleUsage: 'upload --file --overwrite --comment "script to fix registry"',
exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION,
- validate: capabilitiesAndPrivilegesValidator,
+ validate: capabilitiesAndPrivilegesValidator(agentType),
mustHaveArgs: true,
args: {
file: {
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/integration_tests/console_commands_definition.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/integration_tests/console_commands_definition.test.tsx
index 25211b3ce136c..3cc73b1ef7854 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/integration_tests/console_commands_definition.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/integration_tests/console_commands_definition.test.tsx
@@ -27,6 +27,7 @@ describe('When displaying Endpoint Response Actions', () => {
const endpointMetadata = new EndpointMetadataGenerator().generate();
const commands = getEndpointConsoleCommands({
+ agentType: 'endpoint',
endpointAgentId: '123',
endpointCapabilities: endpointMetadata.Endpoint.capabilities ?? [],
endpointPrivileges: getEndpointPrivilegesInitialStateMock(),
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/types.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/types.ts
index c2277576ff63a..0ed5081b0831c 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/types.ts
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/types.ts
@@ -5,10 +5,11 @@
* 2.0.
*/
+import type { BasicConsoleProps } from '../../hooks/use_with_show_responder';
+import type { ResponseActionAgentType } from '../../../../common/endpoint/service/response_actions/constants';
import type { CommandResponseActionApiState } from './hooks/use_console_action_submitter';
import type { ManagedConsoleExtensionComponentProps } from '../console';
import type {
- HostMetadata,
EndpointActionDataParameterTypes,
EndpointActionResponseDataOutput,
} from '../../../../common/endpoint/types';
@@ -16,11 +17,11 @@ import type { CommandExecutionComponentProps } from '../console/types';
export interface EndpointCommandDefinitionMeta {
endpointId: string;
+ agentType: ResponseActionAgentType;
}
-export type EndpointResponderExtensionComponentProps = ManagedConsoleExtensionComponentProps<{
- endpoint: HostMetadata;
-}>;
+export type EndpointResponderExtensionComponentProps =
+ ManagedConsoleExtensionComponentProps;
export type ActionRequestComponentProps<
TArgs extends object = object,
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx
index aef96add08813..03268178bc3d9 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx
@@ -9,6 +9,7 @@ import React, { memo, useMemo } from 'react';
import { EuiCodeBlock, EuiDescriptionList, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { css, euiStyled } from '@kbn/kibana-react-plugin/common';
import { map } from 'lodash';
+import { RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP } from '../../../../../common/endpoint/service/response_actions/constants';
import {
isExecuteAction,
isGetFileAction,
@@ -17,7 +18,6 @@ import {
import { EndpointUploadActionResult } from '../../endpoint_upload_action_result';
import { useUserPrivileges } from '../../../../common/components/user_privileges';
import { OUTPUT_MESSAGES } from '../translations';
-import { getUiCommand } from './hooks';
import { useTestIdGenerator } from '../../../hooks/use_test_id_generator';
import { ResponseActionFileDownloadLink } from '../../response_action_file_download_link';
import { ExecuteActionHostResponse } from '../../endpoint_execute_action';
@@ -92,7 +92,7 @@ const OutputContent = memo<{ action: MaybeImmutable; 'data-test-s
} = useUserPrivileges().endpointPrivileges;
const { command: _command, isCompleted, isExpired, wasSuccessful, errors } = action;
- const command = getUiCommand(_command);
+ const command = RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[_command];
if (errors?.length) {
return (
@@ -190,7 +190,7 @@ export const ActionsLogExpandedTray = memo<{
[parameters]
);
- const command = getUiCommand(_command);
+ const command = RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[_command];
const dataList = useMemo(
() =>
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter.tsx
index 9539b14109631..64ac7258a515c 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter.tsx
@@ -6,11 +6,14 @@
*/
import { orderBy } from 'lodash/fp';
-import React, { memo, useEffect, useMemo, useState, useCallback, useRef } from 'react';
-import { EuiFlexGroup, EuiFlexItem, EuiSelectable, EuiPopoverTitle } from '@elastic/eui';
-import type { ResponseActionsApiCommandNames } from '../../../../../common/endpoint/service/response_actions/constants';
+import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import { EuiFlexGroup, EuiFlexItem, EuiPopoverTitle, EuiSelectable } from '@elastic/eui';
+import {
+ RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP,
+ type ResponseActionsApiCommandNames,
+} from '../../../../../common/endpoint/service/response_actions/constants';
import { ActionsLogFilterPopover } from './actions_log_filter_popover';
-import { type FilterItems, type FilterName, useActionsLogFilter, getUiCommand } from './hooks';
+import { type FilterItems, type FilterName, useActionsLogFilter } from './hooks';
import { ClearAllButton } from './clear_all_button';
import { UX_MESSAGES } from '../translations';
import { useTestIdGenerator } from '../../../hooks/use_test_id_generator';
@@ -112,7 +115,12 @@ export const ActionsLogFilter = memo(
if (filterName === 'actions') {
setUrlActionsFilters(
selectedItems
- .map((item) => getUiCommand(item as ResponseActionsApiCommandNames))
+ .map(
+ (item) =>
+ RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[
+ item as ResponseActionsApiCommandNames
+ ]
+ )
.join()
);
} else if (filterName === 'hosts') {
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_table.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_table.tsx
index 81e1e6b7843fc..37b85aa42c918 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_table.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_table.tsx
@@ -24,6 +24,7 @@ import {
import { euiStyled } from '@kbn/kibana-react-plugin/common';
import { FormattedMessage } from '@kbn/i18n-react';
+import { RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP } from '../../../../../common/endpoint/service/response_actions/constants';
import { SecurityPageName } from '../../../../../common/constants';
import { getRuleDetailsUrl } from '../../../../common/components/link_to';
import { SecuritySolutionLinkAnchor } from '../../../../common/components/links';
@@ -31,7 +32,7 @@ import type { ActionListApiResponse } from '../../../../../common/endpoint/types
import type { EndpointActionListRequestQuery } from '../../../../../common/api/endpoint';
import { FormattedDate } from '../../../../common/components/formatted_date';
import { ARIA_LABELS, TABLE_COLUMN_NAMES, UX_MESSAGES } from '../translations';
-import { getActionStatus, getUiCommand } from './hooks';
+import { getActionStatus } from './hooks';
import { getEmptyValue } from '../../../../common/components/empty_value';
import { ResponseActionStatusBadge } from './response_action_status_badge';
import { ActionsLogExpandedTray } from './action_log_expanded_tray';
@@ -86,7 +87,7 @@ const getResponseActionListTableColumns = ({
width: !showHostNames ? '21%' : '10%',
truncateText: true,
render: (_command: ActionListApiResponse['data'][number]['command']) => {
- const command = getUiCommand(_command);
+ const command = RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[_command];
return (
{
return '';
};
-/**
- * map actual command to ui command
- * unisolate -> release
- * running-processes -> processes
- */
-export const getUiCommand = (
- command: ResponseActionsApiCommandNames
-): ConsoleResponseActionCommands => {
- if (command === 'unisolate') {
- return 'release';
- } else if (command === 'running-processes') {
- return 'processes';
- } else {
- return command;
- }
-};
-
-/**
- * map UI command back to actual command
- * release -> unisolate
- * processes -> running-processes
- */
-export const getCommandKey = (
- uiCommand: ConsoleResponseActionCommands
-): ResponseActionsApiCommandNames => {
- if (uiCommand === 'release') {
- return 'unisolate';
- } else if (uiCommand === 'processes') {
- return 'running-processes';
- } else {
- return uiCommand;
- }
-};
-
export type FilterName = keyof typeof FILTER_NAMES;
export const useActionsLogFilter = ({
filterName,
@@ -267,9 +231,12 @@ export const useActionsLogFilter = ({
return true;
}).map((commandName) => ({
key: commandName,
- label: getUiCommand(commandName),
+ label: RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[commandName],
checked:
- !isFlyout && commands?.map((command) => getCommandKey(command)).includes(commandName)
+ !isFlyout &&
+ commands
+ ?.map((command) => RESPONSE_CONSOLE_COMMAND_TO_API_COMMAND_MAP[command])
+ .includes(commandName)
? 'on'
: undefined,
'data-test-subj': `${filterName}-filter-option`,
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx
index 93e6719db3569..bc129f864330c 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx
@@ -27,14 +27,16 @@ import { MANAGEMENT_PATH } from '../../../../../common/constants';
import { getActionListMock } from '../mocks';
import { useGetEndpointsList } from '../../../hooks/endpoint/use_get_endpoints_list';
import { v4 as uuidv4 } from 'uuid';
-import { RESPONSE_ACTION_API_COMMANDS_NAMES } from '../../../../../common/endpoint/service/response_actions/constants';
+import {
+ RESPONSE_ACTION_API_COMMANDS_NAMES,
+ RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP,
+} from '../../../../../common/endpoint/service/response_actions/constants';
import { useUserPrivileges as _useUserPrivileges } from '../../../../common/components/user_privileges';
import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks';
import { getEndpointAuthzInitialStateMock } from '../../../../../common/endpoint/service/authz/mocks';
import { useGetEndpointActionList as _useGetEndpointActionList } from '../../../hooks/response_actions/use_get_endpoint_action_list';
import { OUTPUT_MESSAGES } from '../translations';
import { EndpointActionGenerator } from '../../../../../common/endpoint/data_generators/endpoint_action_generator';
-import { getUiCommand } from '../components/hooks';
const useGetEndpointActionListMock = _useGetEndpointActionList as jest.Mock;
@@ -982,7 +984,7 @@ describe('Response actions history', () => {
render();
- const outputCommand = getUiCommand(command);
+ const outputCommand = RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[command];
const outputs = expandRows();
expect(outputs.map((n) => n.textContent)).toEqual([
@@ -1009,7 +1011,7 @@ describe('Response actions history', () => {
});
render();
- const outputCommand = getUiCommand(command);
+ const outputCommand = RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[command];
const outputs = expandRows();
expect(outputs.map((n) => n.textContent)).toEqual([
`${outputCommand} failed`,
@@ -1036,7 +1038,7 @@ describe('Response actions history', () => {
});
render();
- const outputCommand = getUiCommand(command);
+ const outputCommand = RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[command];
const outputs = expandRows();
expect(outputs.map((n) => n.textContent)).toEqual([
`${outputCommand} failed: action expired`,
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx
index 76ae714eb9555..e98b009f686a4 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx
@@ -8,12 +8,14 @@
import { v4 as uuidv4 } from 'uuid';
import type { ActionListApiResponse } from '../../../../common/endpoint/types';
import type {
+ ResponseActionAgentType,
ResponseActionsApiCommandNames,
ResponseActionStatus,
} from '../../../../common/endpoint/service/response_actions/constants';
import { EndpointActionGenerator } from '../../../../common/endpoint/data_generators/endpoint_action_generator';
export const getActionListMock = async ({
+ agentTypes = ['endpoint'] as ResponseActionAgentType[],
agentIds: _agentIds,
commands,
actionCount = 0,
@@ -27,6 +29,7 @@ export const getActionListMock = async ({
wasSuccessful = true,
status = 'successful',
}: {
+ agentTypes?: ResponseActionAgentType[];
agentIds?: string[];
commands?: string[];
actionCount?: number;
@@ -103,6 +106,7 @@ export const getActionListMock = async ({
pageSize,
startDate,
endDate,
+ agentTypes,
elasticAgentIds: agentIds,
commands,
data,
diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.tsx
index 206f177185dd2..8f482d062ce13 100644
--- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.tsx
+++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.tsx
@@ -5,15 +5,15 @@
* 2.0.
*/
-import { EuiEmptyPrompt, EuiFlexItem } from '@elastic/eui';
-
import type { CriteriaWithPagination } from '@elastic/eui';
+import { EuiEmptyPrompt, EuiFlexItem } from '@elastic/eui';
import React, { memo, useCallback, useEffect, useMemo, useState } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
-import type {
- ResponseActionsApiCommandNames,
- ResponseActionStatus,
- ResponseActionType,
+import {
+ RESPONSE_CONSOLE_COMMAND_TO_API_COMMAND_MAP,
+ type ResponseActionsApiCommandNames,
+ type ResponseActionStatus,
+ type ResponseActionType,
} from '../../../../common/endpoint/service/response_actions/constants';
import type { ActionListApiResponse } from '../../../../common/endpoint/types';
@@ -23,7 +23,7 @@ import { useGetEndpointActionList } from '../../hooks';
import { UX_MESSAGES } from './translations';
import { useTestIdGenerator } from '../../hooks/use_test_id_generator';
import { ActionsLogFilters } from './components/actions_log_filters';
-import { getCommandKey, useDateRangePicker } from './components/hooks';
+import { useDateRangePicker } from './components/hooks';
import { useActionHistoryUrlParams } from './components/use_action_history_url_params';
import { useUrlPagination } from '../../hooks/use_url_pagination';
import { ManagementPageLoader } from '../management_page_loader';
@@ -79,7 +79,9 @@ export const ResponseActionsLog = memo<
setQueryParams((prevState) => ({
...prevState,
commands: commandsFromUrl?.length
- ? commandsFromUrl.map((commandFromUrl) => getCommandKey(commandFromUrl))
+ ? commandsFromUrl.map(
+ (commandFromUrl) => RESPONSE_CONSOLE_COMMAND_TO_API_COMMAND_MAP[commandFromUrl]
+ )
: prevState.commands,
hosts: agentIdsFromUrl?.length ? agentIdsFromUrl : prevState.agentIds,
statuses: statusesFromUrl?.length
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts
index a197574035b79..ce5fdef8d4872 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts
@@ -14,20 +14,20 @@ import type { EndpointArtifactPageId } from '../../../screens';
import {
ensureArtifactPageAuthzAccess,
ensureEndpointListPageAuthzAccess,
+ ensureFleetPermissionDeniedScreen,
ensurePolicyListPageAuthzAccess,
getArtifactListEmptyStateAddButton,
+ getConsoleHelpPanelResponseActionTestSubj,
getEndpointManagementPageList,
getEndpointManagementPageMap,
+ getFleetAgentListTable,
getNoPrivilegesPage,
openConsoleFromEndpointList,
+ openConsoleHelpPanel,
openRowActionMenu,
visitEndpointList,
- visitPolicyList,
- ensureFleetPermissionDeniedScreen,
- getFleetAgentListTable,
visitFleetAgentList,
- getConsoleHelpPanelResponseActionTestSubj,
- openConsoleHelpPanel,
+ visitPolicyList,
} from '../../../screens';
describe(
diff --git a/x-pack/plugins/security_solution/public/management/hooks/index.ts b/x-pack/plugins/security_solution/public/management/hooks/index.ts
index 5afa3cd5457f0..e5532df0bd307 100644
--- a/x-pack/plugins/security_solution/public/management/hooks/index.ts
+++ b/x-pack/plugins/security_solution/public/management/hooks/index.ts
@@ -6,6 +6,6 @@
*/
export { useGetEndpointDetails } from './endpoint/use_get_endpoint_details';
-export { useWithShowEndpointResponder } from './use_with_show_endpoint_responder';
+export { useWithShowResponder } from './use_with_show_responder';
export { useGetEndpointActionList } from './response_actions/use_get_endpoint_action_list';
export { useGetActionState } from './use_get_action_state';
diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_upload_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_upload_endpoint_request.ts
index 1a226c29f558b..75f25f8350724 100644
--- a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_upload_endpoint_request.ts
+++ b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_upload_endpoint_request.ts
@@ -29,7 +29,9 @@ export const useSendUploadEndpointRequest = (
formData.append('file', file, file.name);
for (const [key, value] of Object.entries(payload)) {
- formData.append(key, typeof value !== 'string' ? JSON.stringify(value) : value);
+ if (typeof value !== 'undefined') {
+ formData.append(key, typeof value !== 'string' ? JSON.stringify(value) : value);
+ }
}
return http.post(UPLOAD_ROUTE, {
diff --git a/x-pack/plugins/log_explorer/public/components/flyout_detail/types.ts b/x-pack/plugins/security_solution/public/management/hooks/translations.tsx
similarity index 56%
rename from x-pack/plugins/log_explorer/public/components/flyout_detail/types.ts
rename to x-pack/plugins/security_solution/public/management/hooks/translations.tsx
index d88d0d1c9ad8a..b2a7da14b2e0e 100644
--- a/x-pack/plugins/log_explorer/public/components/flyout_detail/types.ts
+++ b/x-pack/plugins/security_solution/public/management/hooks/translations.tsx
@@ -5,4 +5,11 @@
* 2.0.
*/
-export type { FlyoutDoc, LogDocument, LogExplorerFlyoutContentProps } from '../../controller';
+import { i18n } from '@kbn/i18n';
+
+export const RESPONDER_PAGE_TITLE = i18n.translate(
+ 'xpack.securitySolution.responder_overlay.pageTitle',
+ {
+ defaultMessage: 'Response console',
+ }
+);
diff --git a/x-pack/plugins/security_solution/public/management/hooks/use_with_show_endpoint_responder.tsx b/x-pack/plugins/security_solution/public/management/hooks/use_with_show_endpoint_responder.tsx
deleted file mode 100644
index 26a0763ae6124..0000000000000
--- a/x-pack/plugins/security_solution/public/management/hooks/use_with_show_endpoint_responder.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import React, { useCallback } from 'react';
-import { i18n } from '@kbn/i18n';
-import { useUserPrivileges } from '../../common/components/user_privileges';
-import {
- ActionLogButton,
- getEndpointConsoleCommands,
- HeaderEndpointInfo,
- OfflineCallout,
-} from '../components/endpoint_responder';
-import { useConsoleManager } from '../components/console';
-import type { HostMetadata } from '../../../common/endpoint/types';
-import { MissingEncryptionKeyCallout } from '../components/missing_encryption_key_callout';
-
-type ShowEndpointResponseActionsConsole = (endpointMetadata: HostMetadata) => void;
-
-const RESPONDER_PAGE_TITLE = i18n.translate('xpack.securitySolution.responder_overlay.pageTitle', {
- defaultMessage: 'Response console',
-});
-
-export const useWithShowEndpointResponder = (): ShowEndpointResponseActionsConsole => {
- const consoleManager = useConsoleManager();
- const endpointPrivileges = useUserPrivileges().endpointPrivileges;
-
- return useCallback(
- (endpointMetadata: HostMetadata) => {
- // If no authz, just exit and log something to the console
- if (!endpointPrivileges.canAccessResponseConsole) {
- window.console.error(new Error('Access denied to endpoint response actions console'));
- return;
- }
-
- const endpointAgentId = endpointMetadata.agent.id;
- const endpointRunningConsole = consoleManager.getOne(endpointAgentId);
-
- if (endpointRunningConsole) {
- endpointRunningConsole.show();
- } else {
- consoleManager
- .register({
- id: endpointAgentId,
- meta: {
- endpoint: endpointMetadata,
- },
- consoleProps: {
- commands: getEndpointConsoleCommands({
- endpointAgentId,
- endpointCapabilities: endpointMetadata.Endpoint.capabilities ?? [],
- endpointPrivileges,
- }),
- 'data-test-subj': 'endpointResponseActionsConsole',
- storagePrefix: 'xpack.securitySolution.Responder',
- TitleComponent: () => ,
- },
- PageTitleComponent: () => <>{RESPONDER_PAGE_TITLE}>,
- PageBodyComponent: () => (
- <>
-
-
- >
- ),
- ActionComponents: endpointPrivileges.canReadActionsLogManagement
- ? [ActionLogButton]
- : undefined,
- })
- .show();
- }
- },
- [endpointPrivileges, consoleManager]
- );
-};
diff --git a/x-pack/plugins/security_solution/public/management/hooks/use_with_show_responder.tsx b/x-pack/plugins/security_solution/public/management/hooks/use_with_show_responder.tsx
new file mode 100644
index 0000000000000..cb216aa7b42ad
--- /dev/null
+++ b/x-pack/plugins/security_solution/public/management/hooks/use_with_show_responder.tsx
@@ -0,0 +1,145 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React, { useCallback } from 'react';
+import { useLicense } from '../../common/hooks/use_license';
+import type { ImmutableArray } from '../../../common/endpoint/types';
+import {
+ type ConsoleResponseActionCommands,
+ RESPONSE_CONSOLE_COMMAND_TO_API_COMMAND_MAP,
+ type ResponseActionAgentType,
+} from '../../../common/endpoint/service/response_actions/constants';
+import { isResponseActionSupported } from '../../../common/endpoint/service/response_actions/is_response_action_supported';
+import { HeaderSentinelOneInfo } from '../components/endpoint_responder/components/header_info/sentinel_one/header_sentinel_one_info';
+
+import { useUserPrivileges } from '../../common/components/user_privileges';
+import {
+ ActionLogButton,
+ getEndpointConsoleCommands,
+ HeaderEndpointInfo,
+ OfflineCallout,
+} from '../components/endpoint_responder';
+import { useConsoleManager } from '../components/console';
+import { MissingEncryptionKeyCallout } from '../components/missing_encryption_key_callout';
+import { RESPONDER_PAGE_TITLE } from './translations';
+
+type ShowResponseActionsConsole = (props: ResponderInfoProps) => void;
+
+export interface BasicConsoleProps {
+ agentId: string;
+ hostName: string;
+}
+
+type ResponderInfoProps =
+ | (BasicConsoleProps & {
+ agentType: Extract;
+ capabilities: ImmutableArray;
+ })
+ | (BasicConsoleProps & {
+ agentType: Exclude;
+ capabilities: ImmutableArray;
+ platform: string;
+ lastCheckin: string;
+ });
+
+export const useWithShowResponder = (): ShowResponseActionsConsole => {
+ const consoleManager = useConsoleManager();
+ const endpointPrivileges = useUserPrivileges().endpointPrivileges;
+ const isEnterpriseLicense = useLicense().isEnterprise();
+
+ return useCallback(
+ (props: ResponderInfoProps) => {
+ const { agentId, agentType, capabilities, hostName } = props;
+ // If no authz, just exit and log something to the console
+ if (agentType === 'endpoint' && !endpointPrivileges.canAccessResponseConsole) {
+ window.console.error(new Error(`Access denied to ${agentType} response actions console`));
+ return;
+ }
+
+ if (agentType !== 'endpoint' && !isEnterpriseLicense) {
+ window.console.error(new Error(`Access denied to ${agentType} response actions console`));
+ return;
+ }
+
+ const endpointRunningConsole = consoleManager.getOne(agentId);
+
+ if (endpointRunningConsole) {
+ endpointRunningConsole.show();
+ } else {
+ const consoleProps = {
+ commands: getEndpointConsoleCommands({
+ agentType,
+ endpointAgentId: agentId,
+ endpointCapabilities: capabilities,
+ endpointPrivileges,
+ }).map((command) => {
+ if (command.name !== 'status') {
+ return {
+ ...command,
+ helpHidden: !isResponseActionSupported(
+ agentType,
+ RESPONSE_CONSOLE_COMMAND_TO_API_COMMAND_MAP[
+ command.name as ConsoleResponseActionCommands
+ ],
+ 'manual',
+ endpointPrivileges
+ ),
+ };
+ } else if (agentType !== 'endpoint') {
+ // do not show 'status' for non-endpoint agents
+ return {
+ ...command,
+ helpHidden: true,
+ };
+ }
+ return command;
+ }),
+ 'data-test-subj': `${agentType}ResponseActionsConsole`,
+ storagePrefix: 'xpack.securitySolution.Responder',
+ TitleComponent: () => {
+ if (agentType === 'endpoint') {
+ return ;
+ }
+ if (agentType === 'sentinel_one') {
+ return (
+
+ );
+ }
+ return null;
+ },
+ };
+
+ consoleManager
+ .register({
+ id: agentId,
+ meta: {
+ agentId,
+ hostName,
+ },
+ consoleProps,
+ PageTitleComponent: () => <>{RESPONDER_PAGE_TITLE}>,
+ ActionComponents: endpointPrivileges.canReadActionsLogManagement
+ ? [ActionLogButton]
+ : undefined,
+ PageBodyComponent: () => (
+ <>
+
+
+ >
+ ),
+ })
+ .show();
+ }
+ },
+ [endpointPrivileges, isEnterpriseLicense, consoleManager]
+ );
+};
diff --git a/x-pack/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts b/x-pack/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts
index f4a62fd9fa341..2d775cfb3ff8a 100644
--- a/x-pack/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts
+++ b/x-pack/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts
@@ -8,32 +8,32 @@
import type { HttpFetchOptionsWithPath } from '@kbn/core/public';
import { EndpointActionGenerator } from '../../../common/endpoint/data_generators/endpoint_action_generator';
import {
+ ACTION_AGENT_FILE_INFO_ROUTE,
ACTION_DETAILS_ROUTE,
ACTION_STATUS_ROUTE,
- GET_PROCESSES_ROUTE,
BASE_ENDPOINT_ACTION_ROUTE,
- KILL_PROCESS_ROUTE,
- SUSPEND_PROCESS_ROUTE,
- GET_FILE_ROUTE,
- ACTION_AGENT_FILE_INFO_ROUTE,
EXECUTE_ROUTE,
- UPLOAD_ROUTE,
+ GET_FILE_ROUTE,
+ GET_PROCESSES_ROUTE,
ISOLATE_HOST_ROUTE_V2,
+ KILL_PROCESS_ROUTE,
+ SUSPEND_PROCESS_ROUTE,
UNISOLATE_HOST_ROUTE_V2,
+ UPLOAD_ROUTE,
} from '../../../common/endpoint/constants';
import type { ResponseProvidersInterface } from '../../common/mock/endpoint/http_handler_mock_factory';
import { httpHandlerMockFactory } from '../../common/mock/endpoint/http_handler_mock_factory';
import type {
+ ActionDetails,
ActionDetailsApiResponse,
+ ActionFileInfoApiResponse,
ActionListApiResponse,
- ResponseActionApiResponse,
- PendingActionsResponse,
- ActionDetails,
GetProcessesActionOutputContent,
+ PendingActionsResponse,
+ ResponseActionApiResponse,
+ ResponseActionExecuteOutputContent,
ResponseActionGetFileOutputContent,
ResponseActionGetFileParameters,
- ActionFileInfoApiResponse,
- ResponseActionExecuteOutputContent,
ResponseActionsExecuteParameters,
ResponseActionUploadOutputContent,
ResponseActionUploadParameters,
@@ -126,6 +126,7 @@ export const responseActionsHttpMocks = httpHandlerMockFactory {
ev.preventDefault();
- showEndpointResponseActionsConsole(endpointMetadata);
+ showEndpointResponseActionsConsole({
+ agentId: endpointMetadata.agent.id,
+ agentType: 'endpoint',
+ capabilities: endpointMetadata.Endpoint.capabilities ?? [],
+ hostName: endpointMetadata.host.name,
+ });
},
children: (
{
});
});
+ it('should return `badRequest` when sentinel_one feature flag is not enabled and agentType is `sentinel_one`', async () => {
+ // @ts-expect-error We're writing to a readonly property just for the purpose of the test
+ endpointAppContextService.experimentalFeatures.responseActionsSentinelOneV1Enabled = false;
+ await actionListHandler({ ...defaultParams, agentTypes: 'sentinel_one' });
+ expect(mockResponse.customError).toHaveBeenCalledWith({
+ statusCode: 400,
+ body: new CustomHttpRequestError('[request body.agentTypes]: sentinel_one is disabled'),
+ });
+ });
+
it('should return `ok` when actions index exists', async () => {
await actionListHandler(defaultParams);
expect(mockResponse.ok).toHaveBeenCalled();
@@ -110,12 +121,14 @@ describe('Action List Handler', () => {
await actionListHandler({
withOutputs: 'actionX',
agentIds: 'agentX',
+ agentTypes: 'endpoint',
commands: 'running-processes',
statuses: 'failed',
userIds: 'userX',
});
expect(mockGetActionListByStatus).toBeCalledWith(
expect.objectContaining({
+ agentTypes: ['endpoint'],
withOutputs: ['actionX'],
elasticAgentIds: ['agentX'],
commands: ['running-processes'],
@@ -143,12 +156,14 @@ describe('Action List Handler', () => {
await actionListHandler({
...defaultParams,
agentIds: 'agentX',
+ agentTypes: 'endpoint',
commands: 'isolate',
userIds: 'userX',
});
expect(mockGetActionList).toHaveBeenCalledWith(
expect.objectContaining({
+ agentTypes: ['endpoint'],
commands: ['isolate'],
elasticAgentIds: ['agentX'],
userIds: ['userX'],
diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/list_handler.ts b/x-pack/plugins/security_solution/server/endpoint/routes/actions/list_handler.ts
index 64dbbdffeb8dc..9d6e6e804cdcc 100644
--- a/x-pack/plugins/security_solution/server/endpoint/routes/actions/list_handler.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/routes/actions/list_handler.ts
@@ -12,6 +12,7 @@
*/
import type { RequestHandler } from '@kbn/core/server';
+import { CustomHttpRequestError } from '../../../utils/custom_http_request_error';
import type { EndpointActionListRequestQuery } from '../../../../common/api/endpoint';
import { ENDPOINT_ACTIONS_INDEX } from '../../../../common/endpoint/constants';
import { getActionList, getActionListByStatus } from '../../services';
@@ -19,17 +20,17 @@ import type { SecuritySolutionRequestHandlerContext } from '../../../types';
import type { EndpointAppContext } from '../../types';
import { errorHandler } from '../error_handler';
import type {
+ ResponseActionAgentType,
ResponseActionsApiCommandNames,
ResponseActionStatus,
} from '../../../../common/endpoint/service/response_actions/constants';
import { doesLogsEndpointActionsIndexExist } from '../../utils';
-const formatStringIds = (value: string | string[] | undefined): undefined | string[] =>
- typeof value === 'string' ? [value] : value;
-
-const formatCommandValues = (
- value: ResponseActionsApiCommandNames | ResponseActionsApiCommandNames[] | undefined
-): undefined | ResponseActionsApiCommandNames[] => (typeof value === 'string' ? [value] : value);
+const formatRequestParams = <
+ T extends string | ResponseActionsApiCommandNames | ResponseActionAgentType
+>(
+ value: T | T[] | undefined
+): T[] | undefined => (typeof value === 'string' ? [value] : value);
const formatStatusValues = (
value: ResponseActionStatus | ResponseActionStatus[]
@@ -49,6 +50,7 @@ export const actionListHandler = (
const {
query: {
agentIds: elasticAgentIds,
+ agentTypes: _agentTypes,
page,
pageSize,
startDate,
@@ -73,18 +75,32 @@ export const actionListHandler = (
return res.notFound({ body: 'index_not_found_exception' });
}
+ // verify feature flag for sentinel_one `aaentType`
+ const agentTypes = formatRequestParams(_agentTypes);
+ if (
+ !endpointContext.experimentalFeatures.responseActionsSentinelOneV1Enabled &&
+ agentTypes?.includes('sentinel_one')
+ ) {
+ return errorHandler(
+ logger,
+ res,
+ new CustomHttpRequestError('[request body.agentTypes]: sentinel_one is disabled', 400)
+ );
+ }
+
const requestParams = {
- withOutputs: formatStringIds(withOutputs),
- types: formatStringIds(types),
- commands: formatCommandValues(commands),
+ agentTypes,
+ withOutputs: formatRequestParams(withOutputs),
+ types: formatRequestParams(types),
+ commands: formatRequestParams(commands),
esClient,
- elasticAgentIds: formatStringIds(elasticAgentIds),
+ elasticAgentIds: formatRequestParams(elasticAgentIds),
metadataService: endpointContext.service.getEndpointMetadataService(),
page,
pageSize,
startDate,
endDate,
- userIds: formatStringIds(userIds),
+ userIds: formatRequestParams(userIds),
logger,
};
// wrapper method to branch logic for
diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.test.ts
index 70ccd7af8ecb5..0a55f2a62e7be 100644
--- a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.test.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.test.ts
@@ -27,6 +27,7 @@ import {
createMockEndpointAppContextServiceSetupContract,
createMockEndpointAppContextServiceStartContract,
} from '../../mocks';
+import type { ResponseActionAgentType } from '../../../../common/endpoint/service/response_actions/constants';
describe('When using `getActionList()', () => {
let esClient: ElasticsearchClientMock;
@@ -326,6 +327,7 @@ describe('When using `getActionList()', () => {
esClient,
logger,
metadataService: endpointAppContextService.getEndpointMetadataService(),
+ agentTypes: ['endpoint'] as ResponseActionAgentType[],
elasticAgentIds: ['123'],
pageSize: 20,
startDate: 'now-10d',
@@ -363,6 +365,11 @@ describe('When using `getActionList()', () => {
'data.command': ['isolate', 'unisolate', 'get-file'],
},
},
+ {
+ terms: {
+ input_type: ['endpoint'],
+ },
+ },
{
terms: {
agents: ['123'],
diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.ts
index f33c716da2434..efcbd6fb49a92 100644
--- a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.ts
@@ -11,21 +11,25 @@ import { fetchActionResponses } from './fetch_action_responses';
import { ENDPOINT_DEFAULT_PAGE_SIZE } from '../../../../common/endpoint/constants';
import { CustomHttpRequestError } from '../../../utils/custom_http_request_error';
import type { ActionListApiResponse } from '../../../../common/endpoint/types';
-import type { ResponseActionStatus } from '../../../../common/endpoint/service/response_actions/constants';
+import type {
+ ResponseActionAgentType,
+ ResponseActionStatus,
+} from '../../../../common/endpoint/service/response_actions/constants';
import { getActions } from '../../utils/action_list_helpers';
import {
- formatEndpointActionResults,
categorizeResponseResults,
- mapToNormalizedActionRequest,
- getAgentHostNamesWithIds,
createActionDetailsRecord,
+ formatEndpointActionResults,
+ getAgentHostNamesWithIds,
+ mapToNormalizedActionRequest,
} from './utils';
import type { EndpointMetadataService } from '../metadata';
import { ACTIONS_SEARCH_PAGE_SIZE } from './constants';
interface OptionalFilterParams {
+ agentTypes?: ResponseActionAgentType[];
commands?: string[];
elasticAgentIds?: string[];
endDate?: string;
@@ -47,6 +51,7 @@ interface OptionalFilterParams {
* filter out action details based on statuses filter options
*/
export const getActionListByStatus = async ({
+ agentTypes,
commands,
elasticAgentIds,
esClient,
@@ -71,6 +76,7 @@ export const getActionListByStatus = async ({
const page = _page ?? 1;
const { actionDetails: allActionDetails } = await getActionDetailsList({
+ agentTypes,
commands,
elasticAgentIds,
esClient,
@@ -96,6 +102,7 @@ export const getActionListByStatus = async ({
pageSize: size,
startDate,
endDate,
+ agentTypes,
elasticAgentIds,
userIds,
commands,
@@ -110,6 +117,7 @@ export const getActionListByStatus = async ({
* Retrieve a list of Actions (`ActionDetails`)
*/
export const getActionList = async ({
+ agentTypes,
commands,
elasticAgentIds,
esClient,
@@ -134,6 +142,7 @@ export const getActionList = async ({
const from = (page - 1) * size;
const { actionDetails, totalRecords } = await getActionDetailsList({
+ agentTypes,
commands,
elasticAgentIds,
esClient,
@@ -154,6 +163,7 @@ export const getActionList = async ({
pageSize: size,
startDate,
endDate,
+ agentTypes,
elasticAgentIds,
userIds,
commands,
@@ -170,6 +180,7 @@ export type GetActionDetailsListParam = OptionalFilterParams & {
size: number;
};
const getActionDetailsList = async ({
+ agentTypes,
commands,
elasticAgentIds,
esClient,
@@ -183,7 +194,9 @@ const getActionDetailsList = async ({
unExpiredOnly,
withOutputs,
types,
-}: GetActionDetailsListParam & { metadataService: EndpointMetadataService }): Promise<{
+}: GetActionDetailsListParam & {
+ metadataService: EndpointMetadataService;
+}): Promise<{
actionDetails: ActionListApiResponse['data'];
totalRecords: number;
}> => {
@@ -195,6 +208,7 @@ const getActionDetailsList = async ({
try {
// fetch actions with matching agent_ids if any
const { actionIds, actionRequests: _actionRequests } = await getActions({
+ agentTypes,
commands,
esClient,
elasticAgentIds,
diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/action_list_helpers.test.ts b/x-pack/plugins/security_solution/server/endpoint/utils/action_list_helpers.test.ts
index c552cb3601534..fce8721f78391 100644
--- a/x-pack/plugins/security_solution/server/endpoint/utils/action_list_helpers.test.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/utils/action_list_helpers.test.ts
@@ -68,6 +68,7 @@ describe('action helpers', () => {
size: 20,
from: 5,
startDate: 'now-10d',
+ agentTypes: ['endpoint'],
elasticAgentIds: ['agent-123', 'agent-456'],
endDate: 'now',
commands: ['isolate', 'unisolate', 'get-file'],
@@ -102,6 +103,11 @@ describe('action helpers', () => {
'data.command': ['isolate', 'unisolate', 'get-file'],
},
},
+ {
+ terms: {
+ input_type: ['endpoint'],
+ },
+ },
{
terms: {
agents: ['agent-123', 'agent-456'],
@@ -273,5 +279,323 @@ describe('action helpers', () => {
expect(actions.actionIds).toEqual(['123']);
expect(actions.actionRequests?.body?.hits?.hits[0]._source?.agent.id).toEqual('agent-a');
});
+
+ describe('action `Types` filter', () => {
+ it('should correctly query with multiple action `types` filter options provided', async () => {
+ const esClient = mockScopedEsClient.asInternalUser;
+
+ applyActionListEsSearchMock(esClient);
+ await getActions({
+ esClient,
+ size: 20,
+ from: 5,
+ startDate: 'now-10d',
+ elasticAgentIds: ['agent-123', 'agent-456'],
+ endDate: 'now',
+ types: ['manual', 'automated'],
+ userIds: ['*elastic*', '*kibana*'],
+ });
+
+ expect(esClient.search).toHaveBeenCalledWith(
+ {
+ body: {
+ query: {
+ bool: {
+ must: [
+ {
+ bool: {
+ filter: [
+ {
+ range: {
+ '@timestamp': {
+ gte: 'now-10d',
+ },
+ },
+ },
+ {
+ range: {
+ '@timestamp': {
+ lte: 'now',
+ },
+ },
+ },
+
+ {
+ terms: {
+ agents: ['agent-123', 'agent-456'],
+ },
+ },
+ ],
+ },
+ },
+ {
+ bool: {
+ should: [
+ {
+ bool: {
+ should: [
+ {
+ query_string: {
+ fields: ['user_id'],
+ query: '*elastic*',
+ },
+ },
+ ],
+ minimum_should_match: 1,
+ },
+ },
+ {
+ bool: {
+ should: [
+ {
+ query_string: {
+ fields: ['user_id'],
+ query: '*kibana*',
+ },
+ },
+ ],
+ minimum_should_match: 1,
+ },
+ },
+ ],
+ minimum_should_match: 1,
+ },
+ },
+ ],
+ },
+ },
+ sort: [
+ {
+ '@timestamp': {
+ order: 'desc',
+ },
+ },
+ ],
+ },
+ from: 5,
+ index: '.logs-endpoint.actions-default',
+ size: 20,
+ },
+ {
+ ignore: [404],
+ meta: true,
+ }
+ );
+ });
+
+ it('should correctly query with single `manual` action `types` filter options provided', async () => {
+ const esClient = mockScopedEsClient.asInternalUser;
+
+ applyActionListEsSearchMock(esClient);
+ await getActions({
+ esClient,
+ size: 20,
+ from: 5,
+ startDate: 'now-10d',
+ elasticAgentIds: ['agent-123', 'agent-456'],
+ endDate: 'now',
+ types: ['manual'],
+ userIds: ['*elastic*', '*kibana*'],
+ });
+
+ expect(esClient.search).toHaveBeenCalledWith(
+ {
+ body: {
+ query: {
+ bool: {
+ must: [
+ {
+ bool: {
+ filter: [
+ {
+ range: {
+ '@timestamp': {
+ gte: 'now-10d',
+ },
+ },
+ },
+ {
+ range: {
+ '@timestamp': {
+ lte: 'now',
+ },
+ },
+ },
+
+ {
+ terms: {
+ agents: ['agent-123', 'agent-456'],
+ },
+ },
+ ],
+ },
+ },
+ {
+ bool: {
+ should: [
+ {
+ bool: {
+ should: [
+ {
+ query_string: {
+ fields: ['user_id'],
+ query: '*elastic*',
+ },
+ },
+ ],
+ minimum_should_match: 1,
+ },
+ },
+ {
+ bool: {
+ should: [
+ {
+ query_string: {
+ fields: ['user_id'],
+ query: '*kibana*',
+ },
+ },
+ ],
+ minimum_should_match: 1,
+ },
+ },
+ ],
+ minimum_should_match: 1,
+ },
+ },
+ ],
+ must_not: {
+ exists: {
+ field: 'data.alert_id',
+ },
+ },
+ },
+ },
+ sort: [
+ {
+ '@timestamp': {
+ order: 'desc',
+ },
+ },
+ ],
+ },
+ from: 5,
+ index: '.logs-endpoint.actions-default',
+ size: 20,
+ },
+ {
+ ignore: [404],
+ meta: true,
+ }
+ );
+ });
+
+ it('should correctly query with single `automated` action `types` filter options provided', async () => {
+ const esClient = mockScopedEsClient.asInternalUser;
+
+ applyActionListEsSearchMock(esClient);
+ await getActions({
+ esClient,
+ size: 20,
+ from: 5,
+ startDate: 'now-10d',
+ elasticAgentIds: ['agent-123', 'agent-456'],
+ endDate: 'now',
+ types: ['automated'],
+ userIds: ['*elastic*', '*kibana*'],
+ });
+
+ expect(esClient.search).toHaveBeenCalledWith(
+ {
+ body: {
+ query: {
+ bool: {
+ must: [
+ {
+ bool: {
+ filter: [
+ {
+ range: {
+ '@timestamp': {
+ gte: 'now-10d',
+ },
+ },
+ },
+ {
+ range: {
+ '@timestamp': {
+ lte: 'now',
+ },
+ },
+ },
+
+ {
+ terms: {
+ agents: ['agent-123', 'agent-456'],
+ },
+ },
+ ],
+ },
+ },
+ {
+ bool: {
+ should: [
+ {
+ bool: {
+ should: [
+ {
+ query_string: {
+ fields: ['user_id'],
+ query: '*elastic*',
+ },
+ },
+ ],
+ minimum_should_match: 1,
+ },
+ },
+ {
+ bool: {
+ should: [
+ {
+ query_string: {
+ fields: ['user_id'],
+ query: '*kibana*',
+ },
+ },
+ ],
+ minimum_should_match: 1,
+ },
+ },
+ ],
+ minimum_should_match: 1,
+ },
+ },
+ ],
+ filter: {
+ exists: {
+ field: 'data.alert_id',
+ },
+ },
+ },
+ },
+ sort: [
+ {
+ '@timestamp': {
+ order: 'desc',
+ },
+ },
+ ],
+ },
+ from: 5,
+ index: '.logs-endpoint.actions-default',
+ size: 20,
+ },
+ {
+ ignore: [404],
+ meta: true,
+ }
+ );
+ });
+ });
});
});
diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/action_list_helpers.ts b/x-pack/plugins/security_solution/server/endpoint/utils/action_list_helpers.ts
index 4c1d7e584f214..056e01326f9a9 100644
--- a/x-pack/plugins/security_solution/server/endpoint/utils/action_list_helpers.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/utils/action_list_helpers.ts
@@ -20,7 +20,27 @@ const queryOptions = Object.freeze({
ignore: [404],
});
+const getActionTypeFilter = (actionType: string): SearchRequest => {
+ return actionType === 'manual'
+ ? {
+ must_not: {
+ exists: {
+ field: 'data.alert_id',
+ },
+ },
+ }
+ : actionType === 'automated'
+ ? {
+ filter: {
+ exists: {
+ field: 'data.alert_id',
+ },
+ },
+ }
+ : {};
+};
export const getActions = async ({
+ agentTypes,
commands,
elasticAgentIds,
esClient,
@@ -45,6 +65,10 @@ export const getActions = async ({
});
}
+ if (agentTypes?.length) {
+ additionalFilters.push({ terms: { input_type: agentTypes } });
+ }
+
if (elasticAgentIds?.length) {
additionalFilters.push({ terms: { agents: elasticAgentIds } });
}
@@ -65,36 +89,14 @@ export const getActions = async ({
},
];
- const getTypesFilter = (): SearchRequest => {
- const singleType = types?.length === 1 && types[0];
- if (!singleType) {
- return {};
- }
- return singleType === 'manual'
- ? {
- must_not: {
- exists: {
- field: 'data.alert_id',
- },
- },
- }
- : singleType === 'automated'
- ? {
- filter: {
- exists: {
- field: 'data.alert_id',
- },
- },
- }
- : {};
- };
-
if (userIds?.length) {
const userIdsKql = userIds.map((userId) => `user_id:${userId}`).join(' or ');
const mustClause = toElasticsearchQuery(fromKueryExpression(userIdsKql));
must.push(mustClause);
}
+ const isNotASingleActionType = !types || (types && types.length > 1);
+
const actionsSearchQuery: SearchRequest = {
index: ENDPOINT_ACTIONS_INDEX,
size,
@@ -103,7 +105,7 @@ export const getActions = async ({
query: {
bool: {
must,
- ...getTypesFilter(),
+ ...(isNotASingleActionType ? {} : getActionTypeFilter(types[0])),
},
},
sort: [
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts
index 2402e9fdcdf33..2756c54b71951 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts
@@ -745,6 +745,7 @@ export const convertPrebuiltRuleAssetToRuleResponse = (
related_integrations: [],
required_fields: [],
setup: '',
+ note: '',
references: [],
threat: [],
tags: [],
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.ts
index 1e8931122f5c4..bd66139529cb3 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.ts
@@ -10,28 +10,29 @@ import type { Rule } from '@kbn/alerting-plugin/common';
import { isEqual, xorWith } from 'lodash';
import { stringifyZodError } from '@kbn/zod-helpers';
import {
- RESPONSE_ACTION_API_COMMANDS_TO_CONSOLE_COMMAND_MAP,
+ type QueryRule,
+ type ResponseAction,
+ type RuleCreateProps,
+ RuleResponse,
+ type RuleResponseAction,
+ type RuleUpdateProps,
+} from '../../../../../common/api/detection_engine';
+import {
+ RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP,
RESPONSE_CONSOLE_ACTION_COMMANDS_TO_REQUIRED_AUTHZ,
} from '../../../../../common/endpoint/service/response_actions/constants';
import { isQueryRule } from '../../../../../common/detection_engine/utils';
import type { SecuritySolutionApiRequestHandlerContext } from '../../../..';
import { CustomHttpRequestError } from '../../../../utils/custom_http_request_error';
-import type {
- QueryRule,
- RuleCreateProps,
- RuleUpdateProps,
-} from '../../../../../common/api/detection_engine/model/rule_schema';
-import { RuleResponse } from '../../../../../common/api/detection_engine/model/rule_schema';
-import type { RuleParams, RuleAlertType, UnifiedQueryRuleParams } from '../../rule_schema';
-import { hasValidRuleType } from '../../rule_schema';
-import type { BulkError } from '../../routes/utils';
-import { createBulkErrorObject } from '../../routes/utils';
+import {
+ hasValidRuleType,
+ type RuleAlertType,
+ type RuleParams,
+ type UnifiedQueryRuleParams,
+} from '../../rule_schema';
+import { type BulkError, createBulkErrorObject } from '../../routes/utils';
import { transform } from './utils';
import { internalRuleToAPIResponse } from '../normalization/rule_converters';
-import type {
- ResponseAction,
- RuleResponseAction,
-} from '../../../../../common/api/detection_engine/model/rule_response_actions';
export const transformValidate = (rule: PartialRule): RuleResponse => {
const transformed = transform(rule);
@@ -101,7 +102,7 @@ export const validateResponseActionsPermissions = async (
}
const authzPropName =
RESPONSE_CONSOLE_ACTION_COMMANDS_TO_REQUIRED_AUTHZ[
- RESPONSE_ACTION_API_COMMANDS_TO_CONSOLE_COMMAND_MAP[action.params.command]
+ RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP[action.params.command]
];
const isValid = endpointAuthz[authzPropName];
diff --git a/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connector_overview.tsx b/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connector_overview.tsx
index f75a6d405c43e..a4d79759d71cb 100644
--- a/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connector_overview.tsx
+++ b/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connector_overview.tsx
@@ -64,9 +64,9 @@ export const ConnectorOverview: React.FC = ({ connector
mutate()}
diff --git a/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty.test.tsx
index 4df68dee15880..98a20e6e7723b 100644
--- a/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty.test.tsx
+++ b/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty.test.tsx
@@ -84,7 +84,7 @@ describe('pagerduty action params validation', () => {
});
});
- test('action params validation fails when customDetails are not valid JSON', async () => {
+ test('action params validation fails when customDetails are not valid JSON object', async () => {
const actionParams = {
eventAction: 'trigger',
dedupKey: 'test',
@@ -95,7 +95,7 @@ describe('pagerduty action params validation', () => {
component: 'test',
group: 'group',
class: 'test class',
- customDetails: '{foo:bar}',
+ customDetails: '{foo:bar, "customFields": "{{contex.foo}}"}',
links: [],
};
@@ -105,12 +105,12 @@ describe('pagerduty action params validation', () => {
summary: [],
timestamp: [],
links: [],
- customDetails: ['Custom details must be a valid JSON.'],
+ customDetails: ['Custom details must be a valid JSON object.'],
},
});
});
- test('action params validation does not fail when customDetails are not JSON but have mustache templates inside', async () => {
+ test('action params validation fails when customDetails are a valid JSON but not an object', async () => {
const actionParams = {
eventAction: 'trigger',
dedupKey: 'test',
@@ -121,7 +121,59 @@ describe('pagerduty action params validation', () => {
component: 'test',
group: 'group',
class: 'test class',
- customDetails: '{"details": {{alert.flapping}}}',
+ customDetails: '1234',
+ links: [],
+ };
+
+ expect(await connectorTypeModel.validateParams(actionParams)).toEqual({
+ errors: {
+ dedupKey: [],
+ summary: [],
+ timestamp: [],
+ links: [],
+ customDetails: ['Custom details must be a valid JSON object.'],
+ },
+ });
+ });
+
+ test('action params validation fails when customDetails are an array of objects', async () => {
+ const actionParams = {
+ eventAction: 'trigger',
+ dedupKey: 'test',
+ summary: '2323',
+ source: 'source',
+ severity: 'critical',
+ timestamp: new Date().toISOString(),
+ component: 'test',
+ group: 'group',
+ class: 'test class',
+ customDetails: '[{"details": "Foo Bar"}, {"details": "{{alert.flapping}}"}]',
+ links: [],
+ };
+
+ expect(await connectorTypeModel.validateParams(actionParams)).toEqual({
+ errors: {
+ dedupKey: [],
+ summary: [],
+ timestamp: [],
+ links: [],
+ customDetails: ['Custom details must be a valid JSON object.'],
+ },
+ });
+ });
+
+ test('action params validation does not fail when customDetails are a valid JSON object', async () => {
+ const actionParams = {
+ eventAction: 'trigger',
+ dedupKey: 'test',
+ summary: '2323',
+ source: 'source',
+ severity: 'critical',
+ timestamp: new Date().toISOString(),
+ component: 'test',
+ group: 'group',
+ class: 'test class',
+ customDetails: '{"details": "{{alert.flapping}}"}',
links: [],
};
diff --git a/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty.tsx b/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty.tsx
index b02665eec66be..60997267a430c 100644
--- a/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty.tsx
+++ b/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty.tsx
@@ -16,6 +16,7 @@ import {
AlertProvidedActionVariables,
hasMustacheTokens,
} from '@kbn/triggers-actions-ui-plugin/public';
+import { isPlainObject } from 'lodash';
import {
PagerDutyConfig,
PagerDutySecrets,
@@ -92,18 +93,22 @@ export function getConnectorType(): ConnectorTypeModel<
}
});
}
- if (actionParams.customDetails?.length && !hasMustacheTokens(actionParams.customDetails)) {
+ if (actionParams.customDetails?.length) {
+ const errorMessage = i18n.translate(
+ 'xpack.stackConnectors.components.pagerDuty.error.invalidCustomDetails',
+ {
+ defaultMessage: 'Custom details must be a valid JSON object.',
+ }
+ );
+
try {
- JSON.parse(actionParams.customDetails);
+ const parsedJSON = JSON.parse(actionParams.customDetails);
+
+ if (!isPlainObject(parsedJSON)) {
+ errors.customDetails.push(errorMessage);
+ }
} catch {
- errors.customDetails.push(
- i18n.translate(
- 'xpack.stackConnectors.components.pagerDuty.error.invalidCustomDetails',
- {
- defaultMessage: 'Custom details must be a valid JSON.',
- }
- )
- );
+ errors.customDetails.push(errorMessage);
}
}
return validationResult;
diff --git a/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty_params.tsx b/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty_params.tsx
index 7c9d74de5e571..8950fe1df9c10 100644
--- a/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty_params.tsx
+++ b/x-pack/plugins/stack_connectors/public/connector_types/pagerduty/pagerduty_params.tsx
@@ -370,7 +370,7 @@ const PagerDutyParamsFields: React.FunctionComponent {
if (!customDetails) {
- editAction('customDetails', '', index);
+ editAction('customDetails', '{}', index);
}
}}
dataTestSubj="customDetailsJsonEditor"
diff --git a/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.tsx b/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.tsx
index a0f4c573c0b07..11249f9c8db3c 100644
--- a/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.tsx
+++ b/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.tsx
@@ -81,6 +81,7 @@ const TinesParamsFields: React.FunctionComponent();
+ const [bodyOption, setBodyOption] = useState('');
const isTest = useMemo(() => executionMode === ActionConnectorMode.Test, [executionMode]);
@@ -88,8 +89,7 @@ const TinesParamsFields: React.FunctionComponent {
+ if (body !== bodyOption) {
+ editSubActionParams({ body: bodyOption });
+ }
+ }, [body, bodyOption, editSubActionParams]);
+
const selectedStoryOptions = useMemo(
() => (selectedStoryOption ? [selectedStoryOption] : []),
[selectedStoryOption]
@@ -309,14 +315,7 @@ const TinesParamsFields: React.FunctionComponent {
- editSubActionParams({ body: json });
- }}
- onBlur={() => {
- if (!body) {
- editSubActionParams({ body: '' });
- }
- }}
+ onDocumentsChange={setBodyOption}
dataTestSubj="tines-bodyJsonEditor"
/>
diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_button.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_button.tsx
index 1a01605c024fa..5ed9968c59923 100644
--- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_button.tsx
+++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_button.tsx
@@ -6,7 +6,7 @@
*/
import React, { useState } from 'react';
-import { FieldValueSelection } from '@kbn/exploratory-view-plugin/public';
+import { FieldValueSelection } from '@kbn/observability-shared-plugin/public';
import {
getSyntheticsFilterDisplayValues,
SyntheticsMonitorFilterItem,
diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json
index a7af8827c0efd..d6840a2267d7b 100644
--- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json
+++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json
@@ -7000,6 +7000,86 @@
"type": "long"
}
}
+ },
+ "customFields": {
+ "properties": {
+ "totalsByType": {
+ "properties": {
+ "DYNAMIC_KEY": {
+ "type": "long"
+ }
+ }
+ },
+ "totals": {
+ "type": "long"
+ },
+ "required": {
+ "type": "long"
+ }
+ }
+ }
+ }
+ },
+ "sec": {
+ "properties": {
+ "customFields": {
+ "properties": {
+ "totalsByType": {
+ "properties": {
+ "DYNAMIC_KEY": {
+ "type": "long"
+ }
+ }
+ },
+ "totals": {
+ "type": "long"
+ },
+ "required": {
+ "type": "long"
+ }
+ }
+ }
+ }
+ },
+ "obs": {
+ "properties": {
+ "customFields": {
+ "properties": {
+ "totalsByType": {
+ "properties": {
+ "DYNAMIC_KEY": {
+ "type": "long"
+ }
+ }
+ },
+ "totals": {
+ "type": "long"
+ },
+ "required": {
+ "type": "long"
+ }
+ }
+ }
+ }
+ },
+ "main": {
+ "properties": {
+ "customFields": {
+ "properties": {
+ "totalsByType": {
+ "properties": {
+ "DYNAMIC_KEY": {
+ "type": "long"
+ }
+ }
+ },
+ "totals": {
+ "type": "long"
+ },
+ "required": {
+ "type": "long"
+ }
+ }
}
}
}
diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json
index 9633397e242da..0721062d74520 100644
--- a/x-pack/plugins/translations/translations/fr-FR.json
+++ b/x-pack/plugins/translations/translations/fr-FR.json
@@ -16103,10 +16103,6 @@
"xpack.exploratoryView.expView.heading.addToCase.notification": "Visualisation correctement ajoutée au cas : {caseTitle}",
"xpack.exploratoryView.expView.lastUpdated.label": "Dernière mise à jour : {updatedDate}",
"xpack.exploratoryView.expView.seriesEditor.selectReportMetric.noFieldData": "Aucune donnée disponible pour le champ {field}.",
- "xpack.exploratoryView.fieldValueSelection.apply.label": "Appliquer les filtres sélectionnés pour {label}",
- "xpack.exploratoryView.fieldValueSelection.placeholder": "Filtrer {label}",
- "xpack.exploratoryView.fieldValueSelection.placeholder.search": "Rechercher {label}",
- "xpack.exploratoryView.filterButton.label": "développe le groupe de filtres pour le filtre {label}",
"xpack.exploratoryView.filters.expanded.search": "Rechercher {label}",
"xpack.exploratoryView.filters.label.wildcard": "Caractère générique {label}",
"xpack.exploratoryView.filters.searchResults": "{total} résultats de recherche",
@@ -16271,9 +16267,6 @@
"xpack.exploratoryView.expView.synthetics.wait": "Attendre",
"xpack.exploratoryView.expView.totalRuns": "Total d'exécutions",
"xpack.exploratoryView.feedbackMenu.appName": "Observabilité",
- "xpack.exploratoryView.fieldValueSelection.apply": "Appliquer",
- "xpack.exploratoryView.fieldValueSelection.loading": "Chargement",
- "xpack.exploratoryView.fieldValueSelection.logicalAnd": "Utiliser AND logique",
"xpack.exploratoryView.filters.expanded.labels.backTo": "Retour aux étiquettes",
"xpack.exploratoryView.filters.expanded.labels.fields": "Champs d'étiquette",
"xpack.exploratoryView.filters.expanded.labels.label": "Étiquettes",
@@ -19947,7 +19940,6 @@
"xpack.infra.durationUnits.weeks.singular": "semaine",
"xpack.infra.durationUnits.years.plural": "années",
"xpack.infra.durationUnits.years.singular": "an",
- "xpack.infra.errorOnLoadingLensDependencies": "Une erreur s'est produite lors de la tentative de chargement du plug-in Lens.",
"xpack.infra.errorPage.errorOccurredTitle": "Une erreur s'est produite",
"xpack.infra.errorPage.tryAgainButtonLabel": "Réessayer",
"xpack.infra.errorPage.tryAgainDescription ": "Cliquez sur le bouton Retour et réessayez.",
@@ -28636,7 +28628,6 @@
"xpack.observability.slo.duration.month": "{duration, plural, one {1 mois} many {# mois} other {# mois}}",
"xpack.observability.slo.duration.week": "{duration, plural, one {1 semaine} many {# semaines} other {# prochaines semaines}}",
"xpack.observability.slo.indicatorTypeBadge.exploreInApm": "Afficher les détails de {service}",
- "xpack.observability.slo.list.sortByType": "Trier par {type}",
"xpack.observability.slo.rules.burnRate.errors.invalidThresholdValue": "Le seuil du taux d'avancement doit être compris entre 1 et {maxBurnRate}.",
"xpack.observability.slo.rules.groupByMessage": "Le SLO que vous avez sélectionné a été créé avec une partition sur \"{groupByField}\". Cette règle surveille et génère une alerte pour chaque instance trouvée dans le champ de partition.",
"xpack.observability.slo.rules.longWindowDuration.tooltip": "Période historique sur laquelle le taux d'avancement est calculé. Une période historique plus courte de {shortWindowDuration} minutes (1/12 de la période historique) sera utilisée pour une récupération plus rapide",
@@ -28702,7 +28693,6 @@
"xpack.observability.alertsTable.notEnoughPermissions": "Privilèges supplémentaires requis",
"xpack.observability.alertsTable.viewInAppTextLabel": "Afficher dans l'application",
"xpack.observability.alertsTGrid.durationColumnDescription": "Durée",
- "xpack.observability.alertsTGrid.lastUpdatedColumnDescription": "Dernière mise à jour",
"xpack.observability.alertsTGrid.reasonColumnDescription": "Raison",
"xpack.observability.alertsTGrid.statusActiveDescription": "Actif",
"xpack.observability.alertsTGrid.statusColumnDescription": "Statut de l'alerte",
@@ -29031,7 +29021,6 @@
"xpack.observability.slo.list.errorNotification": "Un problème est survenu lors de la récupération des SLO",
"xpack.observability.slo.list.errorTitle": "Impossible de charger les SLO",
"xpack.observability.slo.list.search": "Interroger vos SLO...",
- "xpack.observability.slo.list.sortBy": "Trier par",
"xpack.observability.slo.list.sortBy.errorBudgetConsumed": "Budget d'erreur consommé",
"xpack.observability.slo.list.sortBy.errorBudgetRemaining": "Budget d'erreur restant",
"xpack.observability.slo.list.sortBy.sliValue": "Valeur SLI",
@@ -33960,7 +33949,6 @@
"xpack.securitySolution.endpoint.actions.agentPolicy": "Afficher la politique de l'agent",
"xpack.securitySolution.endpoint.actions.agentPolicyReassign": "Réaffecter la politique de l'agent",
"xpack.securitySolution.endpoint.actions.console": "Répondre",
- "xpack.securitySolution.endpoint.actions.disabledResponder.tooltip": "La version actuelle de l'agent ne prend pas en charge cette fonctionnalité. Mettez à niveau votre agent via Fleet pour utiliser cette fonctionnalité et les nouvelles actions de réponse telles que l'arrêt et la suspension des processus.",
"xpack.securitySolution.endpoint.actions.hostDetails": "Afficher les détails de l'hôte",
"xpack.securitySolution.endpoint.actions.insufficientPrivileges.error": "Vous ne disposez pas de privilèges suffisants pour utiliser cette commande. Veuillez contacter votre administrateur pour obtenir des droits d'accès.",
"xpack.securitySolution.endpoint.actions.isolateHost": "Isoler l'hôte",
@@ -43040,4 +43028,4 @@
"xpack.serverlessObservability.nav.projectSettings": "Paramètres de projet",
"xpack.serverlessObservability.nav.visualizations": "Visualisations"
}
-}
+}
\ No newline at end of file
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 4698cc060b7d9..7f0edf5001eef 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -16116,10 +16116,6 @@
"xpack.exploratoryView.expView.heading.addToCase.notification": "ビジュアライゼーションが正常にケースに追加されました:{caseTitle}",
"xpack.exploratoryView.expView.lastUpdated.label": "最終更新:{updatedDate}",
"xpack.exploratoryView.expView.seriesEditor.selectReportMetric.noFieldData": "フィールド{field}のデータがありません。",
- "xpack.exploratoryView.fieldValueSelection.apply.label": "{label}に選択したフィルターを適用",
- "xpack.exploratoryView.fieldValueSelection.placeholder": "フィルター{label}",
- "xpack.exploratoryView.fieldValueSelection.placeholder.search": "{label}を検索",
- "xpack.exploratoryView.filterButton.label": "{label}フィルターのフィルターグループを展開",
"xpack.exploratoryView.filters.expanded.search": "{label}を検索",
"xpack.exploratoryView.filters.label.wildcard": "{label}ワイルドカード",
"xpack.exploratoryView.filters.searchResults": "{total}件の検索結果",
@@ -16284,9 +16280,6 @@
"xpack.exploratoryView.expView.synthetics.wait": "待機",
"xpack.exploratoryView.expView.totalRuns": "合計実行回数",
"xpack.exploratoryView.feedbackMenu.appName": "Observability",
- "xpack.exploratoryView.fieldValueSelection.apply": "適用",
- "xpack.exploratoryView.fieldValueSelection.loading": "読み込み中",
- "xpack.exploratoryView.fieldValueSelection.logicalAnd": "論理ANDを使用",
"xpack.exploratoryView.filters.expanded.labels.backTo": "ラベルに戻る",
"xpack.exploratoryView.filters.expanded.labels.fields": "ラベルフィールド",
"xpack.exploratoryView.filters.expanded.labels.label": "ラベル",
@@ -19960,7 +19953,6 @@
"xpack.infra.durationUnits.weeks.singular": "週",
"xpack.infra.durationUnits.years.plural": "年",
"xpack.infra.durationUnits.years.singular": "年",
- "xpack.infra.errorOnLoadingLensDependencies": "Lens Pluginを読み込む際にエラーが発生しました。",
"xpack.infra.errorPage.errorOccurredTitle": "エラーが発生しました",
"xpack.infra.errorPage.tryAgainButtonLabel": "再試行",
"xpack.infra.errorPage.tryAgainDescription ": "戻るボタンをクリックして再試行してください。",
@@ -28637,7 +28629,6 @@
"xpack.observability.slo.duration.month": "{duration, plural, other {#月}}",
"xpack.observability.slo.duration.week": "{duration, plural, other {#週}}",
"xpack.observability.slo.indicatorTypeBadge.exploreInApm": "{service}詳細を表示",
- "xpack.observability.slo.list.sortByType": "{type}で並べ替え",
"xpack.observability.slo.rules.burnRate.errors.invalidThresholdValue": "バーンレートしきい値は1以上{maxBurnRate}以下でなければなりません。",
"xpack.observability.slo.rules.groupByMessage": "選択したSLOは\"{groupByField}\"にパーティションが作成されました。このルールは、パーティションフィールドで見つかったすべてのインスタンスを監視し、アラートを生成します。",
"xpack.observability.slo.rules.longWindowDuration.tooltip": "バーンレートが計算されるルックバック期間。ルックバック期間を{shortWindowDuration}分(ルックバック期間の1/12)と短くすることで、より高速な復帰が可能になります",
@@ -28703,7 +28694,6 @@
"xpack.observability.alertsTable.notEnoughPermissions": "追加の権限が必要です",
"xpack.observability.alertsTable.viewInAppTextLabel": "アプリで表示",
"xpack.observability.alertsTGrid.durationColumnDescription": "期間",
- "xpack.observability.alertsTGrid.lastUpdatedColumnDescription": "最終更新",
"xpack.observability.alertsTGrid.reasonColumnDescription": "理由",
"xpack.observability.alertsTGrid.statusActiveDescription": "アクティブ",
"xpack.observability.alertsTGrid.statusColumnDescription": "アラートステータス",
@@ -29032,7 +29022,6 @@
"xpack.observability.slo.list.errorNotification": "SLOの取得中に問題が発生しました",
"xpack.observability.slo.list.errorTitle": "SLOを読み込めません",
"xpack.observability.slo.list.search": "SLOを検索...",
- "xpack.observability.slo.list.sortBy": "並べ替え基準",
"xpack.observability.slo.list.sortBy.errorBudgetConsumed": "エラー予算が消費されました",
"xpack.observability.slo.list.sortBy.errorBudgetRemaining": "残り予算エラー",
"xpack.observability.slo.list.sortBy.sliValue": "SLI値",
@@ -33960,7 +33949,6 @@
"xpack.securitySolution.endpoint.actions.agentPolicy": "エージェントポリシーを表示",
"xpack.securitySolution.endpoint.actions.agentPolicyReassign": "エージェントポリシーを再割り当て",
"xpack.securitySolution.endpoint.actions.console": "対応",
- "xpack.securitySolution.endpoint.actions.disabledResponder.tooltip": "現在のバージョンのエージェントは、この機能をサポートしていません。Fleet経由でエージェントをアップグレードし、この機能と新しい対応アクション(プロセスの終了、一時停止など)を使用します。",
"xpack.securitySolution.endpoint.actions.hostDetails": "ホスト詳細を表示",
"xpack.securitySolution.endpoint.actions.insufficientPrivileges.error": "このコマンドを使用するための十分な権限がありません。アクセスについては、管理者に問い合わせてください。",
"xpack.securitySolution.endpoint.actions.isolateHost": "ホストの分離",
@@ -43032,4 +43020,4 @@
"xpack.serverlessObservability.nav.projectSettings": "プロジェクト設定",
"xpack.serverlessObservability.nav.visualizations": "ビジュアライゼーション"
}
-}
+}
\ No newline at end of file
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 9a99a93093d67..dc6e9ddc97326 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -16210,10 +16210,6 @@
"xpack.exploratoryView.expView.heading.addToCase.notification": "已成功将可视化添加到案例:{caseTitle}",
"xpack.exploratoryView.expView.lastUpdated.label": "上次更新时间:{updatedDate}",
"xpack.exploratoryView.expView.seriesEditor.selectReportMetric.noFieldData": "字段 {field} 无可用数据。",
- "xpack.exploratoryView.fieldValueSelection.apply.label": "为 {label} 应用选定筛选",
- "xpack.exploratoryView.fieldValueSelection.placeholder": "筛选 {label}",
- "xpack.exploratoryView.fieldValueSelection.placeholder.search": "搜索 {label}",
- "xpack.exploratoryView.filterButton.label": "展开筛选 {label} 的筛选组",
"xpack.exploratoryView.filters.expanded.search": "搜索 {label}",
"xpack.exploratoryView.filters.label.wildcard": "{label} 通配符",
"xpack.exploratoryView.filters.searchResults": "{total} 项搜索结果",
@@ -16378,9 +16374,6 @@
"xpack.exploratoryView.expView.synthetics.wait": "等待",
"xpack.exploratoryView.expView.totalRuns": "总运行次数",
"xpack.exploratoryView.feedbackMenu.appName": "Observability",
- "xpack.exploratoryView.fieldValueSelection.apply": "应用",
- "xpack.exploratoryView.fieldValueSelection.loading": "正在加载",
- "xpack.exploratoryView.fieldValueSelection.logicalAnd": "使用逻辑 AND",
"xpack.exploratoryView.filters.expanded.labels.backTo": "返回到标签",
"xpack.exploratoryView.filters.expanded.labels.fields": "标签字段",
"xpack.exploratoryView.filters.expanded.labels.label": "标签",
@@ -20054,7 +20047,6 @@
"xpack.infra.durationUnits.weeks.singular": "周",
"xpack.infra.durationUnits.years.plural": "年",
"xpack.infra.durationUnits.years.singular": "年",
- "xpack.infra.errorOnLoadingLensDependencies": "尝试加载 Lens 插件时出错。",
"xpack.infra.errorPage.errorOccurredTitle": "发生错误",
"xpack.infra.errorPage.tryAgainButtonLabel": "重试",
"xpack.infra.errorPage.tryAgainDescription ": "请点击后退按钮,然后重试。",
@@ -28621,7 +28613,6 @@
"xpack.observability.slo.duration.month": "{duration, plural, other {# 个月}}",
"xpack.observability.slo.duration.week": "{duration, plural, other {# 周}}",
"xpack.observability.slo.indicatorTypeBadge.exploreInApm": "查看 {service} 详情",
- "xpack.observability.slo.list.sortByType": "按 {type} 排序",
"xpack.observability.slo.rules.burnRate.errors.invalidThresholdValue": "消耗速度阈值必须介于 1 和 {maxBurnRate} 之间。",
"xpack.observability.slo.rules.groupByMessage": "已使用分区在“{groupByField}”上创建您选定的 SLO。此规则将监测在分区字段中发现的每个实例并为其生成告警。",
"xpack.observability.slo.rules.longWindowDuration.tooltip": "在其间计算消耗速度的回顾期。将使用 {shortWindowDuration} 分钟的较短回顾期(1/12 的回顾期)以便更快恢复",
@@ -28687,7 +28678,6 @@
"xpack.observability.alertsTable.notEnoughPermissions": "需要其他权限",
"xpack.observability.alertsTable.viewInAppTextLabel": "在应用中查看",
"xpack.observability.alertsTGrid.durationColumnDescription": "持续时间",
- "xpack.observability.alertsTGrid.lastUpdatedColumnDescription": "上次更新时间",
"xpack.observability.alertsTGrid.reasonColumnDescription": "原因",
"xpack.observability.alertsTGrid.statusActiveDescription": "活动",
"xpack.observability.alertsTGrid.statusColumnDescription": "告警状态",
@@ -29016,7 +29006,6 @@
"xpack.observability.slo.list.errorNotification": "提取 SLO 时出现问题",
"xpack.observability.slo.list.errorTitle": "无法加载 SLO",
"xpack.observability.slo.list.search": "搜索您的 SLO......",
- "xpack.observability.slo.list.sortBy": "排序依据",
"xpack.observability.slo.list.sortBy.errorBudgetConsumed": "已消耗错误预算",
"xpack.observability.slo.list.sortBy.errorBudgetRemaining": "剩余错误预算",
"xpack.observability.slo.list.sortBy.sliValue": "SLI 值",
@@ -33942,7 +33931,6 @@
"xpack.securitySolution.endpoint.actions.agentPolicy": "查看代理策略",
"xpack.securitySolution.endpoint.actions.agentPolicyReassign": "重新分配代理策略",
"xpack.securitySolution.endpoint.actions.console": "响应",
- "xpack.securitySolution.endpoint.actions.disabledResponder.tooltip": "当前版本的代理不支持此功能。请通过 Fleet 更新代理以使用此功能和新的响应操作,如结束和挂起进程。",
"xpack.securitySolution.endpoint.actions.hostDetails": "查看主机详情",
"xpack.securitySolution.endpoint.actions.insufficientPrivileges.error": "您没有足够的权限,无法使用此命令。请联系管理员获取访问权限。",
"xpack.securitySolution.endpoint.actions.isolateHost": "隔离主机",
@@ -43012,4 +43000,4 @@
"xpack.serverlessObservability.nav.projectSettings": "项目设置",
"xpack.serverlessObservability.nav.visualizations": "可视化"
}
-}
+}
\ No newline at end of file
diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx
index 41150d547b0ea..3b70c23a699fa 100644
--- a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx
+++ b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx
@@ -10,7 +10,7 @@ import { fireEvent, waitFor } from '@testing-library/react';
import { FiltersExpressionsSelect } from './filters_expression_select';
import { render } from '../../../../lib/helper/rtl_helpers';
import { filterAriaLabels as aria } from './translations';
-import * as Hooks from '@kbn/exploratory-view-plugin/public/hooks/use_values_list';
+import * as Hooks from '@kbn/observability-shared-plugin/public/hooks/use_values_list';
describe('FiltersExpressionSelect', () => {
const LOCATION_FIELD_NAME = 'observer.geo.name';
diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx
index 69b9c70993839..115adce92ae23 100644
--- a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx
+++ b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx
@@ -7,7 +7,7 @@
import React, { useState } from 'react';
import { EuiButtonIcon, EuiExpression, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
-import { FieldValueSuggestions } from '@kbn/exploratory-view-plugin/public';
+import { FieldValueSuggestions } from '@kbn/observability-shared-plugin/public';
import { filterLabels } from '../../filter_group/translations';
import { alertFilterLabels, filterAriaLabels } from './translations';
import { useUptimeDataView } from '../../../../contexts/uptime_data_view_context';
diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.test.tsx b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.test.tsx
index fd777f61ece53..7591bc7ef7473 100644
--- a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.test.tsx
+++ b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.test.tsx
@@ -9,7 +9,7 @@ import React from 'react';
import { fireEvent, waitFor } from '@testing-library/react';
import { render } from '../../../lib/helper/rtl_helpers';
import { FilterGroup } from './filter_group';
-import * as Hooks from '@kbn/exploratory-view-plugin/public/hooks/use_values_list';
+import * as Hooks from '@kbn/observability-shared-plugin/public/hooks/use_values_list';
describe('FilterGroup', () => {
it.each([
diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx
index 1261c02049164..5ed2cc69ad969 100644
--- a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx
+++ b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx
@@ -9,9 +9,11 @@ import React, { useCallback, useState } from 'react';
import { EuiFilterGroup } from '@elastic/eui';
import styled from 'styled-components';
import { capitalize } from 'lodash';
-import { FieldValueSuggestions } from '@kbn/exploratory-view-plugin/public';
import useLocalStorage from 'react-use/lib/useLocalStorage';
-import { useInspectorContext } from '@kbn/observability-shared-plugin/public';
+import {
+ useInspectorContext,
+ FieldValueSuggestions,
+} from '@kbn/observability-shared-plugin/public';
import { useFilterUpdate } from '../../../hooks/use_filter_update';
import { useSelectedFilters } from '../../../hooks/use_selected_filters';
import { SelectedFilters } from './selected_filters';
diff --git a/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx b/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx
index 9001bbd6a1d8c..89f490c143cea 100644
--- a/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx
+++ b/x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx
@@ -16,7 +16,7 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import type { ESFilter } from '@kbn/es-types';
-import { FieldValueSuggestions } from '@kbn/exploratory-view-plugin/public';
+import { FieldValueSuggestions } from '@kbn/observability-shared-plugin/public';
import { useLocalUIFilters } from '../hooks/use_local_uifilters';
import { useBreakpoints } from '../../../../hooks/use_breakpoints';
diff --git a/x-pack/test/alerting_api_integration/observability/custom_threshold_rule/custom_eq_avg_bytes_fired.ts b/x-pack/test/alerting_api_integration/observability/custom_threshold_rule/custom_eq_avg_bytes_fired.ts
index 6faf7734bafe7..abde66c6d2d8b 100644
--- a/x-pack/test/alerting_api_integration/observability/custom_threshold_rule/custom_eq_avg_bytes_fired.ts
+++ b/x-pack/test/alerting_api_integration/observability/custom_threshold_rule/custom_eq_avg_bytes_fired.ts
@@ -83,7 +83,8 @@ export default function ({ getService }: FtrProviderContext) {
await cleanup({ client: esClient, config: dataForgeConfig, logger });
});
- describe('Rule creation', () => {
+ // FLAKY: https://github.com/elastic/kibana/issues/175360
+ describe.skip('Rule creation', () => {
it('creates rule successfully', async () => {
actionId = await createIndexConnector({
supertest,
diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/ml_rule_types/anomaly_detection/alert.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/ml_rule_types/anomaly_detection/alert.ts
index e36d22a6c85af..1b5d456b5fb1d 100644
--- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/ml_rule_types/anomaly_detection/alert.ts
+++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/ml_rule_types/anomaly_detection/alert.ts
@@ -156,6 +156,7 @@ export default function alertTests({ getService }: FtrProviderContext) {
expect(doc._source['kibana.alert.url']).to.contain(
'/s/space1/app/ml/explorer/?_g=(ml%3A(jobIds%3A!(rt-anomaly-mean-value))'
);
+ expect(doc._source['kibana.alert.anomaly_score'][0]).to.be.above(0);
}
});
diff --git a/x-pack/test/api_integration/apis/asset_manager/tests/assets.ts b/x-pack/test/api_integration/apis/asset_manager/tests/assets.ts
index 936750f860c48..dc140d3cea763 100644
--- a/x-pack/test/api_integration/apis/asset_manager/tests/assets.ts
+++ b/x-pack/test/api_integration/apis/asset_manager/tests/assets.ts
@@ -15,8 +15,7 @@ export default function ({ getService }: FtrProviderContext) {
const synthtraceApm = getService('apmSynthtraceEsClient');
const synthtraceInfra = getService('infraSynthtraceEsClient');
- // FAILING VERSION BUMP: https://github.com/elastic/kibana/issues/172765
- describe.skip('GET /assets', () => {
+ describe('GET /assets', () => {
const from = new Date(Date.now() - 1000 * 60 * 2).toISOString();
const to = new Date().toISOString();
diff --git a/x-pack/test/api_integration/apis/asset_manager/tests/services.ts b/x-pack/test/api_integration/apis/asset_manager/tests/services.ts
index 608551a20d280..ae92a646b3b2a 100644
--- a/x-pack/test/api_integration/apis/asset_manager/tests/services.ts
+++ b/x-pack/test/api_integration/apis/asset_manager/tests/services.ts
@@ -17,8 +17,7 @@ export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const synthtrace = getService('apmSynthtraceEsClient');
- // FAILING VERSION BUMP: https://github.com/elastic/kibana/issues/172755
- describe.skip('GET /assets/services', () => {
+ describe('GET /assets/services', () => {
beforeEach(async () => {
await synthtrace.clean();
});
diff --git a/x-pack/test/cloud_security_posture_functional/mocks/vulnerabilities_latest_mock.ts b/x-pack/test/cloud_security_posture_functional/mocks/vulnerabilities_latest_mock.ts
index f0ffd4aebb388..301c328993c8b 100644
--- a/x-pack/test/cloud_security_posture_functional/mocks/vulnerabilities_latest_mock.ts
+++ b/x-pack/test/cloud_security_posture_functional/mocks/vulnerabilities_latest_mock.ts
@@ -182,10 +182,10 @@ export const vulnerabilitiesLatestMock = [
},
},
cloud: {
- provider: 'aws',
+ provider: 'gcp',
region: 'eu-west-1',
account: {
- name: 'elastic-security-cloud-security-dev',
+ name: 'elastic-security-cloud-security-gcp',
id: '704479110758',
},
},
diff --git a/x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts b/x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts
index 7f9530ba91d38..f0434c37b7118 100644
--- a/x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts
+++ b/x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts
@@ -227,6 +227,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
it('groups findings by rule name and sort by compliance score desc', async () => {
const groupSelector = await findings.groupSelector();
await groupSelector.openDropDown();
+ await groupSelector.setValue('None');
+ await groupSelector.openDropDown();
await groupSelector.setValue('Rule name');
const grouping = await findings.findingsGrouping();
@@ -283,7 +285,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
it('groups findings by cloud account and sort by compliance score desc', async () => {
const groupSelector = await findings.groupSelector();
-
+ await groupSelector.openDropDown();
+ await groupSelector.setValue('None');
+ await groupSelector.openDropDown();
await groupSelector.setValue('Cloud account');
const grouping = await findings.findingsGrouping();
@@ -338,6 +342,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
it('groups findings by Kubernetes cluster and sort by compliance score desc', async () => {
const groupSelector = await findings.groupSelector();
+ await groupSelector.openDropDown();
+ await groupSelector.setValue('None');
+ await groupSelector.openDropDown();
await groupSelector.setValue('Kubernetes cluster');
const grouping = await findings.findingsGrouping();
@@ -391,6 +398,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
describe('SearchBar', () => {
it('add filter', async () => {
const groupSelector = await findings.groupSelector();
+ await groupSelector.openDropDown();
+ await groupSelector.setValue('None');
+ await groupSelector.openDropDown();
await groupSelector.setValue('Resource');
// Filter bar uses the field's customLabel in the DataView
diff --git a/x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts b/x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts
index 8e569d27b8a4d..b0eacf3ff7297 100644
--- a/x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts
+++ b/x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts
@@ -19,6 +19,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
const resourceName1 = 'name-ng-1-Node';
const resourceName2 = 'othername-june12-8-8-0-1';
+ const cloudAccountName1 = 'elastic-security-cloud-security-dev';
+ const cloudAccountName2 = 'elastic-security-cloud-security-gcp';
+
+ const cloudProviderName1 = 'Amazon Web Services';
+ const cloudProviderName2 = 'Google Cloud Platform';
+
describe('Vulnerabilities Page - Grouping', function () {
this.tags(['cloud_security_posture_findings_grouping']);
let findings: typeof pageObjects.findings;
@@ -45,11 +51,89 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
describe('Default Grouping', async () => {
- it('groups vulnerabilities by resource and sort by compliance score desc', async () => {
- const groupSelector = await findings.groupSelector();
+ it('groups vulnerabilities by cloud account and sort by number of vulnerabilities desc', async () => {
+ const groupSelector = findings.groupSelector();
await groupSelector.openDropDown();
- await groupSelector.setValue('Resource');
+ await groupSelector.setValue('Cloud account');
+
+ const grouping = await findings.findingsGrouping();
+
+ const order = [
+ {
+ cloudAccountName: cloudAccountName1,
+ cloudProviderName: cloudProviderName1,
+ findingsCount: '1',
+ },
+ {
+ cloudAccountName: cloudAccountName2,
+ cloudProviderName: cloudProviderName2,
+ findingsCount: '1',
+ },
+ ];
+
+ await asyncForEach(
+ order,
+ async ({ cloudAccountName, cloudProviderName, findingsCount }, index) => {
+ const groupRow = await grouping.getRowAtIndex(index);
+ expect(await groupRow.getVisibleText()).to.contain(cloudAccountName);
+ expect(await groupRow.getVisibleText()).to.contain(cloudProviderName);
+
+ expect(
+ await (
+ await groupRow.findByTestSubject('vulnerabilities_grouping_counter')
+ ).getVisibleText()
+ ).to.be(findingsCount);
+ }
+ );
+
+ const groupCount = await grouping.getGroupCount();
+ expect(groupCount).to.be('2 groups');
+ const unitCount = await grouping.getUnitCount();
+ expect(unitCount).to.be('2 vulnerabilities');
+ });
+ it('groups vulnerabilities by CVE and sort by number of vulnerabilities desc', async () => {
+ const groupSelector = findings.groupSelector();
+ await groupSelector.openDropDown();
+ await groupSelector.setValue('CVE');
+
+ const grouping = await findings.findingsGrouping();
+
+ const order = [
+ {
+ name: vulnerabilitiesLatestMock[0].vulnerability.id,
+ description: vulnerabilitiesLatestMock[0].vulnerability.description,
+ findingsCount: '1',
+ },
+ {
+ name: vulnerabilitiesLatestMock[1].vulnerability.id,
+ description: vulnerabilitiesLatestMock[1].vulnerability.description,
+ findingsCount: '1',
+ },
+ ];
+
+ await asyncForEach(order, async ({ name, description, findingsCount }, index) => {
+ const groupRow = await grouping.getRowAtIndex(index);
+ expect(await groupRow.getVisibleText()).to.contain(name);
+ expect(await groupRow.getVisibleText()).to.contain(description);
+
+ expect(
+ await (
+ await groupRow.findByTestSubject('vulnerabilities_grouping_counter')
+ ).getVisibleText()
+ ).to.be(findingsCount);
+ });
+
+ const groupCount = await grouping.getGroupCount();
+ expect(groupCount).to.be('2 groups');
+
+ const unitCount = await grouping.getUnitCount();
+ expect(unitCount).to.be('2 vulnerabilities');
+ });
+ it('groups vulnerabilities by resource and sort by number of vulnerabilities desc', async () => {
+ const groupSelector = findings.groupSelector();
+ await groupSelector.openDropDown();
+ await groupSelector.setValue('Resource');
const grouping = await findings.findingsGrouping();
const resourceOrder = [
diff --git a/x-pack/test/examples/search_examples/partial_results_example.ts b/x-pack/test/examples/search_examples/partial_results_example.ts
index 269b2e79ab38f..83eb900ef0ff4 100644
--- a/x-pack/test/examples/search_examples/partial_results_example.ts
+++ b/x-pack/test/examples/search_examples/partial_results_example.ts
@@ -14,7 +14,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common']);
const retry = getService('retry');
- describe('Partial results example', () => {
+ // FLAKY: https://github.com/elastic/kibana/issues/175579
+ describe.skip('Partial results example', () => {
before(async () => {
await PageObjects.common.navigateToApp('searchExamples');
await testSubjects.click('/search');
diff --git a/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts b/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts
index 244bc0c9db6d7..6c93e3e6eb14d 100644
--- a/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts
+++ b/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts
@@ -105,12 +105,12 @@ export default function (providerContext: FtrProviderContext) {
});
await es.ingest.putPipeline({
- id: `logs-log@custom`,
+ id: `logs-log.integration@custom`,
processors: [
{
append: {
field: 'test',
- value: ['logs-log'],
+ value: ['logs-log.integration'],
},
},
],
@@ -138,7 +138,7 @@ export default function (providerContext: FtrProviderContext) {
id: 'logs@custom',
}),
es.ingest.deletePipeline({
- id: 'logs-log@custom',
+ id: 'logs-log.integration@custom',
}),
es.ingest.deletePipeline({
id: CUSTOM_PIPELINE,
@@ -158,7 +158,12 @@ export default function (providerContext: FtrProviderContext) {
id: res._id,
index: res._index,
});
- expect(doc._source?.test).be.eql(['global', 'logs', 'logs-log', 'logs-log.log']);
+ expect(doc._source?.test).be.eql([
+ 'global',
+ 'logs',
+ 'logs-log.integration',
+ 'logs-log.log',
+ ]);
});
});
});
diff --git a/x-pack/test/fleet_api_integration/apis/epm/data_stream.ts b/x-pack/test/fleet_api_integration/apis/epm/data_stream.ts
index a257ff97933d9..06a67a13e425c 100644
--- a/x-pack/test/fleet_api_integration/apis/epm/data_stream.ts
+++ b/x-pack/test/fleet_api_integration/apis/epm/data_stream.ts
@@ -41,46 +41,43 @@ export default function (providerContext: FtrProviderContext) {
skipIfNoDockerRegistry(providerContext);
setupFleetAndAgents(providerContext);
- const writeMetricsDoc = (namespace: string) =>
- es.transport.request(
- {
- method: 'POST',
- path: `/${metricsTemplateName}-${namespace}/_doc?refresh=true`,
- body: {
- '@timestamp': new Date().toISOString(),
- logs_test_name: 'test',
- data_stream: {
- dataset: `${pkgName}.test_metrics`,
- namespace,
- type: 'metrics',
- },
- },
- },
- { meta: true }
- );
-
- const writeLogsDoc = (namespace: string) =>
- es.transport.request(
- {
- method: 'POST',
- path: `/${logsTemplateName}-${namespace}/_doc?refresh=true`,
- body: {
- '@timestamp': new Date().toISOString(),
- logs_test_name: 'test',
- data_stream: {
- dataset: `${pkgName}.test_logs`,
- namespace,
- type: 'logs',
- },
- },
- },
- { meta: true }
- );
beforeEach(async () => {
await installPackage(pkgName, pkgVersion);
await Promise.all(
namespaces.map(async (namespace) => {
- return Promise.all([writeLogsDoc(namespace), writeMetricsDoc(namespace)]);
+ const createLogsRequest = es.transport.request(
+ {
+ method: 'POST',
+ path: `/${logsTemplateName}-${namespace}/_doc`,
+ body: {
+ '@timestamp': '2015-01-01',
+ logs_test_name: 'test',
+ data_stream: {
+ dataset: `${pkgName}.test_logs`,
+ namespace,
+ type: 'logs',
+ },
+ },
+ },
+ { meta: true }
+ );
+ const createMetricsRequest = es.transport.request(
+ {
+ method: 'POST',
+ path: `/${metricsTemplateName}-${namespace}/_doc`,
+ body: {
+ '@timestamp': '2015-01-01',
+ logs_test_name: 'test',
+ data_stream: {
+ dataset: `${pkgName}.test_metrics`,
+ namespace,
+ type: 'metrics',
+ },
+ },
+ },
+ { meta: true }
+ );
+ return Promise.all([createLogsRequest, createMetricsRequest]);
})
);
});
@@ -144,11 +141,7 @@ export default function (providerContext: FtrProviderContext) {
it('after update, it should have rolled over logs datastream because mappings are not compatible and not metrics', async function () {
await installPackage(pkgName, pkgUpdateVersion);
-
await asyncForEach(namespaces, async (namespace) => {
- // write doc as rollover is lazy
- await writeLogsDoc(namespace);
- await writeMetricsDoc(namespace);
const resLogsDatastream = await es.transport.request(
{
method: 'GET',
@@ -273,8 +266,6 @@ export default function (providerContext: FtrProviderContext) {
})
.expect(200);
- // Write a doc to trigger lazy rollover
- await writeLogsDoc('default');
// Datastream should have been rolled over
expect(await getLogsDefaultBackingIndicesLength()).to.be(2);
});
@@ -312,29 +303,26 @@ export default function (providerContext: FtrProviderContext) {
skipIfNoDockerRegistry(providerContext);
setupFleetAndAgents(providerContext);
- const writeMetricDoc = (body: any = {}) =>
- es.transport.request(
+ beforeEach(async () => {
+ await installPackage(pkgName, pkgVersion);
+
+ // Create a sample document so the data stream is created
+ await es.transport.request(
{
method: 'POST',
- path: `/${metricsTemplateName}-${namespace}/_doc?refresh=true`,
+ path: `/${metricsTemplateName}-${namespace}/_doc`,
body: {
- '@timestamp': new Date().toISOString(),
+ '@timestamp': '2015-01-01',
logs_test_name: 'test',
data_stream: {
dataset: `${pkgName}.test_logs`,
namespace,
type: 'logs',
},
- ...body,
},
},
{ meta: true }
);
- beforeEach(async () => {
- await installPackage(pkgName, pkgVersion);
-
- // Create a sample document so the data stream is created
- await writeMetricDoc();
});
afterEach(async () => {
@@ -352,10 +340,6 @@ export default function (providerContext: FtrProviderContext) {
it('rolls over data stream when index_mode: time_series is set in the updated package version', async () => {
await installPackage(pkgName, pkgUpdateVersion);
- // Write a doc so lazy rollover can happen
- await writeMetricDoc({
- some_field: 'test',
- });
const resMetricsDatastream = await es.transport.request(
{
method: 'GET',
diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_hidden_datastreams.ts b/x-pack/test/fleet_api_integration/apis/epm/install_hidden_datastreams.ts
index 2ec6fb92000e3..2fe976352944a 100644
--- a/x-pack/test/fleet_api_integration/apis/epm/install_hidden_datastreams.ts
+++ b/x-pack/test/fleet_api_integration/apis/epm/install_hidden_datastreams.ts
@@ -34,50 +34,46 @@ export default function (providerContext: FtrProviderContext) {
.send({ force: true })
.expect(200);
- const writeDoc = () =>
- es.index({
- refresh: true,
- index: 'metrics-apm.service_summary.10m-default',
- document: {
- '@timestamp': '2023-05-30T07:50:00.000Z',
- agent: {
+ await es.index({
+ index: 'metrics-apm.service_summary.10m-default',
+ document: {
+ '@timestamp': '2023-05-30T07:50:00.000Z',
+ agent: {
+ name: 'go',
+ },
+ data_stream: {
+ dataset: 'apm.service_summary.10m',
+ namespace: 'default',
+ type: 'metrics',
+ },
+ ecs: {
+ version: '8.6.0-dev',
+ },
+ event: {
+ agent_id_status: 'missing',
+ ingested: '2023-05-30T07:57:12Z',
+ },
+ metricset: {
+ interval: '10m',
+ name: 'service_summary',
+ },
+ observer: {
+ hostname: '047e282994fb',
+ type: 'apm-server',
+ version: '8.7.0',
+ },
+ processor: {
+ event: 'metric',
+ name: 'metric',
+ },
+ service: {
+ language: {
name: 'go',
},
- data_stream: {
- dataset: 'apm.service_summary.10m',
- namespace: 'default',
- type: 'metrics',
- },
- ecs: {
- version: '8.6.0-dev',
- },
- event: {
- agent_id_status: 'missing',
- ingested: '2023-05-30T07:57:12Z',
- },
- metricset: {
- interval: '10m',
- name: 'service_summary',
- },
- observer: {
- hostname: '047e282994fb',
- type: 'apm-server',
- version: '8.7.0',
- },
- processor: {
- event: 'metric',
- name: 'metric',
- },
- service: {
- language: {
- name: 'go',
- },
- name: '___main_elastic_cloud_87_ilm_fix',
- },
+ name: '___main_elastic_cloud_87_ilm_fix',
},
- });
-
- await writeDoc();
+ },
+ });
await supertest
.post(`/api/fleet/epm/packages/apm/8.8.0`)
@@ -85,8 +81,6 @@ export default function (providerContext: FtrProviderContext) {
.send({ force: true })
.expect(200);
- // Rollover are lazy need to write a new doc
- await writeDoc();
const ds = await es.indices.get({
index: 'metrics-apm.service_summary*',
expand_wildcards: ['open', 'hidden'],
diff --git a/x-pack/test/functional/apps/aiops/log_pattern_analysis_in_discover.ts b/x-pack/test/functional/apps/aiops/log_pattern_analysis_in_discover.ts
index d341ac4cf1b2a..66fbf83bb3c61 100644
--- a/x-pack/test/functional/apps/aiops/log_pattern_analysis_in_discover.ts
+++ b/x-pack/test/functional/apps/aiops/log_pattern_analysis_in_discover.ts
@@ -23,7 +23,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
}
- describe('log pattern analysis', async function () {
+ // FLAKY: https://github.com/elastic/kibana/issues/172770
+ describe.skip('log pattern analysis', async function () {
let tabsCount = 1;
afterEach(async () => {
diff --git a/x-pack/test/functional/apps/api_keys/home_page.ts b/x-pack/test/functional/apps/api_keys/home_page.ts
index 7eb37c4665554..a8ae7a540434d 100644
--- a/x-pack/test/functional/apps/api_keys/home_page.ts
+++ b/x-pack/test/functional/apps/api_keys/home_page.ts
@@ -192,7 +192,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
// Toggle metadata switch so the code editor shows up
await apiKeyMetadataSwitch.click();
- // Check default value of metadata and set value
+ // wait for monaco editor model to be updated
+ await pageObjects.common.sleep(300);
+
+ // Check default value of restrict privileges and set value
const restrictPrivilegesCodeEditorValue =
await pageObjects.apiKeys.getCodeEditorValueByIndex(0);
expect(restrictPrivilegesCodeEditorValue).to.be('{}');
diff --git a/x-pack/test/functional/apps/infra/hosts_view.ts b/x-pack/test/functional/apps/infra/hosts_view.ts
index fc1750e1867d5..671b5c3d70859 100644
--- a/x-pack/test/functional/apps/infra/hosts_view.ts
+++ b/x-pack/test/functional/apps/infra/hosts_view.ts
@@ -457,7 +457,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const ACTIVE_ALERTS = 6;
const RECOVERED_ALERTS = 4;
const ALL_ALERTS = ACTIVE_ALERTS + RECOVERED_ALERTS;
- const COLUMNS = 6;
+ const COLUMNS = 11;
before(async () => {
await browser.scrollTop();
@@ -574,7 +574,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const ACTIVE_ALERTS = 2;
const RECOVERED_ALERTS = 2;
const ALL_ALERTS = ACTIVE_ALERTS + RECOVERED_ALERTS;
- const COLUMNS = 6;
+ const COLUMNS = 11;
await pageObjects.infraHostsView.visitAlertTab();
diff --git a/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts b/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts
index 60078440ec2a1..0433b3a9762ce 100644
--- a/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts
+++ b/x-pack/test/functional/apps/observability_log_explorer/columns_selection.ts
@@ -9,7 +9,7 @@ import moment from 'moment/moment';
import { log, timerange } from '@kbn/apm-synthtrace-client';
import { FtrProviderContext } from './config';
-const defaultLogColumns = ['@timestamp', 'service.name', 'host.name', 'content'];
+const defaultLogColumns = ['@timestamp', 'resource', 'content'];
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
@@ -58,8 +58,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
mode: 'absolute',
},
columns: [
- { field: 'service.name' },
- { field: 'host.name' },
+ { field: 'resource' },
{ field: 'content' },
{ field: 'data_stream.namespace' },
],
@@ -78,7 +77,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('render content virtual column properly', async () => {
it('should render log level and log message when present', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(0, 5);
+ const cellElement = await dataGrid.getCellElement(0, 4);
const cellValue = await cellElement.getVisibleText();
expect(cellValue.includes('info')).to.be(true);
expect(cellValue.includes('A sample log')).to.be(true);
@@ -87,7 +86,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render log message when present and skip log level when missing', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(1, 5);
+ const cellElement = await dataGrid.getCellElement(1, 4);
const cellValue = await cellElement.getVisibleText();
expect(cellValue.includes('info')).to.be(false);
expect(cellValue.includes('A sample log')).to.be(true);
@@ -96,7 +95,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render message from error object when top level message not present', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(2, 5);
+ const cellElement = await dataGrid.getCellElement(2, 4);
const cellValue = await cellElement.getVisibleText();
expect(cellValue.includes('info')).to.be(true);
expect(cellValue.includes('error.message')).to.be(true);
@@ -106,7 +105,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render message from event.original when top level message and error.message not present', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(3, 5);
+ const cellElement = await dataGrid.getCellElement(3, 4);
const cellValue = await cellElement.getVisibleText();
expect(cellValue.includes('info')).to.be(true);
expect(cellValue.includes('event.original')).to.be(true);
@@ -116,7 +115,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render the whole JSON when neither message, error.message and event.original are present', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(4, 5);
+ const cellElement = await dataGrid.getCellElement(4, 4);
const cellValue = await cellElement.getVisibleText();
expect(cellValue.includes('info')).to.be(true);
@@ -132,7 +131,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('on cell expansion with no message field should open JSON Viewer', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- await dataGrid.clickCellExpandButton(4, 5);
+ await dataGrid.clickCellExpandButton(4, 4);
await testSubjects.existOrFail('dataTableExpandCellActionJsonPopover');
});
});
@@ -140,19 +139,30 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('on cell expansion with message field should open regular popover', async () => {
await navigateToLogExplorer();
await retry.tryForTime(TEST_TIMEOUT, async () => {
- await dataGrid.clickCellExpandButton(3, 5);
+ await dataGrid.clickCellExpandButton(3, 4);
await testSubjects.existOrFail('euiDataGridExpansionPopover');
});
});
});
+ describe('render resource virtual column properly', async () => {
+ it('should render service name and host name when present', async () => {
+ await retry.tryForTime(TEST_TIMEOUT, async () => {
+ const cellElement = await dataGrid.getCellElement(0, 3);
+ const cellValue = await cellElement.getVisibleText();
+ expect(cellValue.includes('synth-service')).to.be(true);
+ expect(cellValue.includes('synth-host')).to.be(true);
+ });
+ });
+ });
+
describe('virtual column cell actions', async () => {
beforeEach(async () => {
await navigateToLogExplorer();
});
it('should render a popover with cell actions when a chip on content column is clicked', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(0, 5);
+ const cellElement = await dataGrid.getCellElement(0, 4);
const logLevelChip = await cellElement.findByTestSubject(
'dataTablePopoverChip_log.level'
);
@@ -168,7 +178,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render the table filtered where log.level value is info when filter in action is clicked', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(0, 5);
+ const cellElement = await dataGrid.getCellElement(0, 4);
const logLevelChip = await cellElement.findByTestSubject(
'dataTablePopoverChip_log.level'
);
@@ -188,7 +198,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render the table filtered where log.level value is not info when filter out action is clicked', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(0, 5);
+ const cellElement = await dataGrid.getCellElement(0, 4);
const logLevelChip = await cellElement.findByTestSubject(
'dataTablePopoverChip_log.level'
);
@@ -203,6 +213,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.missingOrFail('dataTablePopoverChip_log.level');
});
});
+
+ it('should render the table filtered where service.name value is selected', async () => {
+ await retry.tryForTime(TEST_TIMEOUT, async () => {
+ const cellElement = await dataGrid.getCellElement(0, 3);
+ const serviceNameChip = await cellElement.findByTestSubject(
+ 'dataTablePopoverChip_service.name'
+ );
+ await serviceNameChip.click();
+
+ // Find Filter In button
+ const filterInButton = await testSubjects.find(
+ 'dataTableCellAction_addToFilterAction_service.name'
+ );
+
+ await filterInButton.click();
+ const rowWithLogLevelInfo = await testSubjects.findAll(
+ 'dataTablePopoverChip_service.name'
+ );
+
+ expect(rowWithLogLevelInfo.length).to.be(2);
+ });
+ });
});
});
}
@@ -215,7 +247,12 @@ function generateLogsData({ to, count = 1 }: { to: string; count?: number }) {
Array(count)
.fill(0)
.map(() => {
- return log.create().message('A sample log').logLevel('info').timestamp(timestamp);
+ return log
+ .create()
+ .message('A sample log')
+ .logLevel('info')
+ .timestamp(timestamp)
+ .defaults({ 'service.name': 'synth-service' });
})
);
@@ -229,7 +266,11 @@ function generateLogsData({ to, count = 1 }: { to: string; count?: number }) {
Array(count)
.fill(0)
.map(() => {
- return log.create().message('A sample log').timestamp(timestamp);
+ return log
+ .create()
+ .message('A sample log')
+ .timestamp(timestamp)
+ .defaults({ 'service.name': 'synth-service' });
})
);
@@ -243,11 +284,10 @@ function generateLogsData({ to, count = 1 }: { to: string; count?: number }) {
Array(count)
.fill(0)
.map(() => {
- return log
- .create()
- .logLevel('info')
- .timestamp(timestamp)
- .defaults({ 'error.message': 'message in error object' });
+ return log.create().logLevel('info').timestamp(timestamp).defaults({
+ 'error.message': 'message in error object',
+ 'service.name': 'node-service',
+ });
})
);
@@ -261,11 +301,10 @@ function generateLogsData({ to, count = 1 }: { to: string; count?: number }) {
Array(count)
.fill(0)
.map(() => {
- return log
- .create()
- .logLevel('info')
- .timestamp(timestamp)
- .defaults({ 'event.original': 'message in event original' });
+ return log.create().logLevel('info').timestamp(timestamp).defaults({
+ 'event.original': 'message in event original',
+ 'service.name': 'node-service',
+ });
})
);
diff --git a/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts b/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts
index 98cfc79c561ad..1d7eae0129ce6 100644
--- a/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts
+++ b/x-pack/test/functional/apps/observability_log_explorer/dataset_selector.ts
@@ -295,7 +295,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(nodes.length).to.be(20);
});
- cleanupAdditionalSetup();
+ await cleanupAdditionalSetup();
});
describe('clicking on integration and moving into the second navigation level', () => {
diff --git a/x-pack/test/functional/apps/observability_log_explorer/header_menu.ts b/x-pack/test/functional/apps/observability_log_explorer/header_menu.ts
index 44ea416d01596..f5b7deb645da3 100644
--- a/x-pack/test/functional/apps/observability_log_explorer/header_menu.ts
+++ b/x-pack/test/functional/apps/observability_log_explorer/header_menu.ts
@@ -69,8 +69,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await retry.try(async () => {
expect(await PageObjects.discover.getColumnHeaders()).to.eql([
'@timestamp',
- 'service.name',
- 'host.name',
+ 'resource',
'content',
]);
});
diff --git a/x-pack/test/functional/apps/security/doc_level_security_roles.ts b/x-pack/test/functional/apps/security/doc_level_security_roles.ts
index 56feb76394b61..d91a9d8f6e003 100644
--- a/x-pack/test/functional/apps/security/doc_level_security_roles.ts
+++ b/x-pack/test/functional/apps/security/doc_level_security_roles.ts
@@ -20,6 +20,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');
describe('dls', function () {
+ const customUserName = 'userEast';
+ const customRole = 'myroleEast';
+
before('initialize tests', async () => {
await kibanaServer.savedObjects.cleanStandardList();
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/security/dlstest');
@@ -33,8 +36,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.security.clickElasticsearchRoles();
});
- it('should add new role myroleEast', async function () {
- await PageObjects.security.addRole('myroleEast', {
+ it(`should add new role ${customRole}`, async function () {
+ await PageObjects.security.addRole(customRole, {
elasticsearch: {
indices: [
{
@@ -47,29 +50,29 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
const roles = keyBy(await PageObjects.security.getElasticsearchRoles(), 'rolename');
log.debug('actualRoles = %j', roles);
- expect(roles).to.have.key('myroleEast');
- expect(roles.myroleEast.reserved).to.be(false);
+ expect(roles).to.have.key(customRole);
+ expect(roles[customRole].reserved).to.be(false);
await screenshot.take('Security_Roles');
});
- it('should add new user userEAST ', async function () {
+ it(`should add new user ${customUserName}`, async function () {
await PageObjects.security.createUser({
- username: 'userEast',
+ username: customUserName,
password: 'changeme',
confirm_password: 'changeme',
full_name: 'dls EAST',
email: 'dlstest@elastic.com',
- roles: ['kibana_admin', 'myroleEast'],
+ roles: ['kibana_admin', customRole],
});
const users = keyBy(await PageObjects.security.getElasticsearchUsers(), 'username');
log.debug('actualUsers = %j', users);
- expect(users.userEast.roles).to.eql(['kibana_admin', 'myroleEast']);
- expect(users.userEast.reserved).to.be(false);
+ expect(users[customUserName].roles).to.eql(['kibana_admin', customRole]);
+ expect(users[customUserName].reserved).to.be(false);
});
it('user East should only see EAST doc', async function () {
await PageObjects.security.forceLogout();
- await PageObjects.security.login('userEast', 'changeme');
+ await PageObjects.security.login(customUserName, 'changeme');
await PageObjects.common.navigateToApp('discover');
await retry.try(async () => {
const hitCount = await PageObjects.discover.getHitCount();
@@ -82,8 +85,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
after('logout', async () => {
// NOTE: Logout needs to happen before anything else to avoid flaky behavior
await PageObjects.security.forceLogout();
- await security.user.delete('userEast');
- await security.role.delete('myroleEast');
+ await security.user.delete(customUserName);
+ await security.role.delete(customRole);
await security.testUser.restoreDefaults();
});
});
diff --git a/x-pack/test/functional/page_objects/security_page.ts b/x-pack/test/functional/page_objects/security_page.ts
index b80219544ef58..dc5ee34475ae6 100644
--- a/x-pack/test/functional/page_objects/security_page.ts
+++ b/x-pack/test/functional/page_objects/security_page.ts
@@ -326,10 +326,12 @@ export class SecurityPageObject extends FtrService {
await alert.accept();
}
- await this.retry.waitFor('URL redirects to finish', async () => {
+ // Timeout has been doubled here in attempt to quiet the flakiness
+ await this.retry.waitForWithTimeout('URL redirects to finish', 40000, async () => {
const urlBefore = await this.browser.getCurrentUrl();
await this.delay(1000);
const urlAfter = await this.browser.getCurrentUrl();
+ this.log.debug(`Expecting before URL '${urlBefore}' to equal after URL '${urlAfter}'`);
return urlAfter === urlBefore;
});
@@ -616,7 +618,11 @@ export class SecurityPageObject extends FtrService {
if (roleObj.elasticsearch.indices[0].query) {
await this.testSubjects.click('restrictDocumentsQuery0');
- await this.monacoEditor.setCodeEditorValue(roleObj.elasticsearch.indices[0].query);
+
+ await this.monacoEditor.typeCodeEditorValue(
+ roleObj.elasticsearch.indices[0].query,
+ 'kibanaCodeEditor'
+ );
}
await this.testSubjects.click('addSpacePrivilegeButton');
diff --git a/x-pack/test/functional/services/actions/tines.ts b/x-pack/test/functional/services/actions/tines.ts
index 183506752c22d..30856fb2d42e4 100644
--- a/x-pack/test/functional/services/actions/tines.ts
+++ b/x-pack/test/functional/services/actions/tines.ts
@@ -21,7 +21,7 @@ export function ActionsTinesServiceProvider(
common: ActionsCommon
) {
const testSubjects = getService('testSubjects');
- const find = getService('find');
+ const monacoEditor = getService('monacoEditor');
return {
async createNewConnector(fields: ConnectorFormFields) {
@@ -51,10 +51,7 @@ export function ActionsTinesServiceProvider(
async setJsonEditor(value: object) {
const stringified = JSON.stringify(value);
- await find.clickByCssSelector('.monaco-editor');
- const input = await find.activeElement();
- await input.clearValueWithKeyboard({ charByChar: true });
- await input.type(stringified);
+ await monacoEditor.setCodeEditorValue(stringified);
},
};
}
diff --git a/x-pack/test/functional/services/observability/alerts/common.ts b/x-pack/test/functional/services/observability/alerts/common.ts
index 617fadcf25e28..c4df13d80f675 100644
--- a/x-pack/test/functional/services/observability/alerts/common.ts
+++ b/x-pack/test/functional/services/observability/alerts/common.ts
@@ -159,8 +159,8 @@ export function ObservabilityAlertsCommonProvider({
};
// Flyout
- const openAlertsFlyout = retryOnStale.wrap(async () => {
- await openActionsMenuForRow(0);
+ const openAlertsFlyout = retryOnStale.wrap(async (index: number = 0) => {
+ await openActionsMenuForRow(index);
await testSubjects.click('viewAlertDetailsFlyout');
await retry.waitFor(
'flyout open',
diff --git a/x-pack/test/observability_functional/apps/observability/pages/alerts/index.ts b/x-pack/test/observability_functional/apps/observability/pages/alerts/index.ts
index ed82ba6d57c41..fa73bc8b10000 100644
--- a/x-pack/test/observability_functional/apps/observability/pages/alerts/index.ts
+++ b/x-pack/test/observability_functional/apps/observability/pages/alerts/index.ts
@@ -10,8 +10,8 @@ import { FtrProviderContext } from '../../../../ftr_provider_context';
import { asyncForEach } from '../../helpers';
const ACTIVE_ALERTS_CELL_COUNT = 78;
-const RECOVERED_ALERTS_CELL_COUNT = 180;
-const TOTAL_ALERTS_CELL_COUNT = 240;
+const RECOVERED_ALERTS_CELL_COUNT = 330;
+const TOTAL_ALERTS_CELL_COUNT = 440;
const DISABLED_ALERTS_CHECKBOX = 6;
const ENABLED_ALERTS_CHECKBOX = 4;
@@ -128,7 +128,7 @@ export default ({ getService }: FtrProviderContext) => {
describe('When open', async () => {
before(async () => {
- await observability.alerts.common.openAlertsFlyout();
+ await observability.alerts.common.openAlertsFlyout(20);
});
after(async () => {
diff --git a/x-pack/test/observability_functional/apps/observability/pages/alerts/state_synchronization.ts b/x-pack/test/observability_functional/apps/observability/pages/alerts/state_synchronization.ts
index 8f4bcbb237620..9711443fcbf84 100644
--- a/x-pack/test/observability_functional/apps/observability/pages/alerts/state_synchronization.ts
+++ b/x-pack/test/observability_functional/apps/observability/pages/alerts/state_synchronization.ts
@@ -61,7 +61,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await assertAlertsPageState({
kuery: '',
// workflowStatus: 'Open',
- timeRange: 'Last 15 minutes',
+ timeRange: 'Last 2 hours',
});
});
diff --git a/x-pack/test/observability_functional/apps/observability/pages/alerts/table_storage.ts b/x-pack/test/observability_functional/apps/observability/pages/alerts/table_storage.ts
index 5f96f9d707c7b..33a2c5e7bc44c 100644
--- a/x-pack/test/observability_functional/apps/observability/pages/alerts/table_storage.ts
+++ b/x-pack/test/observability_functional/apps/observability/pages/alerts/table_storage.ts
@@ -50,18 +50,22 @@ export default ({ getService, getPageObject }: FtrProviderContext) => {
it('remembers sorting changes', async () => {
await observability.alerts.common.navigateToTimeWithData();
- const timestampColumnButton = await testSubjects.find(
- 'dataGridHeaderCellActionButton-@timestamp'
+ const triggeredColumnButton = await testSubjects.find(
+ 'dataGridHeaderCellActionButton-kibana.alert.start'
+ );
+ await triggeredColumnButton.click();
+ const columnMenu = await testSubjects.find(
+ 'dataGridHeaderCellActionGroup-kibana.alert.start'
);
- await timestampColumnButton.click();
- const columnMenu = await testSubjects.find('dataGridHeaderCellActionGroup-@timestamp');
const sortButton = await columnMenu.findByCssSelector('[title="Sort Old-New"]');
await sortButton.click();
await observability.alerts.common.navigateToTimeWithData();
- const timestampColumnHeading = await testSubjects.find('dataGridHeaderCell-@timestamp');
- expect(await timestampColumnHeading.getAttribute('aria-sort')).to.be('ascending');
+ const triggeredColumnHeading = await testSubjects.find(
+ 'dataGridHeaderCell-kibana.alert.start'
+ );
+ expect(await triggeredColumnHeading.getAttribute('aria-sort')).to.be('ascending');
});
});
};
diff --git a/x-pack/test/security_solution_api_integration/package.json b/x-pack/test/security_solution_api_integration/package.json
index 4dc18852ec0e9..1e2b5e4c7a509 100644
--- a/x-pack/test/security_solution_api_integration/package.json
+++ b/x-pack/test/security_solution_api_integration/package.json
@@ -5,181 +5,199 @@
"private": true,
"license": "Elastic License 2.0",
"scripts": {
- "initialize-server:dr:default": "node ./scripts/index.js server detections_response default_license",
- "run-tests:dr:default": "node ./scripts/index.js runner detections_response default_license",
- "initialize-server:dr:basicEssentials": "node ./scripts/index.js server detections_response basic_essentials_license",
- "run-tests:dr:basicEssentials": "node ./scripts/index.js runner detections_response basic_essentials_license",
- "initialize-server:ea:default": "node ./scripts/index.js server entity_analytics default_license",
- "run-tests:ea:default": "node ./scripts/index.js runner entity_analytics default_license",
- "initialize-server:lists:default": "node ./scripts/index.js server lists_and_exception_lists default_license",
- "run-tests:lists:default": "node ./scripts/index.js runner lists_and_exception_lists default_license",
-
- "exception_workflows:server:serverless": "npm run initialize-server:dr:default exceptions/workflows serverless",
- "exception_workflows:runner:serverless": "npm run run-tests:dr:default exceptions/workflows serverless serverlessEnv",
- "exception_workflows:qa:serverless": "npm run run-tests:dr:default exceptions/workflows serverless qaEnv",
- "exception_workflows:server:ess": "npm run initialize-server:dr:default exceptions/workflows ess",
- "exception_workflows:runner:ess": "npm run run-tests:dr:default exceptions/workflows ess essEnv",
-
- "exception_operators_date_numeric_types:server:serverless": "npm run initialize-server:dr:default exceptions/operators_data_types/date_numeric_types serverless",
- "exception_operators_date_numeric_types:runner:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/date_numeric_types serverless serverlessEnv",
- "exception_operators_date_numeric_types:qa:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/date_numeric_types serverless qaEnv",
- "exception_operators_date_numeric_types:server:ess": "npm run initialize-server:dr:default exceptions/operators_data_types/date_numeric_types ess",
- "exception_operators_date_numeric_types:runner:ess": "npm run run-tests:dr:default exceptions/operators_data_types/date_numeric_types ess essEnv",
-
- "exception_operators_keyword:server:serverless": "npm run initialize-server:dr:default exceptions/operators_data_types/keyword serverless",
- "exception_operators_keyword:runner:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/keyword serverless serverlessEnv",
- "exception_operators_keyword:qa:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/keyword serverless qaEnv",
- "exception_operators_keyword:server:ess": "npm run initialize-server:dr:default exceptions/operators_data_types/keyword ess",
- "exception_operators_keyword:runner:ess": "npm run run-tests:dr:default exceptions/operators_data_types/keyword ess essEnv",
-
- "exception_operators_ips:server:serverless": "npm run initialize-server:dr:default exceptions/operators_data_types/ips serverless",
- "exception_operators_ips:runner:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/ips serverless serverlessEnv",
- "exception_operators_ips:qa:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/ips serverless qaEnv",
- "exception_operators_ips:server:ess": "npm run initialize-server:dr:default exceptions/operators_data_types/ips ess",
- "exception_operators_ips:runner:ess": "npm run run-tests:dr:default exceptions/operators_data_types/ips ess essEnv",
-
- "exception_operators_long:server:serverless": "npm run initialize-server:dr:default exceptions/operators_data_types/long serverless",
- "exception_operators_long:runner:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/long serverless serverlessEnv",
- "exception_operators_long:qa:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/long serverless qaEnv",
- "exception_operators_long:server:ess": "npm run initialize-server:dr:default exceptions/operators_data_types/long ess",
- "exception_operators_long:runner:ess": "npm run run-tests:dr:default exceptions/operators_data_types/long ess essEnv",
-
- "exception_operators_text:server:serverless": "npm run initialize-server:dr:default exceptions/operators_data_types/text serverless",
- "exception_operators_text:runner:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/text serverless serverlessEnv",
- "exception_operators_text:qa:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/text serverless qaEnv",
- "exception_operators_text:server:ess": "npm run initialize-server:dr:default exceptions/operators_data_types/text ess",
- "exception_operators_text:runner:ess": "npm run run-tests:dr:default exceptions/operators_data_types/text ess essEnv",
-
- "exception_operators_ips_text_array:server:serverless": "npm run initialize-server:dr:default exceptions/operators_data_types/ips_text_array serverless",
- "exception_operators_ips_text_array:runner:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/ips_text_array serverless serverlessEnv",
- "exception_operators_ips_text_array:qa:serverless": "npm run run-tests:dr:default exceptions/operators_data_types/ips_text_array serverless qaEnv",
- "exception_operators_ips_text_array:server:ess": "npm run initialize-server:dr:default exceptions/operators_data_types/ips_text_array ess",
- "exception_operators_ips_text_array:runner:ess": "npm run run-tests:dr:default exceptions/operators_data_types/ips_text_array ess essEnv",
-
- "actions:server:serverless": "npm run initialize-server:dr:default actions serverless",
- "actions:runner:serverless": "npm run run-tests:dr:default actions serverless serverlessEnv",
- "actions:qa:serverless": "npm run run-tests:dr:default actions serverless qaEnv",
- "actions:server:ess": "npm run initialize-server:dr:default actions ess",
- "actions:runner:ess": "npm run run-tests:dr:default actions ess essEnv",
-
- "alerts:server:serverless": "npm run initialize-server:dr:default alerts serverless",
- "alerts:runner:serverless": "npm run run-tests:dr:default alerts serverless serverlessEnv",
- "alerts:qa:serverless": "npm run run-tests:dr:default alerts serverless qaEnv",
- "alerts:server:ess": "npm run initialize-server:dr:default alerts ess",
- "alerts:runner:ess": "npm run run-tests:dr:default alerts ess essEnv",
-
- "entity_analytics:server:serverless": "npm run initialize-server:ea:default risk_engine serverless",
- "entity_analytics:runner:serverless": "npm run run-tests:ea:default risk_engine serverless serverlessEnv",
- "entity_analytics:qa:serverless": "npm run run-tests:ea:default risk_engine serverless qaEnv",
- "entity_analytics:server:ess": "npm run initialize-server:ea:default risk_engine ess",
- "entity_analytics:runner:ess": "npm run run-tests:ea:default risk_engine ess essEnv",
-
- "prebuilt_rules_management:server:serverless": "npm run initialize-server:dr:default prebuilt_rules/management serverless",
- "prebuilt_rules_management:runner:serverless": "npm run run-tests:dr:default prebuilt_rules/management serverless serverlessEnv",
- "prebuilt_rules_management:qa:serverless": "npm run run-tests:dr:default prebuilt_rules/management serverless qaEnv",
- "prebuilt_rules_management:server:ess": "npm run initialize-server:dr:default prebuilt_rules/management ess",
- "prebuilt_rules_management:runner:ess": "npm run run-tests:dr:default prebuilt_rules/management ess essEnv",
-
- "prebuilt_rules_bundled_prebuilt_rules_package:server:serverless": "npm run initialize-server:dr:default prebuilt_rules/bundled_prebuilt_rules_package serverless",
- "prebuilt_rules_bundled_prebuilt_rules_package:runner:serverless": "npm run run-tests:dr:default prebuilt_rules/bundled_prebuilt_rules_package serverless serverlessEnv",
- "prebuilt_rules_bundled_prebuilt_rules_package:qa:serverless": "npm run run-tests:dr:default prebuilt_rules/bundled_prebuilt_rules_package serverless qaEnv",
- "prebuilt_rules_bundled_prebuilt_rules_package:server:ess": "npm run initialize-server:dr:default prebuilt_rules/bundled_prebuilt_rules_package ess",
- "prebuilt_rules_bundled_prebuilt_rules_package:runner:ess": "npm run run-tests:dr:default prebuilt_rules/bundled_prebuilt_rules_package ess essEnv",
-
- "prebuilt_rules_large_prebuilt_rules_package:server:serverless": "npm run initialize-server:dr:default prebuilt_rules/large_prebuilt_rules_package serverless",
- "prebuilt_rules_large_prebuilt_rules_package:runner:serverless": "npm run run-tests:dr:default prebuilt_rules/large_prebuilt_rules_package serverless serverlessEnv",
- "prebuilt_rules_large_prebuilt_rules_package:qa:serverless": "npm run run-tests:dr:default prebuilt_rules/large_prebuilt_rules_package serverless qaEnv",
- "prebuilt_rules_large_prebuilt_rules_package:server:ess": "npm run initialize-server:dr:default prebuilt_rules/large_prebuilt_rules_package ess",
- "prebuilt_rules_large_prebuilt_rules_package:runner:ess": "npm run run-tests:dr:default prebuilt_rules/large_prebuilt_rules_package ess essEnv",
-
- "prebuilt_rules_update_prebuilt_rules_package:server:serverless": "npm run initialize-server:dr:default prebuilt_rules/update_prebuilt_rules_package serverless",
- "prebuilt_rules_update_prebuilt_rules_package:runner:serverless": "npm run run-tests:dr:default prebuilt_rules/update_prebuilt_rules_package serverless serverlessEnv",
- "prebuilt_rules_update_prebuilt_rules_package:qa:serverless": "npm run run-tests:dr:default prebuilt_rules/update_prebuilt_rules_package serverless qaEnv",
- "prebuilt_rules_update_prebuilt_rules_package:server:ess": "npm run initialize-server:dr:default prebuilt_rules/update_prebuilt_rules_package ess",
- "prebuilt_rules_update_prebuilt_rules_package:runner:ess": "npm run run-tests:dr:default prebuilt_rules/update_prebuilt_rules_package ess essEnv",
-
- "rule_execution_logic:server:serverless": "npm run initialize-server:dr:default rule_execution_logic serverless",
- "rule_execution_logic:runner:serverless": "npm run run-tests:dr:default rule_execution_logic serverless serverlessEnv",
- "rule_execution_logic:qa:serverless": "npm run run-tests:dr:default rule_execution_logic serverless qaEnv",
- "rule_execution_logic:server:ess": "npm run initialize-server:dr:default rule_execution_logic ess",
- "rule_execution_logic:runner:ess": "npm run run-tests:dr:default rule_execution_logic ess essEnv",
-
- "user_roles:server:serverless": "npm run initialize-server:dr:default user_roles serverless",
- "user_roles:runner:serverless": "npm run run-tests:dr:default user_roles serverless serverlessEnv",
- "user_roles:qa:serverless": "npm run run-tests:dr:default user_roles serverless qaEnv",
- "user_roles:server:ess": "npm run initialize-server:dr:default user_roles ess",
- "user_roles:runner:ess": "npm run run-tests:dr:default user_roles ess essEnv",
-
- "telemetry:server:serverless": "npm run initialize-server:dr:default telemetry serverless",
- "telemetry:runner:serverless": "npm run run-tests:dr:default telemetry serverless serverlessEnv",
- "telemetry:qa:serverless": "npm run run-tests:dr:default telemetry serverless qaEnv",
- "telemetry:server:ess": "npm run initialize-server:dr:default telemetry ess",
- "telemetry:runner:ess": "npm run run-tests:dr:default telemetry ess essEnv",
-
- "rule_creation:server:serverless": "npm run initialize-server:dr:default rule_creation serverless",
- "rule_creation:runner:serverless": "npm run run-tests:dr:default rule_creation serverless serverlessEnv",
- "rule_creation:qa:serverless": "npm run run-tests:dr:default rule_creation serverless qaEnv",
- "rule_creation:server:ess": "npm run initialize-server:dr:default rule_creation ess",
- "rule_creation:runner:ess": "npm run run-tests:dr:default rule_creation ess essEnv",
-
- "rule_delete:server:serverless": "npm run initialize-server:dr:default rule_delete serverless",
- "rule_delete:runner:serverless": "npm run run-tests:dr:default rule_delete serverless serverlessEnv",
- "rule_delete:qa:serverless": "npm run run-tests:dr:default rule_delete serverless qaEnv",
- "rule_delete:server:ess": "npm run initialize-server:dr:default rule_delete ess",
- "rule_delete:runner:ess": "npm run run-tests:dr:default rule_delete ess essEnv",
-
- "rule_update:server:serverless": "npm run initialize-server:dr:default rule_update serverless",
- "rule_update:runner:serverless": "npm run run-tests:dr:default rule_update serverless serverlessEnv",
- "rule_update:qa:serverless": "npm run run-tests:dr:default rule_update serverless qaEnv",
- "rule_update:server:ess": "npm run initialize-server:dr:default rule_update ess",
- "rule_update:runner:ess": "npm run run-tests:dr:default rule_update ess essEnv",
-
- "rule_patch:server:serverless": "npm run initialize-server:dr:default rule_patch serverless",
- "rule_patch:runner:serverless": "npm run run-tests:dr:default rule_patch serverless serverlessEnv",
- "rule_patch:qa:serverless": "npm run run-tests:dr:default rule_patch serverless qaEnv",
- "rule_patch:server:ess": "npm run initialize-server:dr:default rule_patch ess",
- "rule_patch:runner:ess": "npm run run-tests:dr:default rule_patch ess essEnv",
-
- "rule_import_export:server:serverless": "npm run initialize-server:dr:default rule_import_export serverless",
- "rule_import_export:runner:serverless": "npm run run-tests:dr:default rule_import_export serverless serverlessEnv",
- "rule_import_export:qa:serverless": "npm run run-tests:dr:default rule_import_export serverless qaEnv",
- "rule_import_export:server:ess": "npm run initialize-server:dr:default rule_import_export ess",
- "rule_import_export:runner:ess": "npm run run-tests:dr:default rule_import_export ess essEnv",
-
- "rule_management:server:serverless": "npm run initialize-server:dr:default rule_management serverless",
- "rule_management:runner:serverless": "npm run run-tests:dr:default rule_management serverless serverlessEnv",
- "rule_management:qa:serverless": "npm run run-tests:dr:default rule_management serverless qaEnv",
- "rule_management:server:ess": "npm run initialize-server:dr:default rule_management ess",
- "rule_management:runner:ess": "npm run run-tests:dr:default rule_management ess essEnv",
-
- "rule_bulk_actions:server:serverless": "npm run initialize-server:dr:default rule_bulk_actions serverless",
- "rule_bulk_actions:runner:serverless": "npm run run-tests:dr:default rule_bulk_actions serverless serverlessEnv",
- "rule_bulk_actions:qa:serverless": "npm run run-tests:dr:default rule_bulk_actions serverless qaEnv",
- "rule_bulk_actions:server:ess": "npm run initialize-server:dr:default rule_bulk_actions ess",
- "rule_bulk_actions:runner:ess": "npm run run-tests:dr:default rule_bulk_actions ess essEnv",
-
- "rule_read:server:serverless": "npm run initialize-server:dr:default rule_read serverless",
- "rule_read:runner:serverless": "npm run run-tests:dr:default rule_read serverless serverlessEnv",
- "rule_read:qa:serverless": "npm run run-tests:dr:default rule_read serverless qaEnv",
- "rule_read:server:ess": "npm run initialize-server:dr:default rule_read ess",
- "rule_read:runner:ess": "npm run run-tests:dr:default rule_read ess essEnv",
-
- "detection_engine:essentials:server:serverless": "npm run initialize-server:dr:essentials detection_engine serverless",
- "detection_engine:essentials:runner:serverless": "npm run run-tests:dr:essentials detection_engine serverless serverlessEnv",
- "detection_engine:essentials:qa:serverless": "npm run run-tests:dr:essentials detection_engine serverless qaEnv",
- "detection_engine:basic:server:ess": "npm run initialize-server:dr:basic detection:engine ess",
- "detection_engine:basic:runner:ess": "npm run run-tests:dr:basic detection_engine ess essEnv",
-
- "exception_lists_items:server:serverless": "npm run initialize-server:lists:default exception_lists_items serverless",
- "exception_lists_items:runner:serverless": "npm run run-tests:lists:default exception_lists_items serverless serverlessEnv",
- "exception_lists_items:qa:serverless": "npm run run-tests:lists:default exception_lists_items serverless qaEnv",
- "exception_lists_items:server:ess": "npm run initialize-server:lists:default exception_lists_items ess",
- "exception_lists_items:runner:ess": "npm run run-tests:lists:default exception_lists_items ess essEnv",
-
- "lists_items:server:serverless": "npm run initialize-server:lists:default lists_items serverless",
- "lists_items:runner:serverless": "npm run run-tests:lists:default lists_items serverless serverlessEnv",
- "lists_items:qa:serverless": "npm run run-tests:lists:default lists_items serverless qaEnv",
- "lists_items:server:ess": "npm run initialize-server:lists:default lists_items ess",
- "lists_items:runner:ess": "npm run run-tests:lists:default lists_items ess essEnv"
+ "initialize-server:ea": "node ./scripts/index.js server entity_analytics trial_license_complete_tier",
+ "run-tests:ea": "node ./scripts/index.js runner entity_analytics trial_license_complete_tier",
+
+ "initialize-server:dr": "node ./scripts/index.js server detections_response trial_license_complete_tier",
+ "run-tests:dr": "node ./scripts/index.js runner detections_response trial_license_complete_tier",
+
+ "initialize-server:de": "node ./scripts/index.js server detections_response/detection_engine trial_license_complete_tier",
+ "run-tests:de": "node ./scripts/index.js runner detections_response/detection_engine trial_license_complete_tier",
+
+ "initialize-server:de:basic_essentials": "node ./scripts/index.js server detections_response/detection_engine basic_license_essentials_tier",
+ "run-tests:de:basic_essentials": "node ./scripts/index.js runner detections_response/detection_engine basic_license_essentials_tier",
+
+ "initialize-server:rm": "node ./scripts/index.js server detections_response/rules_management trial_license_complete_tier ",
+ "run-tests:rm": "node ./scripts/index.js runner detections_response/rules_management trial_license_complete_tier",
+
+ "initialize-server:rm:basic_essentials": "node ./scripts/index.js server detections_response/rules_management basic_license_essentials_tier ",
+ "run-tests:rm:basic_essentials": "node ./scripts/index.js runner detections_response/rules_management basic_license_essentials_tier",
+
+ "initialize-server:lists:complete": "node ./scripts/index.js server lists_and_exception_lists trial_license_complete_tier",
+ "run-tests:lists:complete": "node ./scripts/index.js runner lists_and_exception_lists trial_license_complete_tier",
+
+ "entity_analytics:server:serverless": "npm run initialize-server:ea risk_engine serverless",
+ "entity_analytics:runner:serverless": "npm run run-tests:ea risk_engine serverless serverlessEnv",
+ "entity_analytics:qa:serverless": "npm run run-tests:ea risk_engine serverless qaEnv",
+ "entity_analytics:server:ess": "npm run initialize-server:ea risk_engine ess",
+ "entity_analytics:runner:ess": "npm run run-tests:ea risk_engine ess essEnv",
+
+ "exception_lists_items:server:serverless": "npm run initialize-server:lists:complete exception_lists_items serverless",
+ "exception_lists_items:runner:serverless": "npm run run-tests:lists:complete exception_lists_items serverless serverlessEnv",
+ "exception_lists_items:qa:serverless": "npm run run-tests:lists:complete exception_lists_items serverless qaEnv",
+ "exception_lists_items:server:ess": "npm run initialize-server:lists:complete exception_lists_items ess",
+ "exception_lists_items:runner:ess": "npm run run-tests:lists:complete exception_lists_items ess essEnv",
+
+ "lists_items:server:serverless": "npm run initialize-server:lists:complete lists_items serverless",
+ "lists_items:runner:serverless": "npm run run-tests:lists:complete lists_items serverless serverlessEnv",
+ "lists_items:qa:serverless": "npm run run-tests:lists:complete lists_items serverless qaEnv",
+ "lists_items:server:ess": "npm run initialize-server:lists:complete lists_items ess",
+ "lists_items:runner:ess": "npm run run-tests:lists:complete lists_items ess essEnv",
+
+ "user_roles:server:serverless": "npm run initialize-server:dr user_roles serverless",
+ "user_roles:runner:serverless": "npm run run-tests:dr user_roles serverless serverlessEnv",
+ "user_roles:qa:serverless": "npm run run-tests:dr user_roles serverless qaEnv",
+ "user_roles:server:ess": "npm run initialize-server:dr user_roles ess",
+ "user_roles:runner:ess": "npm run run-tests:dr user_roles ess essEnv",
+
+ "telemetry:server:serverless": "npm run initialize-server:dr telemetry serverless",
+ "telemetry:runner:serverless": "npm run run-tests:dr telemetry serverless serverlessEnv",
+ "telemetry:qa:serverless": "npm run run-tests:dr telemetry serverless qaEnv",
+ "telemetry:server:ess": "npm run initialize-server:dr telemetry ess",
+ "telemetry:runner:ess": "npm run run-tests:dr telemetry ess essEnv",
+
+ "exception_workflows:server:serverless": "npm run initialize-server:de exceptions/workflows serverless",
+ "exception_workflows:runner:serverless": "npm run run-tests:de exceptions/workflows serverless serverlessEnv",
+ "exception_workflows:qa:serverless": "npm run run-tests:de exceptions/workflows serverless qaEnv",
+ "exception_workflows:server:ess": "npm run initialize-server:de exceptions/workflows ess",
+ "exception_workflows:runner:ess": "npm run run-tests:de exceptions/workflows ess essEnv",
+
+ "exception_operators_date_numeric_types:server:serverless": "npm run initialize-server:de exceptions/operators_data_types/date_numeric_types serverless",
+ "exception_operators_date_numeric_types:runner:serverless": "npm run run-tests:de exceptions/operators_data_types/date_numeric_types serverless serverlessEnv",
+ "exception_operators_date_numeric_types:qa:serverless": "npm run run-tests:de exceptions/operators_data_types/date_numeric_types serverless qaEnv",
+ "exception_operators_date_numeric_types:server:ess": "npm run initialize-server:de exceptions/operators_data_types/date_numeric_types ess",
+ "exception_operators_date_numeric_types:runner:ess": "npm run run-tests:de exceptions/operators_data_types/date_numeric_types ess essEnv",
+
+ "exception_operators_keyword:server:serverless": "npm run initialize-server:de exceptions/operators_data_types/keyword serverless",
+ "exception_operators_keyword:runner:serverless": "npm run run-tests:de exceptions/operators_data_types/keyword serverless serverlessEnv",
+ "exception_operators_keyword:qa:serverless": "npm run run-tests:de exceptions/operators_data_types/keyword serverless qaEnv",
+ "exception_operators_keyword:server:ess": "npm run initialize-server:de exceptions/operators_data_types/keyword ess",
+ "exception_operators_keyword:runner:ess": "npm run run-tests:de exceptions/operators_data_types/keyword ess essEnv",
+
+ "exception_operators_ips:server:serverless": "npm run initialize-server:de exceptions/operators_data_types/ips serverless",
+ "exception_operators_ips:runner:serverless": "npm run run-tests:de exceptions/operators_data_types/ips serverless serverlessEnv",
+ "exception_operators_ips:qa:serverless": "npm run run-tests:de exceptions/operators_data_types/ips serverless qaEnv",
+ "exception_operators_ips:server:ess": "npm run initialize-server:de exceptions/operators_data_types/ips ess",
+ "exception_operators_ips:runner:ess": "npm run run-tests:de exceptions/operators_data_types/ips ess essEnv",
+
+ "exception_operators_long:server:serverless": "npm run initialize-server:de exceptions/operators_data_types/long serverless",
+ "exception_operators_long:runner:serverless": "npm run run-tests:de exceptions/operators_data_types/long serverless serverlessEnv",
+ "exception_operators_long:qa:serverless": "npm run run-tests:de exceptions/operators_data_types/long serverless qaEnv",
+ "exception_operators_long:server:ess": "npm run initialize-server:de exceptions/operators_data_types/long ess",
+ "exception_operators_long:runner:ess": "npm run run-tests:de exceptions/operators_data_types/long ess essEnv",
+
+ "exception_operators_text:server:serverless": "npm run initialize-server:de exceptions/operators_data_types/text serverless",
+ "exception_operators_text:runner:serverless": "npm run run-tests:de exceptions/operators_data_types/text serverless serverlessEnv",
+ "exception_operators_text:qa:serverless": "npm run run-tests:de exceptions/operators_data_types/text serverless qaEnv",
+ "exception_operators_text:server:ess": "npm run initialize-server:de exceptions/operators_data_types/text ess",
+ "exception_operators_text:runner:ess": "npm run run-tests:de exceptions/operators_data_types/text ess essEnv",
+
+ "actions:server:serverless": "npm run initialize-server:de actions serverless",
+ "actions:runner:serverless": "npm run run-tests:de actions serverless serverlessEnv",
+ "actions:qa:serverless": "npm run run-tests:de actions serverless qaEnv",
+ "actions:server:ess": "npm run initialize-server:de actions ess",
+ "actions:runner:ess": "npm run run-tests:de actions ess essEnv",
+
+ "alerts:server:serverless": "npm run initialize-server:de alerts serverless",
+ "alerts:runner:serverless": "npm run run-tests:de alerts serverless serverlessEnv",
+ "alerts:qa:serverless": "npm run run-tests:de alerts serverless qaEnv",
+ "alerts:server:ess": "npm run initialize-server:de alerts ess",
+ "alerts:runner:ess": "npm run run-tests:de alerts ess essEnv",
+
+ "alerts:essentials:server:serverless": "npm run initialize-server:de:basic_essentials alerts serverless",
+ "alerts:essentials:runner:serverless": "npm run run-tests:de:basic_essentials alerts serverless serverlessEnv",
+ "alerts:essentials:qa:serverless": "npm run run-tests:de:basic_essentials alerts serverless qaEnv",
+ "alerts:basic:server:ess": "npm run initialize-server:de:basic_essentials alerts ess",
+ "alerts:basic:runner:ess": "npm run run-tests:de:basic_essentials alerts ess essEnv",
+
+ "rule_execution_logic:server:serverless": "npm run initialize-server:de rule_execution_logic serverless",
+ "rule_execution_logic:runner:serverless": "npm run run-tests:de rule_execution_logic serverless serverlessEnv",
+ "rule_execution_logic:qa:serverless": "npm run run-tests:de rule_execution_logic serverless qaEnv",
+ "rule_execution_logic:server:ess": "npm run initialize-server:de rule_execution_logic ess",
+ "rule_execution_logic:runner:ess": "npm run run-tests:de rule_execution_logic ess essEnv",
+
+ "rule_creation:server:serverless": "npm run initialize-server:rm rule_creation serverless",
+ "rule_creation:runner:serverless": "npm run run-tests:rm rule_creation serverless serverlessEnv",
+ "rule_creation:qa:serverless": "npm run run-tests:rm rule_creation serverless qaEnv",
+ "rule_creation:server:ess": "npm run initialize-server:rm rule_creation ess",
+ "rule_creation:runner:ess": "npm run run-tests:rm rule_creation ess essEnv",
+
+ "rule_creation:essentials:server:serverless": "npm run initialize-server:rm:basic_essentials rule_creation serverless",
+ "rule_creation:essentials:runner:serverless": "npm run run-tests:rm:basic_essentials rule_creation serverless serverlessEnv",
+ "rule_creation:essentials:qa:serverless": "npm run run-tests:rm:basic_essentials rule_creation serverless qaEnv",
+ "rule_creation:basic:server:ess": "npm run initialize-server:rm:basic_essentials rule_creation ess",
+ "rule_creation:basic:runner:ess": "npm run run-tests:rm:basic_essentials rule_creation ess essEnv",
+
+ "rule_update:server:serverless": "npm run initialize-server:rm rule_update serverless",
+ "rule_update:runner:serverless": "npm run run-tests:rm rule_update serverless serverlessEnv",
+ "rule_update:qa:serverless": "npm run run-tests:rm rule_update serverless qaEnv",
+ "rule_update:server:ess": "npm run initialize-server:rm rule_update ess",
+ "rule_update:runner:ess": "npm run run-tests:rm rule_update ess essEnv",
+
+ "rule_patch:server:serverless": "npm run initialize-server:rm rule_patch serverless",
+ "rule_patch:runner:serverless": "npm run run-tests:rm rule_patch serverless serverlessEnv",
+ "rule_patch:qa:serverless": "npm run run-tests:rm rule_patch serverless qaEnv",
+ "rule_patch:server:ess": "npm run initialize-server:rm rule_patch ess",
+ "rule_patch:runner:ess": "npm run run-tests:rm rule_patch ess essEnv",
+
+ "prebuilt_rules_management:server:serverless": "npm run initialize-server:rm prebuilt_rules/management serverless",
+ "prebuilt_rules_management:runner:serverless": "npm run run-tests:rm prebuilt_rules/management serverless serverlessEnv",
+ "prebuilt_rules_management:qa:serverless": "npm run run-tests:rm prebuilt_rules/management serverless qaEnv",
+ "prebuilt_rules_management:server:ess": "npm run initialize-server:rm prebuilt_rules/management ess",
+ "prebuilt_rules_management:runner:ess": "npm run run-tests:rm prebuilt_rules/management ess essEnv",
+
+ "prebuilt_rules_bundled_prebuilt_rules_package:server:serverless": "npm run initialize-server:rm prebuilt_rules/bundled_prebuilt_rules_package serverless",
+ "prebuilt_rules_bundled_prebuilt_rules_package:runner:serverless": "npm run run-tests:rm prebuilt_rules/bundled_prebuilt_rules_package serverless serverlessEnv",
+ "prebuilt_rules_bundled_prebuilt_rules_package:qa:serverless": "npm run run-tests:rm prebuilt_rules/bundled_prebuilt_rules_package serverless qaEnv",
+ "prebuilt_rules_bundled_prebuilt_rules_package:server:ess": "npm run initialize-server:rm prebuilt_rules/bundled_prebuilt_rules_package ess",
+ "prebuilt_rules_bundled_prebuilt_rules_package:runner:ess": "npm run run-tests:rm prebuilt_rules/bundled_prebuilt_rules_package ess essEnv",
+
+ "prebuilt_rules_large_prebuilt_rules_package:server:serverless": "npm run initialize-server:rm prebuilt_rules/large_prebuilt_rules_package serverless",
+ "prebuilt_rules_large_prebuilt_rules_package:runner:serverless": "npm run run-tests:rm prebuilt_rules/large_prebuilt_rules_package serverless serverlessEnv",
+ "prebuilt_rules_large_prebuilt_rules_package:qa:serverless": "npm run run-tests:rm prebuilt_rules/large_prebuilt_rules_package serverless qaEnv",
+ "prebuilt_rules_large_prebuilt_rules_package:server:ess": "npm run initialize-server:rm prebuilt_rules/large_prebuilt_rules_package ess",
+ "prebuilt_rules_large_prebuilt_rules_package:runner:ess": "npm run run-tests:rm prebuilt_rules/large_prebuilt_rules_package ess essEnv",
+
+ "prebuilt_rules_update_prebuilt_rules_package:server:serverless": "npm run initialize-server:rm prebuilt_rules/update_prebuilt_rules_package serverless",
+ "prebuilt_rules_update_prebuilt_rules_package:runner:serverless": "npm run run-tests:rm prebuilt_rules/update_prebuilt_rules_package serverless serverlessEnv",
+ "prebuilt_rules_update_prebuilt_rules_package:qa:serverless": "npm run run-tests:rm prebuilt_rules/update_prebuilt_rules_package serverless qaEnv",
+ "prebuilt_rules_update_prebuilt_rules_package:server:ess": "npm run initialize-server:rm prebuilt_rules/update_prebuilt_rules_package ess",
+ "prebuilt_rules_update_prebuilt_rules_package:runner:ess": "npm run run-tests:rm prebuilt_rules/update_prebuilt_rules_package ess essEnv",
+
+ "rule_delete:server:serverless": "npm run initialize-server:rm rule_delete serverless",
+ "rule_delete:runner:serverless": "npm run run-tests:rm rule_delete serverless serverlessEnv",
+ "rule_delete:qa:serverless": "npm run run-tests:rm rule_delete serverless qaEnv",
+ "rule_delete:server:ess": "npm run initialize-server:rm rule_delete ess",
+ "rule_delete:runner:ess": "npm run run-tests:rm rule_delete ess essEnv",
+
+ "rule_import_export:server:serverless": "npm run initialize-server:rm rule_import_export serverless",
+ "rule_import_export:runner:serverless": "npm run run-tests:rm rule_import_export serverless serverlessEnv",
+ "rule_import_export:qa:serverless": "npm run run-tests:rm rule_import_export serverless qaEnv",
+ "rule_import_export:server:ess": "npm run initialize-server:rm rule_import_export ess",
+ "rule_import_export:runner:ess": "npm run run-tests:rm rule_import_export ess essEnv",
+
+ "rule_management:server:serverless": "npm run initialize-server:rm rule_management serverless",
+ "rule_management:runner:serverless": "npm run run-tests:rm rule_management serverless serverlessEnv",
+ "rule_management:qa:serverless": "npm run run-tests:rm rule_management serverless qaEnv",
+ "rule_management:server:ess": "npm run initialize-server:rm rule_management ess",
+ "rule_management:runner:ess": "npm run run-tests:rm rule_management ess essEnv",
+
+ "rule_bulk_actions:server:serverless": "npm run initialize-server:rm rule_bulk_actions serverless",
+ "rule_bulk_actions:runner:serverless": "npm run run-tests:rm rule_bulk_actions serverless serverlessEnv",
+ "rule_bulk_actions:qa:serverless": "npm run run-tests:rm rule_bulk_actions serverless qaEnv",
+ "rule_bulk_actions:server:ess": "npm run initialize-server:rm rule_bulk_actions ess",
+ "rule_bulk_actions:runner:ess": "npm run run-tests:rm rule_bulk_actions ess essEnv",
+
+ "rule_read:server:serverless": "npm run initialize-server:rm rule_read serverless",
+ "rule_read:runner:serverless": "npm run run-tests:rm rule_read serverless serverlessEnv",
+ "rule_read:qa:serverless": "npm run run-tests:rm rule_read serverless qaEnv",
+ "rule_read:server:ess": "npm run initialize-server:rm rule_read ess",
+ "rule_read:runner:ess": "npm run run-tests:rm rule_read ess essEnv",
+
+ "rules_management:essentials:server:serverless": "npm run initialize-server:rm:basic_essentials rule_management serverless",
+ "rules_management:essentials:runner:serverless": "npm run run-tests:rm:basic_essentials rule_management serverless serverlessEnv",
+ "rules_management:essentials:qa:serverless": "npm run run-tests:rm:basic_essentials rule_management serverless qaEnv",
+ "rules_management:basic:server:ess": "npm run initialize-server:rm:basic_essentials rule_management ess",
+ "rules_management:basic:runner:ess": "npm run run-tests:rm:basic_essentials rule_management ess essEnv"
}
}
diff --git a/x-pack/test/security_solution_api_integration/scripts/index.js b/x-pack/test/security_solution_api_integration/scripts/index.js
index 0b8514620ae75..c89421ee8feb4 100644
--- a/x-pack/test/security_solution_api_integration/scripts/index.js
+++ b/x-pack/test/security_solution_api_integration/scripts/index.js
@@ -7,9 +7,9 @@
const { spawn } = require('child_process');
-const [, , type, area, licenseFolder, folder, projectType, environment, ...args] = process.argv;
+const [, , type, area, licenseFolder, domain, projectType, environment, ...args] = process.argv;
-const configPath = `./test_suites/${area}/${licenseFolder}/${folder}/configs/${projectType}.config.ts`;
+const configPath = `./test_suites/${area}/${domain}/${licenseFolder}/configs/${projectType}.config.ts`;
const command =
type === 'server'
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/configs/serverless.config.ts
deleted file mode 100644
index c920ca94da57b..0000000000000
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/configs/serverless.config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { createTestConfig } from '../../../../../config/serverless/config.base.essentials';
-
-export default createTestConfig({
- testFiles: [require.resolve('..')],
- junit: {
- reportName: 'Detection Engine - Integration Tests - Serverless Env - Essentials License ',
- },
-});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/index.ts
deleted file mode 100644
index 296cec0e06448..0000000000000
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-import { FtrProviderContext } from '../../../../ftr_provider_context';
-
-export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Detection Engine Basic and Essentials API', function () {
- loadTestFile(require.resolve('./rules/create_rules'));
- loadTestFile(require.resolve('./rules/create_ml_rules_privileges'));
- loadTestFile(require.resolve('./alerts/open_close_alerts'));
- loadTestFile(require.resolve('./alerts/query_alerts'));
- loadTestFile(require.resolve('./alerts/query_alerts_backword_compatibility'));
- });
-}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/configs/serverless.config.ts
deleted file mode 100644
index 2e5b2f2b6ac69..0000000000000
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/configs/serverless.config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { createTestConfig } from '../../../../../config/serverless/config.base.essentials';
-
-export default createTestConfig({
- testFiles: [require.resolve('..')],
- junit: {
- reportName: 'Detection Engine Serverless/ Rule management API Integration Tests',
- },
-});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/index.ts
deleted file mode 100644
index 74959124978ae..0000000000000
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
-
-export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection Engine API - Large Prebuilt Rules Package', function () {
- loadTestFile(require.resolve('./install_large_prebuilt_rules_package'));
- });
-};
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/configs/serverless.config.ts
deleted file mode 100644
index 14da93e9eb6c2..0000000000000
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/configs/serverless.config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-import { createTestConfig } from '../../../../../config/serverless/config.base';
-
-export default createTestConfig({
- testFiles: [require.resolve('..')],
- junit: {
- reportName:
- 'Rules Management - Rule Bulk Actions Integration Tests - Serverless Env - Complete License',
- },
-});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/configs/ess.config.ts
deleted file mode 100644
index 3c8ba6dd0ba99..0000000000000
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/configs/ess.config.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { FtrConfigProviderContext } from '@kbn/test';
-
-export default async function ({ readConfigFile }: FtrConfigProviderContext) {
- const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.trial')
- );
-
- return {
- ...functionalConfig.getAll(),
- testFiles: [require.resolve('..')],
- junit: {
- reportName: 'Detection Engine - Rule Deletion Integration Tests - ESS Env - Trial License',
- },
- };
-}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/configs/serverless.config.ts
deleted file mode 100644
index 89f417d00f551..0000000000000
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/configs/serverless.config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-import { createTestConfig } from '../../../../../config/serverless/config.base';
-
-export default createTestConfig({
- testFiles: [require.resolve('..')],
- junit: {
- reportName:
- 'Detection Engine - Rule Deletion Integration Tests - Serverless Env - Complete License',
- },
-});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/add_actions.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/add_actions.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/add_actions.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/add_actions.ts
index 1e4b1692cf9fc..17a2b4af95cd7 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/add_actions.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/add_actions.ts
@@ -15,8 +15,8 @@ import {
getCustomQueryRuleParams,
createWebHookRuleAction,
fetchRule,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/check_privileges.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/check_privileges.ts
similarity index 96%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/check_privileges.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/check_privileges.ts
index cbcd75074b57c..b171542f28766 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/check_privileges.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/check_privileges.ts
@@ -18,13 +18,13 @@ import {
createRuleWithAuth,
getThresholdRuleForAlertTesting,
deleteAllAlerts,
-} from '../../utils';
+} from '../../../utils';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../common/services/security_solution';
+} from '../../../../../../common/services/security_solution';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/configs/ess.config.ts
similarity index 90%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/configs/ess.config.ts
index 883267119e173..983749d80a90e 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/configs/serverless.config.ts
similarity index 84%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/configs/serverless.config.ts
index 22a7c56a7c434..e5fc2471c6b18 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/configs/serverless.config.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { createTestConfig } from '../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/index.ts
similarity index 80%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/index.ts
index 4eb7f7eac6978..de9ae8e574492 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/index.ts
@@ -4,10 +4,10 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Actions API', function () {
+ describe('Actions APIs - Trial License/Complete Tier', function () {
loadTestFile(require.resolve('./add_actions'));
loadTestFile(require.resolve('./update_actions'));
loadTestFile(require.resolve('./migrations'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/migrations.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/migrations.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/migrations.ts
index be5503a1cef23..5fac090553731 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/migrations.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/migrations.ts
@@ -13,8 +13,8 @@ import {
getLegacyActionSOById,
getLegacyActionNotificationSOById,
getRuleSOById,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
/**
* @deprecated Once the legacy notification system is removed, remove this test too.
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/throttle.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/throttle.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/throttle.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/throttle.ts
index ee5d81b9f29fb..37b5b534b258c 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/throttle.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/throttle.ts
@@ -27,9 +27,9 @@ import {
getSimpleRule,
fetchRule,
updateRule,
-} from '../../utils';
+} from '../../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/update_actions.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/update_actions.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/update_actions.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/update_actions.ts
index 3b8689b47fcb8..156107fffe49a 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/update_actions.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/update_actions.ts
@@ -22,8 +22,8 @@ import {
ruleToUpdateSchema,
getCustomQueryRuleParams,
getPrebuiltRulesAndTimelinesStatus,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const es = getService('es');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/configs/ess.config.ts
similarity index 77%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/configs/ess.config.ts
index eaae21719c720..8e76335a4f361 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/configs/ess.config.ts
@@ -9,14 +9,14 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.basic')
+ require.resolve('../../../../../../config/ess/config.base.basic')
);
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('..')],
junit: {
- reportName: 'Detection Engine ESS/ Rule management API Integration Tests',
+ reportName: 'Detection Engine - Alert APIs Integration Tests - ESS Env - Basic License',
},
};
}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/configs/serverless.config.ts
new file mode 100644
index 0000000000000..529c7216f9581
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/configs/serverless.config.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { createTestConfig } from '../../../../../../config/serverless/config.base.essentials';
+
+export default createTestConfig({
+ testFiles: [require.resolve('..')],
+ junit: {
+ reportName:
+ 'Detection Engine - Alert APIs Integration Tests - Serverless Env - Essentials License ',
+ },
+});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/index.ts
new file mode 100644
index 0000000000000..e95da2122ea73
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/index.ts
@@ -0,0 +1,15 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
+
+export default function ({ loadTestFile }: FtrProviderContext) {
+ describe('Alerts APIs - Basic License/Essentials Tier', function () {
+ loadTestFile(require.resolve('./open_close_alerts'));
+ loadTestFile(require.resolve('./query_alerts_backword_compatibility'));
+ loadTestFile(require.resolve('./query_alerts'));
+ });
+}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/alerts/open_close_alerts.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/open_close_alerts.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/alerts/open_close_alerts.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/open_close_alerts.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/alerts/query_alerts.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/query_alerts.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/alerts/query_alerts.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/query_alerts.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/alerts/query_alerts_backword_compatibility.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/query_alerts_backword_compatibility.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/alerts/query_alerts_backword_compatibility.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/query_alerts_backword_compatibility.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/alerts_compatibility.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/alerts_compatibility.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/alerts_compatibility.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/alerts_compatibility.ts
index 1194a1f8df867..c9c5bd4d47914 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/alerts_compatibility.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/alerts_compatibility.ts
@@ -37,8 +37,8 @@ import {
waitForRuleSuccess,
waitForAlertsToBePresent,
removeRandomValuedPropertiesFromAlert,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/aliases.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/aliases.ts
similarity index 96%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/aliases.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/aliases.ts
index f62b2b62ebc5a..fc99b2a7bc301 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/aliases.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/aliases.ts
@@ -16,8 +16,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/assignments.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/assignments.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments.ts
index b520b505e0405..1832dffcc4fad 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/assignments.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments.ts
@@ -25,9 +25,9 @@ import {
setAlertAssignees,
waitForAlertsToBePresent,
waitForRuleSuccess,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../../es_archive_path_builder';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/assignments_ess.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments_ess.ts
similarity index 91%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/assignments_ess.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments_ess.ts
index 527d02295f6a0..a55e27f707df5 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/assignments_ess.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments_ess.ts
@@ -11,7 +11,7 @@ import { ROLES } from '@kbn/security-solution-plugin/common/test';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../../common/services/security_solution';
+} from '../../../../../../../common/services/security_solution';
import {
createAlertsIndex,
createRule,
@@ -22,9 +22,9 @@ import {
setAlertAssignees,
waitForAlertsToBePresent,
waitForRuleSuccess,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../../es_archive_path_builder';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/assignments_serverless.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments_serverless.ts
similarity index 95%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/assignments_serverless.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments_serverless.ts
index dd41574c56940..732399fe0bc7b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/assignments_serverless.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments_serverless.ts
@@ -18,9 +18,9 @@ import {
setAlertAssignees,
waitForAlertsToBePresent,
waitForRuleSuccess,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../../es_archive_path_builder';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/index.ts
similarity index 87%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/index.ts
index 401f92ea9dcf6..6f72889df7ef0 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/assignments/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/index.ts
@@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('Alert assignments API', function () {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/configs/ess.config.ts
similarity index 90%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/configs/ess.config.ts
index 94a2ae7368534..df001658f650d 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/configs/serverless.config.ts
similarity index 84%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/configs/serverless.config.ts
index b4d510ae05174..271f647cc1d4c 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/configs/serverless.config.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { createTestConfig } from '../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/create_index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/create_index.ts
similarity index 96%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/create_index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/create_index.ts
index 2de9bf74cb90b..d86d547c8e949 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/create_index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/create_index.ts
@@ -13,9 +13,9 @@ import {
import { SIGNALS_FIELD_ALIASES_VERSION } from '@kbn/security-solution-plugin/server/lib/detection_engine/routes/index/get_signals_template';
-import { deleteAllAlerts } from '../../utils';
+import { deleteAllAlerts } from '../../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/index.ts
similarity index 84%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/index.ts
index 81923173bf50c..d4838d19901b3 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/index.ts
@@ -4,10 +4,10 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Alerts API', function () {
+ describe('Alerts APIs - Trial License/Complete Tier', function () {
loadTestFile(require.resolve('./aliases'));
loadTestFile(require.resolve('./create_index'));
loadTestFile(require.resolve('./alerts_compatibility'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/create_alerts_migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/create_alerts_migrations.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/create_alerts_migrations.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/create_alerts_migrations.ts
index 5336d8bd6375e..b7cd04488fb52 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/create_alerts_migrations.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/create_alerts_migrations.ts
@@ -22,12 +22,12 @@ import {
deleteAllAlerts,
getIndexNameFromLoad,
waitForIndexToPopulate,
-} from '../../../utils';
+} from '../../../../utils';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../../common/services/security_solution';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+} from '../../../../../../../common/services/security_solution';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
interface CreateResponse {
index: string;
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/delete_alerts_migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/delete_alerts_migrations.ts
similarity index 94%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/delete_alerts_migrations.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/delete_alerts_migrations.ts
index 61a4250fceca4..a3c133992259f 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/delete_alerts_migrations.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/delete_alerts_migrations.ts
@@ -13,8 +13,13 @@ import {
DETECTION_ENGINE_SIGNALS_MIGRATION_URL,
} from '@kbn/security-solution-plugin/common/constants';
import { ROLES } from '@kbn/security-solution-plugin/common/test';
-import { createAlertsIndex, deleteAllAlerts, getIndexNameFromLoad, waitFor } from '../../../utils';
-import { createUserAndRole } from '../../../../../../common/services/security_solution';
+import {
+ createAlertsIndex,
+ deleteAllAlerts,
+ getIndexNameFromLoad,
+ waitFor,
+} from '../../../../utils';
+import { createUserAndRole } from '../../../../../../../common/services/security_solution';
interface CreateResponse {
index: string;
@@ -26,7 +31,7 @@ interface FinalizeResponse extends CreateResponse {
completed?: boolean;
error?: unknown;
}
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const es = getService('es');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/finalize_alerts_migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/finalize_alerts_migrations.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/finalize_alerts_migrations.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/finalize_alerts_migrations.ts
index 8fa340ba3046f..74fbb7099fbd9 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/finalize_alerts_migrations.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/finalize_alerts_migrations.ts
@@ -19,11 +19,11 @@ import {
deleteAllAlerts,
getIndexNameFromLoad,
waitFor,
-} from '../../../utils';
+} from '../../../../utils';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../../common/services/security_solution';
+} from '../../../../../../../common/services/security_solution';
interface StatusResponse {
index: string;
@@ -41,7 +41,7 @@ interface FinalizeResponse {
completed?: boolean;
error?: unknown;
}
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const esArchiver = getService('esArchiver');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/get_alerts_migration_status.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/get_alerts_migration_status.ts
similarity index 95%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/get_alerts_migration_status.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/get_alerts_migration_status.ts
index ca04f2ba75c74..2c4576caba4fc 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/get_alerts_migration_status.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/get_alerts_migration_status.ts
@@ -9,13 +9,13 @@ import expect from '@kbn/expect';
import { DETECTION_ENGINE_SIGNALS_MIGRATION_STATUS_URL } from '@kbn/security-solution-plugin/common/constants';
import { ROLES } from '@kbn/security-solution-plugin/common/test';
-import { createAlertsIndex, deleteAllAlerts, getIndexNameFromLoad } from '../../../utils';
+import { createAlertsIndex, deleteAllAlerts, getIndexNameFromLoad } from '../../../../utils';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../../common/services/security_solution';
+} from '../../../../../../../common/services/security_solution';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const esArchiver = getService('esArchiver');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/index.ts
similarity index 89%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/index.ts
index 115c8dbeab1f2..8ce9a269a3e4d 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/migrations/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/migrations/index.ts
@@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('Actions API', function () {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/open_close_alerts.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/open_close_alerts.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/open_close_alerts.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/open_close_alerts.ts
index 44718cc823529..2746a40f57dc5 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/open_close_alerts.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/open_close_alerts.ts
@@ -30,13 +30,13 @@ import {
waitForRuleSuccess,
getRuleForAlertTesting,
refreshIndex,
-} from '../../utils';
+} from '../../../utils';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../common/services/security_solution';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../es_archive_path_builder';
+} from '../../../../../../common/services/security_solution';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/query_alerts.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/query_alerts.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/query_alerts.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/query_alerts.ts
index 6e8e312f9075a..57d9a1cc0e9fe 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/query_alerts.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/query_alerts.ts
@@ -8,7 +8,7 @@
import expect from '@kbn/expect';
import { DETECTION_ENGINE_QUERY_SIGNALS_URL } from '@kbn/security-solution-plugin/common/constants';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
const roleToAccessSecuritySolution = {
name: 'sec_all_spaces',
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/set_alert_tags.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/set_alert_tags.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/set_alert_tags.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/set_alert_tags.ts
index 775a6da06d9d8..e1492b2f4b63d 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/set_alert_tags.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/set_alert_tags.ts
@@ -25,9 +25,9 @@ import {
waitForRuleSuccess,
getRuleForAlertTesting,
setAlertTags,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../es_archive_path_builder';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/configs/ess.config.ts
similarity index 90%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/configs/ess.config.ts
index 74bbb3e6fe9a8..e2a1fb7a5773a 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/configs/serverless.config.ts
similarity index 74%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/configs/serverless.config.ts
index 3e030f426d993..ef5d538b9983e 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/configs/serverless.config.ts
@@ -5,12 +5,12 @@
* 2.0.
*/
-import { createTestConfig } from '../../../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Detection Engine - Exception Operators Date & Numeric Types Integration Tests - Serverless Env - Complete License',
+ 'Detection Engine - Exception Operators Date & Numeric Types Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/date.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/date.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/date.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/date.ts
index c3cedb6daf88f..d060785e600c0 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/date.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/date.ts
@@ -12,7 +12,7 @@ import {
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../../lists_and_exception_lists/utils';
+} from '../../../../../../lists_and_exception_lists/utils';
import {
createRule,
createRuleWithExceptionEntries,
@@ -23,8 +23,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+} from '../../../../../utils';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/double.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/double.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/double.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/double.ts
index 9f2673b8542a3..a0a278ccc775e 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/double.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/double.ts
@@ -12,7 +12,7 @@ import {
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../../lists_and_exception_lists/utils';
+} from '../../../../../../lists_and_exception_lists/utils';
import {
createRule,
createRuleWithExceptionEntries,
@@ -23,8 +23,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+} from '../../../../../utils';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/float.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/float.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/float.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/float.ts
index 850276622cc6e..b25f13c027820 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/float.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/float.ts
@@ -12,7 +12,7 @@ import {
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../../lists_and_exception_lists/utils';
+} from '../../../../../../lists_and_exception_lists/utils';
import {
createRule,
createRuleWithExceptionEntries,
@@ -23,8 +23,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+} from '../../../../../utils';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/index.ts
similarity index 76%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/index.ts
index 966bcfa8f269a..cc98da2a1c89f 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/index.ts
@@ -4,10 +4,10 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection exceptions data and numeric types', function () {
+ describe('Detection Engine - Exceptions data and numeric types', function () {
loadTestFile(require.resolve('./date'));
loadTestFile(require.resolve('./double'));
loadTestFile(require.resolve('./float'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/integer.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/integer.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/integer.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/integer.ts
index fe26c4a2d729e..6b2803892ddc8 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/date_numeric_types/integer.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/integer.ts
@@ -12,7 +12,7 @@ import {
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../../lists_and_exception_lists/utils';
+} from '../../../../../../lists_and_exception_lists/utils';
import {
createRule,
createRuleWithExceptionEntries,
@@ -23,8 +23,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+} from '../../../../../utils';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/configs/ess.config.ts
similarity index 89%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/configs/ess.config.ts
index 966c0d58c57f3..7e32a2da4551f 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/configs/serverless.config.ts
new file mode 100644
index 0000000000000..dff4e5acb1bd8
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/configs/serverless.config.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { createTestConfig } from '../../../../../../../../config/serverless/config.base';
+
+export default createTestConfig({
+ testFiles: [require.resolve('..')],
+ junit: {
+ reportName:
+ 'Detection Engine - Exception Operators IP Types Integration Tests - Serverless Env - Complete Tier',
+ },
+});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/index.ts
similarity index 74%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/index.ts
index ae58fe9aa371b..02ef6d1e29c4c 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection exceptions IPs', function () {
+ describe('Detection Engine - Exceptions IPs', function () {
loadTestFile(require.resolve('./ip'));
loadTestFile(require.resolve('./ip_array'));
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/ip.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/ip.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/ip.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/ip.ts
index ca09070e46763..7fcb5b09103fe 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/ip.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/ip.ts
@@ -12,7 +12,7 @@ import {
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../../lists_and_exception_lists/utils';
+} from '../../../../../../lists_and_exception_lists/utils';
import {
createRule,
createRuleWithExceptionEntries,
@@ -23,8 +23,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+} from '../../../../../utils';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/ip_array.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/ip_array.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/ip_array.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/ip_array.ts
index 0c2808ee252a4..d65679ed93216 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/ip_array.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/ip_array.ts
@@ -12,7 +12,7 @@ import {
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../../lists_and_exception_lists/utils';
+} from '../../../../../../lists_and_exception_lists/utils';
import {
createRule,
createRuleWithExceptionEntries,
@@ -23,8 +23,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+} from '../../../../../utils';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/configs/ess.config.ts
similarity index 89%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/configs/ess.config.ts
index f58f354407f5f..a347d2e5634f6 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/configs/serverless.config.ts
similarity index 75%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/configs/serverless.config.ts
index f5093ce32ed63..0c7574bae6e0e 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/configs/serverless.config.ts
@@ -5,12 +5,12 @@
* 2.0.
*/
-import { createTestConfig } from '../../../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Detection Engine - Exception Operators Keyword Types Integration Tests - Serverless Env - Complete License',
+ 'Detection Engine - Exception Operators Keyword Types Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/index.ts
similarity index 74%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/index.ts
index 4325aa331f146..63ca94053761b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection exceptions Keyword', function () {
+ describe('Detection Engine - Exceptions Keyword', function () {
loadTestFile(require.resolve('./keyword'));
loadTestFile(require.resolve('./keyword_array'));
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/keyword.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/keyword.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/keyword.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/keyword.ts
index 9d4b1bfd80a19..f8896bf7a43e8 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/keyword.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/keyword.ts
@@ -12,7 +12,7 @@ import {
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../../lists_and_exception_lists/utils';
+} from '../../../../../../lists_and_exception_lists/utils';
import {
createRule,
createRuleWithExceptionEntries,
@@ -23,8 +23,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+} from '../../../../../utils';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/keyword_array.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/keyword_array.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/keyword_array.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/keyword_array.ts
index 284d20adfc3ee..54cbe4285c240 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/keyword/keyword_array.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/keyword_array.ts
@@ -12,7 +12,7 @@ import {
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../../lists_and_exception_lists/utils';
+} from '../../../../../../lists_and_exception_lists/utils';
import {
createRule,
@@ -24,8 +24,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+} from '../../../../../utils';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/configs/ess.config.ts
similarity index 89%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/configs/ess.config.ts
index e18b5debbcd51..45b835d2a4de7 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/configs/serverless.config.ts
similarity index 75%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/configs/serverless.config.ts
index 735bb46a9a6b0..2855c92ca239b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/configs/serverless.config.ts
@@ -5,12 +5,12 @@
* 2.0.
*/
-import { createTestConfig } from '../../../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Detection Engine - Exception Operators Long Types Integration Tests - Serverless Env - Complete License',
+ 'Detection Engine - Exception Operators Long Types Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/index.ts
similarity index 71%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/index.ts
index 2a1acd57cba39..d64d1f5b85936 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection exceptions long', function () {
+ describe('Detection Engine - Exceptions long type', function () {
loadTestFile(require.resolve('./long'));
});
};
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/long.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/long.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/long.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/long.ts
index 497f24ec217a8..c604789f802ad 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/long/long.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/long.ts
@@ -12,7 +12,7 @@ import {
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../../lists_and_exception_lists/utils';
+} from '../../../../../../lists_and_exception_lists/utils';
import {
createRule,
createRuleWithExceptionEntries,
@@ -23,8 +23,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+} from '../../../../../utils';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/configs/ess.config.ts
similarity index 89%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/configs/ess.config.ts
index c9774e4f590a5..f3b5a18bacaad 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/configs/serverless.config.ts
new file mode 100644
index 0000000000000..750d852361911
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/configs/serverless.config.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { createTestConfig } from '../../../../../../../../config/serverless/config.base';
+
+export default createTestConfig({
+ testFiles: [require.resolve('..')],
+ junit: {
+ reportName:
+ 'Detection Engine - Exception Operators Text Types Integration Tests - Serverless Env - Complete Tier',
+ },
+});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/index.ts
similarity index 73%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/index.ts
index 38354ffdcb365..e545e4d27f0b4 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection exceptions data types and operators', function () {
+ describe('Detection Engine - Exceptions Text Types', function () {
loadTestFile(require.resolve('./text_array'));
loadTestFile(require.resolve('./text'));
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/text.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/text.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/text.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/text.ts
index 8713cc8ce859c..537cfaf6ae991 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/text.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/text.ts
@@ -13,7 +13,7 @@ import {
deleteListsIndex,
importFile,
importTextFile,
-} from '../../../../../lists_and_exception_lists/utils';
+} from '../../../../../../lists_and_exception_lists/utils';
import {
createRule,
createRuleWithExceptionEntries,
@@ -24,8 +24,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+} from '../../../../../utils';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/text_array.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/text_array.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/text_array.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/text_array.ts
index 8c4a265a182bd..34835f27bdcc4 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/text_array.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/text_array.ts
@@ -12,7 +12,7 @@ import {
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../../lists_and_exception_lists/utils';
+} from '../../../../../../lists_and_exception_lists/utils';
import {
createRule,
createRuleWithExceptionEntries,
@@ -23,8 +23,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+} from '../../../../../utils';
+import { FtrProviderContext } from '../../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/configs/ess.config.ts
similarity index 90%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/configs/ess.config.ts
index 04bc56b399b77..e3d1852401d8c 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/configs/serverless.config.ts
similarity index 80%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/configs/serverless.config.ts
index 4ce0ff0d41059..0e664b489dd9a 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/ips/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/configs/serverless.config.ts
@@ -11,6 +11,6 @@ export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Detection Engine - Exception Operators IP Types Integration Tests - Serverless Env - Complete License',
+ 'Detection Engine - Exception Workflows Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/create_endpoint_exceptions.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/create_endpoint_exceptions.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/create_endpoint_exceptions.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/create_endpoint_exceptions.ts
index 0d908b7449126..e686675d808e2 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/create_endpoint_exceptions.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/create_endpoint_exceptions.ts
@@ -19,14 +19,14 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../utils';
+} from '../../../../utils';
import {
createListsIndex,
deleteAllExceptions,
deleteListsIndex,
-} from '../../../../lists_and_exception_lists/utils';
+} from '../../../../../lists_and_exception_lists/utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
interface Host {
os: {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/create_rule_exceptions.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/create_rule_exceptions.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/create_rule_exceptions.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/create_rule_exceptions.ts
index 85bfc549a3a34..bebe8b5a64c1b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/create_rule_exceptions.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/create_rule_exceptions.ts
@@ -28,12 +28,12 @@ import {
createRuleThroughAlertingEndpoint,
getRuleSavedObjectWithLegacyInvestigationFields,
checkInvestigationFieldSoValue,
-} from '../../../utils';
+} from '../../../../utils';
import {
deleteAllExceptions,
removeExceptionListItemServerGeneratedProperties,
-} from '../../../../lists_and_exception_lists/utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+} from '../../../../../lists_and_exception_lists/utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
const getRuleExceptionItemMock = (): CreateRuleExceptionListItemSchema => ({
description: 'Exception item for rule default exception list',
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/find_rule_exception_references.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/find_rule_exception_references.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/find_rule_exception_references.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/find_rule_exception_references.ts
index 87f9c4a17914b..c6c25cd0d8a7c 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/find_rule_exception_references.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/find_rule_exception_references.ts
@@ -20,7 +20,7 @@ import {
RuleReferencesSchema,
} from '@kbn/security-solution-plugin/common/api/detection_engine/rule_exceptions';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
import {
createRule,
@@ -29,8 +29,8 @@ import {
createExceptionList,
deleteAllAlerts,
createAlertsIndex,
-} from '../../../utils';
-import { deleteAllExceptions } from '../../../../lists_and_exception_lists/utils';
+} from '../../../../utils';
+import { deleteAllExceptions } from '../../../../../lists_and_exception_lists/utils';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/index.ts
similarity index 83%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/index.ts
index d42c92d7c09b5..729f941111d8f 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/index.ts
@@ -4,10 +4,10 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Exceptions API', function () {
+ describe('Detection Engine - Exception workflows APIs', function () {
loadTestFile(require.resolve('./create_rule_exceptions'));
loadTestFile(require.resolve('./create_rule_exceptions'));
loadTestFile(require.resolve('./role_based_rule_exceptions_workflows'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/role_based_add_edit_comments.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/role_based_add_edit_comments.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/role_based_add_edit_comments.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/role_based_add_edit_comments.ts
index 8e36816213cff..6535273cacb13 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/role_based_add_edit_comments.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/role_based_add_edit_comments.ts
@@ -18,12 +18,12 @@ import { getCreateExceptionListItemMinimalSchemaMock } from '@kbn/lists-plugin/c
import { ROLES } from '@kbn/security-solution-plugin/common/test';
import { getUpdateMinimalExceptionListItemSchemaMock } from '@kbn/lists-plugin/common/schemas/request/update_exception_list_item_schema.mock';
import { UpdateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
-import { deleteAllExceptions } from '../../../../lists_and_exception_lists/utils';
+import { deleteAllExceptions } from '../../../../../lists_and_exception_lists/utils';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../../common/services/security_solution';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+} from '../../../../../../../common/services/security_solution';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/role_based_rule_exceptions_workflows.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/role_based_rule_exceptions_workflows.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/role_based_rule_exceptions_workflows.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/role_based_rule_exceptions_workflows.ts
index e67d7d9f5fc1e..ef78015ef7715 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/role_based_rule_exceptions_workflows.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/role_based_rule_exceptions_workflows.ts
@@ -28,7 +28,7 @@ import { DETECTION_ENGINE_RULES_URL } from '@kbn/security-solution-plugin/common
import { ROLES } from '@kbn/security-solution-plugin/common/test';
import { ELASTIC_SECURITY_RULE_ID } from '@kbn/security-solution-plugin/common';
-import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
+import { EsArchivePathBuilder } from '../../../../../../es_archive_path_builder';
import {
createAlertsIndex,
fetchRule,
@@ -53,19 +53,19 @@ import {
SAMPLE_PREBUILT_RULES,
deleteAllAlerts,
updateUsername,
-} from '../../../utils';
+} from '../../../../utils';
import {
createListsIndex,
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../lists_and_exception_lists/utils';
+} from '../../../../../lists_and_exception_lists/utils';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../../common/services/security_solution';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+} from '../../../../../../../common/services/security_solution';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/rule_exception_synchronizations.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/rule_exception_synchronizations.ts
similarity index 96%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/rule_exception_synchronizations.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/rule_exception_synchronizations.ts
index 7bbfcf5659420..c584ec46f2ef1 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/rule_exception_synchronizations.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/rule_exception_synchronizations.ts
@@ -24,14 +24,14 @@ import {
createRuleWithExceptionEntries,
deleteAllRules,
createRule,
-} from '../../../utils';
+} from '../../../../utils';
import {
createListsIndex,
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../lists_and_exception_lists/utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+} from '../../../../../lists_and_exception_lists/utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/configs/ess.config.ts
similarity index 90%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/configs/ess.config.ts
index 392716ccea85b..58c11b8487baf 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/configs/serverless.config.ts
similarity index 87%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/configs/serverless.config.ts
index 0a425d6845878..68969be91f96f 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/configs/serverless.config.ts
@@ -4,13 +4,13 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { createTestConfig } from '../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Detection Engine - Rule Execution Logic Integration Tests - Serverless Env - Complete License',
+ 'Detection Engine - Rule Execution Logic Integration Tests - Serverless Env - Complete Tier',
},
kbnTestServerArgs: [
`--xpack.securitySolution.alertIgnoreFields=${JSON.stringify([
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/README.md b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/README.md
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/README.md
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/README.md
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/eql.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/eql.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/eql.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/eql.ts
index 3b2921f90dce2..0eddd53de4c90 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/eql.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/eql.ts
@@ -37,9 +37,9 @@ import {
getOpenAlerts,
getPreviewAlerts,
previewRule,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../../es_archive_path_builder';
/**
* Specific AGENT_ID to use for some of the tests. If the archiver changes and you see errors
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/esql.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/esql.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/esql.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/esql.ts
index caf649896abf3..643728fbd27c1 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/esql.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/esql.ts
@@ -25,9 +25,9 @@ import {
previewRuleWithExceptionEntries,
removeRandomValuedPropertiesFromAlert,
patchRule,
-} from '../../../utils';
-import { deleteAllExceptions } from '../../../../lists_and_exception_lists/utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+} from '../../../../utils';
+import { deleteAllExceptions } from '../../../../../lists_and_exception_lists/utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/index.ts
similarity index 85%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/index.ts
index f164857d9bd8f..ecd02362e2f70 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Execution logic', function () {
+ describe('Detection Engine - Execution logic', function () {
loadTestFile(require.resolve('./eql'));
loadTestFile(require.resolve('./esql'));
loadTestFile(require.resolve('./machine_learning'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/machine_learning.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/machine_learning.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/machine_learning.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/machine_learning.ts
index ad5f546d2fd6c..a7d12cc048244 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/machine_learning.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/machine_learning.ts
@@ -32,7 +32,7 @@ import {
deleteAllExceptions,
deleteListsIndex,
importFile,
-} from '../../../../lists_and_exception_lists/utils';
+} from '../../../../../lists_and_exception_lists/utils';
import {
createRule,
deleteAllRules,
@@ -43,9 +43,9 @@ import {
getPreviewAlerts,
previewRule,
previewRuleWithExceptionEntries,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../../es_archive_path_builder';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/new_terms.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/new_terms.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/new_terms.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/new_terms.ts
index aff5d52eeac94..5d1726e0cc1c7 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/new_terms.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/new_terms.ts
@@ -23,10 +23,10 @@ import {
dataGeneratorFactory,
previewRuleWithExceptionEntries,
removeRandomValuedPropertiesFromAlert,
-} from '../../../utils';
-import { deleteAllExceptions } from '../../../../lists_and_exception_lists/utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
+} from '../../../../utils';
+import { deleteAllExceptions } from '../../../../../lists_and_exception_lists/utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../../es_archive_path_builder';
const historicalWindowStart = '2022-10-13T05:00:04.000Z';
const ruleExecutionStart = '2022-10-19T05:00:04.000Z';
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/non_ecs_fields.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/non_ecs_fields.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/non_ecs_fields.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/non_ecs_fields.ts
index e452ffcfaf34e..01eb52dbc4901 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/non_ecs_fields.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/non_ecs_fields.ts
@@ -14,8 +14,8 @@ import {
previewRule,
dataGeneratorFactory,
enhanceDocument,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
const getQueryRule = (docIdToQuery: string) => ({
...getRuleForAlertTesting(['ecs_non_compliant']),
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/query.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/query.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/query.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/query.ts
index feabae41ebea1..060dfff2b20bc 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/query.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/query.ts
@@ -46,7 +46,7 @@ import {
} from '@kbn/security-solution-plugin/common/constants';
import { getMaxSignalsWarning as getMaxAlertsWarning } from '@kbn/security-solution-plugin/server/lib/detection_engine/rule_types/utils/utils';
import moment from 'moment';
-import { deleteAllExceptions } from '../../../../lists_and_exception_lists/utils';
+import { deleteAllExceptions } from '../../../../../lists_and_exception_lists/utils';
import {
createExceptionList,
createExceptionListItem,
@@ -64,10 +64,10 @@ import {
createRuleThroughAlertingEndpoint,
getRuleSavedObjectWithLegacyInvestigationFields,
dataGeneratorFactory,
-} from '../../../utils';
+} from '../../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../../es_archive_path_builder';
/**
* Specific _id to use for some of the tests. If the archiver changes and you see errors
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/saved_query.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/saved_query.ts
similarity index 94%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/saved_query.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/saved_query.ts
index c0a197e64f292..cc170182923f9 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/saved_query.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/saved_query.ts
@@ -22,9 +22,9 @@ import {
deleteAllAlerts,
getOpenAlerts,
getRuleForAlertTesting,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../../es_archive_path_builder';
/**
* Specific _id to use for some of the tests. If the archiver changes and you see errors
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/threat_match.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/threat_match.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/threat_match.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/threat_match.ts
index 7d97563f4c1b5..60215e58030dc 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/threat_match.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/threat_match.ts
@@ -44,9 +44,9 @@ import {
deleteAllAlerts,
deleteAllRules,
createRule,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../../es_archive_path_builder';
const format = (value: unknown): string => JSON.stringify(value, null, 2);
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/threshold.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/threshold.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/threshold.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/threshold.ts
index c13702f37bef5..71f25f48345b4 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/threshold.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/threshold.ts
@@ -30,9 +30,9 @@ import {
getPreviewAlerts,
getThresholdRuleForAlertTesting,
previewRule,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../../es_archive_path_builder';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/threshold_alert_suppression.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/threshold_alert_suppression.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/threshold_alert_suppression.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/threshold_alert_suppression.ts
index 39b012748930b..436e869937e5e 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/execution_logic/threshold_alert_suppression.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/execution_logic/threshold_alert_suppression.ts
@@ -32,8 +32,8 @@ import {
patchRule,
setAlertStatus,
dataGeneratorFactory,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/ignore_fields.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/ignore_fields.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/ignore_fields.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/ignore_fields.ts
index 6ddee1846067d..f4c49ba1434b1 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/ignore_fields.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/ignore_fields.ts
@@ -16,7 +16,7 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../utils';
+} from '../../../utils';
interface Ignore {
normal_constant?: string;
@@ -25,7 +25,7 @@ interface Ignore {
testing_regex?: string;
}
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
/**
* See the config file (config.ts) for which field values were added to be ignored
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/index.ts
similarity index 89%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/index.ts
index b497472e0b574..226d02c070dea 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/index.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('Rule execution logic API', function () {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/README.md b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/README.md
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/README.md
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/README.md
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/const_keyword.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/const_keyword.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/const_keyword.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/const_keyword.ts
index 0e3d01dc1ca22..bd19ea428a2d4 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/const_keyword.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/const_keyword.ts
@@ -23,8 +23,8 @@ import {
getThresholdRuleForAlertTesting,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/index.ts
similarity index 74%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/index.ts
index 7244085b6eff2..fda4ef53c990f 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection keyword family data types', function () {
+ describe('Detection Engine - Execution Logic - keyword family data types', function () {
loadTestFile(require.resolve('./keyword'));
loadTestFile(require.resolve('./const_keyword'));
loadTestFile(require.resolve('./keyword_mixed_with_const'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/keyword.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/keyword.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/keyword.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/keyword.ts
index 5a4dbf0929425..0edfd13a2e264 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/keyword.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/keyword.ts
@@ -24,8 +24,8 @@ import {
getThresholdRuleForAlertTesting,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/keyword_mixed_with_const.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/keyword_mixed_with_const.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/keyword_mixed_with_const.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/keyword_mixed_with_const.ts
index dd4310d4bb069..7f9c55a56c46b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/keyword_family/keyword_mixed_with_const.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/keyword_family/keyword_mixed_with_const.ts
@@ -22,8 +22,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../../utils';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+} from '../../../../utils';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/runtime.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/runtime.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/runtime.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/runtime.ts
index 7d9b772d1f5c5..20f2d08045c34 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/runtime.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/runtime.ts
@@ -17,8 +17,8 @@ import {
getAlertsById,
waitForRuleSuccess,
waitForAlertsToBePresent,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/timestamps.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/timestamps.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/timestamps.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/timestamps.ts
index 2a51b1da2e444..ba0c206c2f305 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_execution_logic/timestamps.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/timestamps.ts
@@ -26,9 +26,9 @@ import {
getAlertsByIds,
getEqlRuleForAlertTesting,
waitForRulePartialFailure,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../es_archive_path_builder';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts
similarity index 95%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts
index 68bfe2e9314b0..e50aff79a7b48 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts
@@ -15,7 +15,7 @@ export const BUNDLED_PACKAGE_DIR = path.join(
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts
similarity index 92%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts
index 492c3c13870c6..2930438a76a0d 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts
@@ -6,7 +6,7 @@
*/
import path from 'path';
-import { createTestConfig } from '../../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../../config/serverless/config.base';
export const BUNDLED_PACKAGE_DIR = path.join(
path.dirname(__filename),
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/fleet_bundled_packages/fixtures/security_detection_engine-99.0.0.zip b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/fleet_bundled_packages/fixtures/security_detection_engine-99.0.0.zip
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/fleet_bundled_packages/fixtures/security_detection_engine-99.0.0.zip
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/fleet_bundled_packages/fixtures/security_detection_engine-99.0.0.zip
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/fleet_bundled_packages/fixtures/security_detection_engine-99.0.1-beta.1.zip b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/fleet_bundled_packages/fixtures/security_detection_engine-99.0.1-beta.1.zip
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/fleet_bundled_packages/fixtures/security_detection_engine-99.0.1-beta.1.zip
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/fleet_bundled_packages/fixtures/security_detection_engine-99.0.1-beta.1.zip
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/index.ts
similarity index 73%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/index.ts
index 6d1e677426b32..faeda80e35f77 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection Engine API - Bundled Prebuilt Rules Package', function () {
+ describe('Rules Management - Prebuilt Rules - Bundled Prebuilt Rules Package', function () {
loadTestFile(require.resolve('./install_latest_bundled_prebuilt_rules'));
loadTestFile(require.resolve('./prerelease_packages'));
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/install_latest_bundled_prebuilt_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/install_latest_bundled_prebuilt_rules.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/install_latest_bundled_prebuilt_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/install_latest_bundled_prebuilt_rules.ts
index 33f79b1bff8d7..32eb1d3dbdf01 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/install_latest_bundled_prebuilt_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/install_latest_bundled_prebuilt_rules.ts
@@ -11,13 +11,13 @@ import JSON5 from 'json5';
import expect from 'expect';
import { PackageSpecManifest } from '@kbn/fleet-plugin/common';
import { ALL_SAVED_OBJECT_INDICES } from '@kbn/core-saved-objects-server';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
import {
deleteAllRules,
deleteAllPrebuiltRuleAssets,
getPrebuiltRulesStatus,
installPrebuiltRulesPackageByVersion,
-} from '../../../utils';
+} from '../../../../utils';
export default ({ getService }: FtrProviderContext): void => {
const es = getService('es');
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/prerelease_packages.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/prerelease_packages.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/prerelease_packages.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/prerelease_packages.ts
index 83faf92bf7c84..dcafdf8eaf1a7 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/bundled_prebuilt_rules_package/prerelease_packages.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/bundled_prebuilt_rules_package/trial_license_complete_tier/prerelease_packages.ts
@@ -6,7 +6,7 @@
*/
import expect from 'expect';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
import {
deleteAllPrebuiltRuleAssets,
deleteAllRules,
@@ -16,7 +16,7 @@ import {
getPrebuiltRulesStatus,
installPrebuiltRules,
installPrebuiltRulesPackageViaFleetAPI,
-} from '../../../utils';
+} from '../../../../utils';
export default ({ getService }: FtrProviderContext): void => {
const es = getService('es');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts
similarity index 96%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts
index 2d96db1382f35..d4ef8795c8894 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts
@@ -15,7 +15,7 @@ export const BUNDLED_PACKAGE_DIR = path.join(
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts
similarity index 94%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts
index 89bd5f723a9fe..e6ecd5825e98b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts
@@ -6,7 +6,7 @@
*/
import path from 'path';
-import { createTestConfig } from '../../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../../config/serverless/config.base';
export const BUNDLED_PACKAGE_DIR = path.join(
path.dirname(__filename),
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/fleet_bundled_packages/fixtures/security_detection_engine-100.0.0.zip b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/fleet_bundled_packages/fixtures/security_detection_engine-100.0.0.zip
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/fleet_bundled_packages/fixtures/security_detection_engine-100.0.0.zip
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/fleet_bundled_packages/fixtures/security_detection_engine-100.0.0.zip
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/index.ts
new file mode 100644
index 0000000000000..8a43cdafeb3e6
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/index.ts
@@ -0,0 +1,14 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+
+export default ({ loadTestFile }: FtrProviderContext): void => {
+ describe('Rules Management - Prebuilt Rules - Large Prebuilt Rules Package', function () {
+ loadTestFile(require.resolve('./install_large_prebuilt_rules_package'));
+ });
+};
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/install_large_prebuilt_rules_package.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/install_large_prebuilt_rules_package.ts
similarity index 95%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/install_large_prebuilt_rules_package.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/install_large_prebuilt_rules_package.ts
index 17a6723a53b88..0b625e7bbb82e 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/large_prebuilt_rules_package/install_large_prebuilt_rules_package.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/install_large_prebuilt_rules_package.ts
@@ -5,13 +5,13 @@
* 2.0.
*/
import expect from 'expect';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
import {
deleteAllPrebuiltRuleAssets,
deleteAllRules,
getPrebuiltRulesAndTimelinesStatus,
installPrebuiltRulesAndTimelines,
-} from '../../../utils';
+} from '../../../../utils';
export default ({ getService }: FtrProviderContext): void => {
const es = getService('es');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/configs/ess.config.ts
similarity index 90%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/configs/ess.config.ts
index eebdce7697d3c..4017401095358 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/configs/serverless.config.ts
similarity index 84%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/configs/serverless.config.ts
index 91836b3997774..ac06cacf21f63 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/configs/serverless.config.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
-import { createTestConfig } from '../../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/fleet_integration.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/fleet_integration.ts
similarity index 83%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/fleet_integration.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/fleet_integration.ts
index a9653d7593209..1233af5c33f6a 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/fleet_integration.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/fleet_integration.ts
@@ -5,16 +5,16 @@
* 2.0.
*/
import expect from 'expect';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
import {
deleteAllRules,
getPrebuiltRulesAndTimelinesStatus,
installPrebuiltRulesAndTimelines,
-} from '../../../utils';
-import { deleteAllPrebuiltRuleAssets } from '../../../utils/rules/prebuilt_rules/delete_all_prebuilt_rule_assets';
-import { deleteAllTimelines } from '../../../utils/rules/prebuilt_rules/delete_all_timelines';
-import { deletePrebuiltRulesFleetPackage } from '../../../utils/rules/prebuilt_rules/delete_prebuilt_rules_fleet_package';
-import { installPrebuiltRulesFleetPackage } from '../../../utils/rules/prebuilt_rules/install_prebuilt_rules_fleet_package';
+} from '../../../../utils';
+import { deleteAllPrebuiltRuleAssets } from '../../../../utils/rules/prebuilt_rules/delete_all_prebuilt_rule_assets';
+import { deleteAllTimelines } from '../../../../utils/rules/prebuilt_rules/delete_all_timelines';
+import { deletePrebuiltRulesFleetPackage } from '../../../../utils/rules/prebuilt_rules/delete_prebuilt_rules_fleet_package';
+import { installPrebuiltRulesFleetPackage } from '../../../../utils/rules/prebuilt_rules/install_prebuilt_rules_fleet_package';
export default ({ getService }: FtrProviderContext): void => {
const es = getService('es');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/get_prebuilt_rules_status.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/get_prebuilt_rules_status.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/get_prebuilt_rules_status.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/get_prebuilt_rules_status.ts
index eca4e51bcc6f8..5f39065263afb 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/get_prebuilt_rules_status.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/get_prebuilt_rules_status.ts
@@ -6,7 +6,7 @@
*/
import expect from 'expect';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
import {
deleteAllPrebuiltRuleAssets,
deleteAllRules,
@@ -21,7 +21,7 @@ import {
createHistoricalPrebuiltRuleAssetSavedObjects,
getPrebuiltRulesAndTimelinesStatus,
installPrebuiltRulesAndTimelines,
-} from '../../../utils';
+} from '../../../../utils';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/get_prebuilt_timelines_status.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/get_prebuilt_timelines_status.ts
similarity index 93%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/get_prebuilt_timelines_status.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/get_prebuilt_timelines_status.ts
index 60b1e5e1ba526..f0311154a900b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/get_prebuilt_timelines_status.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/get_prebuilt_timelines_status.ts
@@ -6,12 +6,12 @@
*/
import expect from 'expect';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
import {
deleteAllTimelines,
getPrebuiltRulesAndTimelinesStatus,
installPrebuiltRulesAndTimelines,
-} from '../../../utils';
+} from '../../../../utils';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/index.ts
similarity index 78%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/index.ts
index 52a745e0e7975..16c37cd09eb5b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection Engine API - Prebuilt Rules Management', function () {
+ describe('Rules Management - Prebuilt Rules - Prebuilt Rules Management', function () {
loadTestFile(require.resolve('./get_prebuilt_rules_status'));
loadTestFile(require.resolve('./get_prebuilt_timelines_status'));
loadTestFile(require.resolve('./install_and_upgrade_prebuilt_rules'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/install_and_upgrade_prebuilt_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/install_and_upgrade_prebuilt_rules.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/install_and_upgrade_prebuilt_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/install_and_upgrade_prebuilt_rules.ts
index 4e7ea364f0968..c3d39c532f9ca 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/management/install_and_upgrade_prebuilt_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/install_and_upgrade_prebuilt_rules.ts
@@ -5,7 +5,7 @@
* 2.0.
*/
import expect from 'expect';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
import {
deleteAllRules,
deleteAllTimelines,
@@ -20,7 +20,7 @@ import {
installPrebuiltRules,
getInstalledRules,
upgradePrebuiltRules,
-} from '../../../utils';
+} from '../../../../utils';
export default ({ getService }: FtrProviderContext): void => {
const es = getService('es');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts
similarity index 90%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts
index 23b22b80b8573..2198f4e6fa0df 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts
similarity index 79%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts
index c7a7beb13099d..181c938ad734a 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/operators_data_types/text/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts
@@ -11,6 +11,6 @@ export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Detection Engine - Exception Operators Text Types Integration Tests - Serverless Env - Complete License',
+ 'Rules Management - Update Prebuilt Rules Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/index.ts
new file mode 100644
index 0000000000000..61c3437518100
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/index.ts
@@ -0,0 +1,14 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
+
+export default ({ loadTestFile }: FtrProviderContext): void => {
+ describe('Rules Management - Prebuilt Rules - Update Prebuilt Rules Package', function () {
+ loadTestFile(require.resolve('./update_prebuilt_rules_package'));
+ });
+};
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/update_prebuilt_rules_package.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/update_prebuilt_rules_package.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/update_prebuilt_rules_package.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/update_prebuilt_rules_package.ts
index 688816569c181..11577bec1b5c7 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/update_prebuilt_rules_package.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/update_prebuilt_rules_package.ts
@@ -12,7 +12,7 @@ import { REPO_ROOT } from '@kbn/repo-info';
import JSON5 from 'json5';
import expect from 'expect';
import { PackageSpecManifest } from '@kbn/fleet-plugin/common';
-import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../../ftr_provider_context';
import {
deleteAllPrebuiltRuleAssets,
deleteAllRules,
@@ -23,7 +23,7 @@ import {
upgradePrebuiltRules,
reviewPrebuiltRulesToInstall,
reviewPrebuiltRulesToUpgrade,
-} from '../../../utils';
+} from '../../../../utils';
export default ({ getService }: FtrProviderContext): void => {
const es = getService('es');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/ess.config.ts
similarity index 90%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/ess.config.ts
index 1519833895210..9eec3d09f1e8c 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/serverless.config.ts
similarity index 80%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/serverless.config.ts
index c05eef46de73b..324ecf1a00a79 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/serverless.config.ts
@@ -4,13 +4,12 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-
import { createTestConfig } from '../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Rules Management - Update Prebuilt Rules Integration Tests - Serverless Env - Complete License',
+ 'Rules Management - Rule Bulk Actions Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/index.ts
similarity index 80%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/index.ts
index 87022ecd347aa..1175734e78871 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Rule Bulk Action API', function () {
+ describe('Rules Management - Rule Bulk Action API', function () {
loadTestFile(require.resolve('./perform_bulk_action_dry_run'));
loadTestFile(require.resolve('./perform_bulk_action_dry_run_ess'));
loadTestFile(require.resolve('./perform_bulk_action'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action.ts
index 2c3a0570ea51a..04e895290c555 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action.ts
@@ -33,10 +33,10 @@ import {
installMockPrebuiltRules,
removeServerGeneratedProperties,
updateUsername,
-} from '../../utils';
-import { deleteAllExceptions } from '../../../lists_and_exception_lists/utils';
+} from '../../../utils';
+import { deleteAllExceptions } from '../../../../lists_and_exception_lists/utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_dry_run.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action_dry_run.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_dry_run.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action_dry_run.ts
index 216d00533e100..ad88064d1d2fe 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_dry_run.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action_dry_run.ts
@@ -22,8 +22,8 @@ import {
getSimpleMlRule,
getSimpleRule,
installMockPrebuiltRules,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_dry_run_ess.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action_dry_run_ess.ts
similarity index 96%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_dry_run_ess.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action_dry_run_ess.ts
index 7357d559ffd68..c44bc5acd58e5 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_dry_run_ess.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action_dry_run_ess.ts
@@ -12,8 +12,8 @@ import {
BulkActionTypeEnum,
BulkActionEditTypeEnum,
} from '@kbn/security-solution-plugin/common/api/detection_engine/rule_management';
-import { createRule, createAlertsIndex, deleteAllRules, deleteAllAlerts } from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { createRule, createAlertsIndex, deleteAllRules, deleteAllAlerts } from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action_ess.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action_ess.ts
index 98b711a5837e7..0904ce7e67ba6 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_bulk_actions/perform_bulk_action_ess.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action_ess.ts
@@ -35,9 +35,9 @@ import {
getRuleSavedObjectWithLegacyInvestigationFields,
getRuleSavedObjectWithLegacyInvestigationFieldsEmptyArray,
checkInvestigationFieldSoValue,
-} from '../../utils';
+} from '../../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/configs/ess.config.ts
new file mode 100644
index 0000000000000..134790cda3fed
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/configs/ess.config.ts
@@ -0,0 +1,22 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { FtrConfigProviderContext } from '@kbn/test';
+
+export default async function ({ readConfigFile }: FtrConfigProviderContext) {
+ const functionalConfig = await readConfigFile(
+ require.resolve('../../../../../../config/ess/config.base.basic')
+ );
+
+ return {
+ ...functionalConfig.getAll(),
+ testFiles: [require.resolve('..')],
+ junit: {
+ reportName: 'Rules Management - Rule Creation Integration Tests - ESS Env - Basic License',
+ },
+ };
+}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/configs/serverless.config.ts
new file mode 100644
index 0000000000000..3786193c5bd80
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/configs/serverless.config.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { createTestConfig } from '../../../../../../config/serverless/config.base.essentials';
+
+export default createTestConfig({
+ testFiles: [require.resolve('..')],
+ junit: {
+ reportName:
+ 'Rules Management - Rule Creation Integration Tests - Serverless Env - Essentials Tier ',
+ },
+});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/rules/create_ml_rules_privileges.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/create_ml_rules_privileges.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/rules/create_ml_rules_privileges.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/create_ml_rules_privileges.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/rules/create_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/create_rules.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/rules/create_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/create_rules.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/index.ts
similarity index 56%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/index.ts
index 48d0fb1f1fd99..aa21da6d74cc7 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/prebuilt_rules/update_prebuilt_rules_package/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/index.ts
@@ -4,11 +4,11 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-
import { FtrProviderContext } from '../../../../../ftr_provider_context';
-export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection Engine API - Update Prebuilt Rules Package', function () {
- loadTestFile(require.resolve('./update_prebuilt_rules_package'));
+export default function ({ loadTestFile }: FtrProviderContext) {
+ describe('Rules Management - Rule Creation APIs', function () {
+ loadTestFile(require.resolve('./create_rules'));
+ loadTestFile(require.resolve('./create_ml_rules_privileges'));
});
-};
+}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/configs/ess.config.ts
similarity index 81%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/configs/ess.config.ts
index 2f04f8c18d6b4..d42e794bd28f0 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/configs/ess.config.ts
@@ -9,14 +9,14 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../config/ess/config.base.trial')
);
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('..')],
junit: {
- reportName: 'Detection Engine - Rule Creation Integration Tests - ESS Env - Trial License',
+ reportName: 'Rules Management - Rule Creation Integration Tests - ESS Env - Trial License',
},
};
}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/configs/serverless.config.ts
similarity index 81%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/configs/serverless.config.ts
index 64763286226ae..22bf9343ce9af 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/exceptions/workflows/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/configs/serverless.config.ts
@@ -11,6 +11,6 @@ export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Detection Engine - Exception Workflows Integration Tests - Serverless Env - Complete License',
+ 'Rules Management - Rule Creation Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/create_new_terms.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/create_new_terms.ts
similarity index 94%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/create_new_terms.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/create_new_terms.ts
index 459b0e656fae0..78c8467356612 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/create_new_terms.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/create_new_terms.ts
@@ -10,8 +10,8 @@ import expect from '@kbn/expect';
import { DETECTION_ENGINE_RULES_URL } from '@kbn/security-solution-plugin/common/constants';
import { getCreateNewTermsRulesSchemaMock } from '@kbn/security-solution-plugin/common/api/detection_engine/model/rule_schema/mocks';
-import { deleteAllRules } from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { deleteAllRules } from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/create_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/create_rules.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/create_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/create_rules.ts
index aad42c2e4ea6c..e1bbdbe26e3dd 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/create_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/create_rules.ts
@@ -17,7 +17,7 @@ import {
import { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types';
import { ROLES } from '@kbn/security-solution-plugin/common/test';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
import {
deleteAllRules,
waitForRuleSuccess,
@@ -34,11 +34,11 @@ import {
getThresholdRuleParams,
generateEvent,
fetchRule,
-} from '../../utils';
+} from '../../../utils';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../common/services/security_solution';
+} from '../../../../../../common/services/security_solution';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/create_rules_bulk.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/create_rules_bulk.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/create_rules_bulk.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/create_rules_bulk.ts
index b3d954773b518..2319c3d0ddf82 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/create_rules_bulk.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/create_rules_bulk.ts
@@ -33,8 +33,8 @@ import {
getActionsWithoutFrequencies,
getSomeActionsWithFrequencies,
removeUUIDFromActions,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/index.ts
similarity index 77%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/index.ts
index 1d22c7ef57cda..b662e41a214dc 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/index.ts
@@ -4,10 +4,10 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Rule creation API', function () {
+ describe('Rules Management - Rule creation APIs', function () {
loadTestFile(require.resolve('./create_rules'));
loadTestFile(require.resolve('./create_new_terms'));
loadTestFile(require.resolve('./preview_rules'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/preview_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/preview_rules.ts
similarity index 95%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/preview_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/preview_rules.ts
index 95ba7de98eab7..cf723f5cf2779 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/preview_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/preview_rules.ts
@@ -9,15 +9,15 @@ import expect from '@kbn/expect';
import { DETECTION_ENGINE_RULES_PREVIEW } from '@kbn/security-solution-plugin/common/constants';
import { ROLES } from '@kbn/security-solution-plugin/common/test';
-import { deleteAllRules, getSimplePreviewRule, getSimpleRulePreviewOutput } from '../../utils';
+import { deleteAllRules, getSimplePreviewRule, getSimpleRulePreviewOutput } from '../../../utils';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../common/services/security_solution';
+} from '../../../../../../common/services/security_solution';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../es_archive_path_builder';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
export default ({ getService }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/configs/ess.config.ts
new file mode 100644
index 0000000000000..e5fad98d72b4f
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/configs/ess.config.ts
@@ -0,0 +1,22 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { FtrConfigProviderContext } from '@kbn/test';
+
+export default async function ({ readConfigFile }: FtrConfigProviderContext) {
+ const functionalConfig = await readConfigFile(
+ require.resolve('../../../../../../config/ess/config.base.trial')
+ );
+
+ return {
+ ...functionalConfig.getAll(),
+ testFiles: [require.resolve('..')],
+ junit: {
+ reportName: 'Rules Management - Rule Deletion Integration Tests - ESS Env - Trial License',
+ },
+ };
+}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/configs/serverless.config.ts
similarity index 72%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/configs/serverless.config.ts
index 4a8c7d24f7b36..86f605554105a 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_creation/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/configs/serverless.config.ts
@@ -4,13 +4,12 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-
-import { createTestConfig } from '../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Detection Engine - Rule Creation Integration Tests - Serverless Env - Complete License',
+ 'Rules Management - Rule Deletion Integration Tests - Serverless Env - Complete License',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules.ts
index ed325c15dae40..09ed13dc483b1 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules.ts
@@ -19,9 +19,9 @@ import {
removeServerGeneratedProperties,
removeServerGeneratedPropertiesIncludingRuleId,
updateUsername,
-} from '../../utils';
+} from '../../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_bulk.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_bulk.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_bulk.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_bulk.ts
index a4f4df7868005..7a4d4e4df9c56 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_bulk.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_bulk.ts
@@ -25,8 +25,8 @@ import {
createRuleThroughAlertingEndpoint,
getRuleSavedObjectWithLegacyInvestigationFields,
getRuleSavedObjectWithLegacyInvestigationFieldsEmptyArray,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_bulk_legacy.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_bulk_legacy.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_bulk_legacy.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_bulk_legacy.ts
index 53a8ac37e5abb..7af966e8a0dfe 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_bulk_legacy.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_bulk_legacy.ts
@@ -18,8 +18,8 @@ import {
getSlackAction,
getWebHookAction,
getLegacyActionSO,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_ess.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_ess.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_ess.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_ess.ts
index 48612358459cd..784f083cbb75b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_ess.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_ess.ts
@@ -19,9 +19,9 @@ import {
createRuleThroughAlertingEndpoint,
getRuleSavedObjectWithLegacyInvestigationFields,
getRuleSavedObjectWithLegacyInvestigationFieldsEmptyArray,
-} from '../../utils';
+} from '../../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_legacy.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_legacy.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_legacy.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_legacy.ts
index 214217cdbfe5b..42c3d633a003d 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_legacy.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/delete_rules_legacy.ts
@@ -18,9 +18,9 @@ import {
getSlackAction,
getWebHookAction,
getLegacyActionSO,
-} from '../../utils';
+} from '../../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/index.ts
similarity index 81%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/index.ts
index 559ddcfefd23e..607a0d171a021 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Rule Delete API', function () {
+ describe('Rules Management - Rule Delete API', function () {
loadTestFile(require.resolve('./delete_rules'));
loadTestFile(require.resolve('./delete_rules_ess'));
loadTestFile(require.resolve('./delete_rules_legacy'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/configs/ess.config.ts
similarity index 90%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/configs/ess.config.ts
index ee0cff6c55b86..b393bee6b78de 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/configs/serverless.config.ts
similarity index 77%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/configs/serverless.config.ts
index 5d9fdbac927df..ffbfbc71001cb 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/configs/serverless.config.ts
@@ -4,12 +4,12 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { createTestConfig } from '../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Rules Management - Rule Import And Export Integration Tests - Serverless Env - Complete License',
+ 'Rules Management - Rule Import And Export Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/export_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/export_rules.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/export_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/export_rules.ts
index 42ec2a27c5d7f..b87e1e0fcc4b1 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/export_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/export_rules.ts
@@ -21,8 +21,8 @@ import {
removeServerGeneratedProperties,
waitForRulePartialFailure,
updateUsername,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/export_rules_ess.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/export_rules_ess.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/export_rules_ess.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/export_rules_ess.ts
index 5af0d9a8814cd..a0c7ab520da3c 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/export_rules_ess.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/export_rules_ess.ts
@@ -29,8 +29,8 @@ import {
updateUsername,
createRuleThroughAlertingEndpoint,
checkInvestigationFieldSoValue,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/import_export_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/import_export_rules.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/import_export_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/import_export_rules.ts
index d40e92fca197e..3d4d37205ae7d 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/import_export_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/import_export_rules.ts
@@ -25,13 +25,13 @@ import {
deleteAllRules,
deleteAllAlerts,
getSimpleRule,
-} from '../../utils';
+} from '../../../utils';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../common/services/security_solution';
-import { deleteAllExceptions } from '../../../lists_and_exception_lists/utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../../../../common/services/security_solution';
+import { deleteAllExceptions } from '../../../../lists_and_exception_lists/utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
// This test was meant to be more full flow, ensuring that
// exported rules are able to be reimported as opposed to
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/import_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/import_rules.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/import_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/import_rules.ts
index 5999962cf33db..f9f5f5ce4388c 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/import_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/import_rules.ts
@@ -30,9 +30,9 @@ import {
getRulesAsNdjson,
removeServerGeneratedProperties,
ruleToNdjson,
-} from '../../utils';
-import { deleteAllExceptions } from '../../../lists_and_exception_lists/utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { deleteAllExceptions } from '../../../../lists_and_exception_lists/utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
const getImportRuleBuffer = (connectorId: string) => {
const rule1 = {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/import_rules_ess.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/import_rules_ess.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/import_rules_ess.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/import_rules_ess.ts
index bd63c3150588a..536aa25300de4 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/import_rules_ess.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/import_rules_ess.ts
@@ -25,12 +25,12 @@ import {
getWebHookAction,
getSimpleRuleAsNdjson,
checkInvestigationFieldSoValue,
-} from '../../utils';
+} from '../../../utils';
import {
createUserAndRole,
deleteUserAndRole,
-} from '../../../../../common/services/security_solution';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../../../../common/services/security_solution';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export const getSimpleRuleAsNdjsonWithLegacyInvestigationField = (
ruleIds: string[],
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/index.ts
similarity index 80%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/index.ts
index 747f79eac3839..f2240c96dfe5b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_import_export/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_import_export/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Rule import export API', function () {
+ describe('Rules Management - Rule import export API', function () {
loadTestFile(require.resolve('./export_rules'));
loadTestFile(require.resolve('./export_rules_ess'));
loadTestFile(require.resolve('./import_export_rules'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/configs/ess.config.ts
similarity index 77%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/configs/ess.config.ts
index 7176cc1421ec6..0035f6be3995d 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/detection_engine/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/configs/ess.config.ts
@@ -9,14 +9,14 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.basic')
+ require.resolve('../../../../../../config/ess/config.base.basic')
);
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('..')],
junit: {
- reportName: 'Detection Engine - Integration Tests - ESS Env - Basic License',
+ reportName: 'Rules management - Rule Management API Integration Tests - Basic License',
},
};
}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/configs/serverless.config.ts
new file mode 100644
index 0000000000000..13804641ef06c
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/configs/serverless.config.ts
@@ -0,0 +1,15 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { createTestConfig } from '../../../../../../config/serverless/config.base.essentials';
+
+export default createTestConfig({
+ testFiles: [require.resolve('..')],
+ junit: {
+ reportName: 'Rules management - Rule Management API Integration Tests - Essentials Tier',
+ },
+});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/coverage_overview.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/coverage_overview.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/coverage_overview.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/coverage_overview.ts
index b22b76e4b8670..f5185ac31d316 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/coverage_overview.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/coverage_overview.ts
@@ -13,7 +13,7 @@ import {
RULE_MANAGEMENT_COVERAGE_OVERVIEW_URL,
ThreatArray,
} from '@kbn/security-solution-plugin/common/api/detection_engine';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
import {
createPrebuiltRuleAssetSavedObjects,
createRuleAssetSavedObject,
@@ -23,8 +23,8 @@ import {
installPrebuiltRules,
getCustomQueryRuleParams,
createNonSecurityRule,
-} from '../../utils';
-import { getCoverageOverview } from '../../utils/rules/get_coverage_overview';
+} from '../../../utils';
+import { getCoverageOverview } from '../../../utils/rules/get_coverage_overview';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/index.ts
similarity index 73%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/index.ts
index 84d79ee1dd675..53fd6ef106cf6 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/basic_essentials_license/rule_management/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/basic_license_essentials_tier/index.ts
@@ -4,10 +4,10 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Rule management API', function () {
+ describe('Rules Management - rule management API', function () {
loadTestFile(require.resolve('./coverage_overview'));
});
}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/configs/ess.config.ts
similarity index 90%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/configs/ess.config.ts
index 978d5f2268dee..cce73d6aa2d0c 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/configs/serverless.config.ts
similarity index 78%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/configs/serverless.config.ts
index 86c288c6dacea..ca9396db04661 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/configs/serverless.config.ts
@@ -4,12 +4,12 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { createTestConfig } from '../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Rules Management - Rule Management Integration Tests - Serverless Env - Complete License',
+ 'Rules Management - Rule Management Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/get_rule_execution_results.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/get_rule_execution_results.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/get_rule_execution_results.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/get_rule_execution_results.ts
index a45636b08ea0d..fbd4836b19605 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/get_rule_execution_results.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/get_rule_execution_results.ts
@@ -27,14 +27,14 @@ import {
waitForEventLogExecuteComplete,
waitForRulePartialFailure,
waitForRuleSuccess,
-} from '../../utils';
+} from '../../../utils';
import {
failedGapExecution,
failedRanAfterDisabled,
successfulExecution,
} from './template_data/execution_events';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
-import { EsArchivePathBuilder } from '../../../../es_archive_path_builder';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
+import { EsArchivePathBuilder } from '../../../../../es_archive_path_builder';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/get_rule_management_filters.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/get_rule_management_filters.ts
similarity index 97%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/get_rule_management_filters.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/get_rule_management_filters.ts
index 79e632c7b0493..834542a0de0e9 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/get_rule_management_filters.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/get_rule_management_filters.ts
@@ -15,8 +15,8 @@ import {
getSimpleRule,
installMockPrebuiltRules,
deleteAllPrebuiltRuleAssets,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/index.ts
similarity index 76%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/index.ts
index 717c394c20fde..f3a262c72a3e6 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Rule Management API', function () {
+ describe('Rules Management - Rule Management API', function () {
loadTestFile(require.resolve('./get_rule_execution_results'));
loadTestFile(require.resolve('./get_rule_management_filters'));
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/template_data/execution_events.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/template_data/execution_events.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_management/template_data/execution_events.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_management/trial_license_complete_tier/template_data/execution_events.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/configs/ess.config.ts
new file mode 100644
index 0000000000000..b0921302b72e3
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/configs/ess.config.ts
@@ -0,0 +1,22 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { FtrConfigProviderContext } from '@kbn/test';
+
+export default async function ({ readConfigFile }: FtrConfigProviderContext) {
+ const functionalConfig = await readConfigFile(
+ require.resolve('../../../../../../config/ess/config.base.trial')
+ );
+
+ return {
+ ...functionalConfig.getAll(),
+ testFiles: [require.resolve('..')],
+ junit: {
+ reportName: 'Rules Management - Rule Patch Integration Tests - ESS Env - Trial License',
+ },
+ };
+}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/configs/serverless.config.ts
new file mode 100644
index 0000000000000..ebb4d533db83b
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/configs/serverless.config.ts
@@ -0,0 +1,15 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+import { createTestConfig } from '../../../../../../config/serverless/config.base';
+
+export default createTestConfig({
+ testFiles: [require.resolve('..')],
+ junit: {
+ reportName:
+ 'Rules Management - Rule Patch Integration Tests - Serverless Env - Complete License',
+ },
+});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/index.ts
similarity index 78%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/index.ts
index 609c70f10c944..e80b9bd9e33e5 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Rule Patch API', function () {
+ describe('Rules Management - Rule Patch APIs', function () {
loadTestFile(require.resolve('./patch_rules_bulk'));
loadTestFile(require.resolve('./patch_rules'));
loadTestFile(require.resolve('./patch_rules_ess'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/patch_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/patch_rules.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/patch_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/patch_rules.ts
index 43abe1c3b591b..015175209fe23 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/patch_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/patch_rules.ts
@@ -34,8 +34,8 @@ import {
getActionsWithoutFrequencies,
getSomeActionsWithFrequencies,
updateUsername,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/patch_rules_bulk.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/patch_rules_bulk.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/patch_rules_bulk.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/patch_rules_bulk.ts
index 94c07f20d7d60..6b8bc2a7c24bf 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/patch_rules_bulk.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/patch_rules_bulk.ts
@@ -30,8 +30,8 @@ import {
getRuleSavedObjectWithLegacyInvestigationFieldsEmptyArray,
getRuleSavedObjectWithLegacyInvestigationFields,
checkInvestigationFieldSoValue,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/patch_rules_ess.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/patch_rules_ess.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/patch_rules_ess.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/patch_rules_ess.ts
index 613ed6b5de9b3..be413c1a5ef9c 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/patch_rules_ess.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/trial_license_complete_tier/patch_rules_ess.ts
@@ -26,8 +26,8 @@ import {
createLegacyRuleAction,
getSimpleRule,
checkInvestigationFieldSoValue,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/configs/ess.config.ts
similarity index 90%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/configs/ess.config.ts
index 9d0830b927c6e..abc31db85c9e9 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/configs/ess.config.ts
@@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.trial')
+ require.resolve('../../../../../../config/ess/config.base.trial')
);
return {
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/configs/serverless.config.ts
new file mode 100644
index 0000000000000..cd1337a1c8ef6
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/configs/serverless.config.ts
@@ -0,0 +1,14 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+import { createTestConfig } from '../../../../../../config/serverless/config.base';
+
+export default createTestConfig({
+ testFiles: [require.resolve('..')],
+ junit: {
+ reportName: 'Rules Management - Rule Read Integration Tests - Serverless Env - Complete Tier',
+ },
+});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/find_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/find_rules.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/find_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/find_rules.ts
index 4a9740358e928..96e3b90013112 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/find_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/find_rules.ts
@@ -21,8 +21,8 @@ import {
getWebHookAction,
updateUsername,
removeServerGeneratedProperties,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/find_rules_ess.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/find_rules_ess.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/find_rules_ess.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/find_rules_ess.ts
index f15ea25fbdd16..1155c99e9455d 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/find_rules_ess.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/find_rules_ess.ts
@@ -26,8 +26,8 @@ import {
getRuleSavedObjectWithLegacyInvestigationFields,
getRuleSavedObjectWithLegacyInvestigationFieldsEmptyArray,
checkInvestigationFieldSoValue,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/index.ts
similarity index 81%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/index.ts
index 2c461fc497090..4c42454609985 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Rule Read API', function () {
+ describe('Rules Management - Rule Read API', function () {
loadTestFile(require.resolve('./find_rules'));
loadTestFile(require.resolve('./find_rules_ess'));
loadTestFile(require.resolve('./read_rules'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/read_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/read_rules.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/read_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/read_rules.ts
index d7a4ba65b98da..8ac8fcec3744b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/read_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/read_rules.ts
@@ -20,8 +20,8 @@ import {
removeServerGeneratedProperties,
removeServerGeneratedPropertiesIncludingRuleId,
updateUsername,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/read_rules_ess.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/read_rules_ess.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/read_rules_ess.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/read_rules_ess.ts
index 6780a639cbd8c..5c6362d10eb60 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/read_rules_ess.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/read_rules_ess.ts
@@ -26,8 +26,8 @@ import {
createRuleThroughAlertingEndpoint,
getRuleSavedObjectWithLegacyInvestigationFieldsEmptyArray,
checkInvestigationFieldSoValue,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/resolve_read_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/resolve_read_rules.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/resolve_read_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/resolve_read_rules.ts
index b35343589ed65..d5c167b6a9d15 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/resolve_read_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_read/trial_license_complete_tier/resolve_read_rules.ts
@@ -9,8 +9,8 @@ import expect from '@kbn/expect';
import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server';
import { DETECTION_ENGINE_RULES_URL } from '@kbn/security-solution-plugin/common/constants';
-import { createAlertsIndex, deleteAllRules, deleteAllAlerts } from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { createAlertsIndex, deleteAllRules, deleteAllAlerts } from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
const spaceId = '714-space';
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/configs/ess.config.ts
new file mode 100644
index 0000000000000..61be05cbd97b1
--- /dev/null
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/configs/ess.config.ts
@@ -0,0 +1,22 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { FtrConfigProviderContext } from '@kbn/test';
+
+export default async function ({ readConfigFile }: FtrConfigProviderContext) {
+ const functionalConfig = await readConfigFile(
+ require.resolve('../../../../../../config/ess/config.base.trial')
+ );
+
+ return {
+ ...functionalConfig.getAll(),
+ testFiles: [require.resolve('..')],
+ junit: {
+ reportName: 'Rules Management - Rule Update Integration Tests - ESS Env - Trial License',
+ },
+ };
+}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/configs/serverless.config.ts
similarity index 72%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/configs/serverless.config.ts
index ea732668ee155..4fe157e55efb9 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/configs/serverless.config.ts
@@ -4,12 +4,12 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-import { createTestConfig } from '../../../../../config/serverless/config.base';
+import { createTestConfig } from '../../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
- 'Detection Engine - Rule Update Integration Tests - Serverless Env - Complete License',
+ 'Rules Management - Rule Update Integration Tests - Serverless Env - Complete License',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/index.ts
similarity index 78%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/index.ts
index c132ffcd06028..e38cb8fa4f181 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/index.ts
@@ -5,10 +5,10 @@
* 2.0.
*/
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Rule Update API', function () {
+ describe('Rules Management - Rule Update APIs', function () {
loadTestFile(require.resolve('./update_rules_bulk'));
loadTestFile(require.resolve('./update_rules'));
loadTestFile(require.resolve('./update_rules_ess'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/update_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/update_rules.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/update_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/update_rules.ts
index 69dc28fddf6b4..94d2742ba3587 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/update_rules.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/update_rules.ts
@@ -37,8 +37,8 @@ import {
getActionsWithFrequencies,
getActionsWithoutFrequencies,
getSomeActionsWithFrequencies,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/update_rules_bulk.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/update_rules_bulk.ts
similarity index 99%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/update_rules_bulk.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/update_rules_bulk.ts
index d3a7a124ae59c..85a0daabfe861 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/update_rules_bulk.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/update_rules_bulk.ts
@@ -41,8 +41,8 @@ import {
getActionsWithoutFrequencies,
getSomeActionsWithFrequencies,
updateUsername,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/update_rules_ess.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/update_rules_ess.ts
similarity index 98%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/update_rules_ess.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/update_rules_ess.ts
index 3338634ea0511..8f01ea1d01105 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/update_rules_ess.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_update/trial_license_complete_tier/update_rules_ess.ts
@@ -27,8 +27,8 @@ import {
getRuleSavedObjectWithLegacyInvestigationFields,
getRuleSavedObjectWithLegacyInvestigationFieldsEmptyArray,
updateUsername,
-} from '../../utils';
-import { FtrProviderContext } from '../../../../ftr_provider_context';
+} from '../../../utils';
+import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/README.md b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/README.md
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/README.md
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/README.md
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/configs/ess.config.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/configs/ess.config.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/configs/serverless.config.ts
similarity index 83%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/configs/serverless.config.ts
index 2601dba13f00c..67f04d3eb30ec 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/configs/serverless.config.ts
@@ -10,8 +10,7 @@ import { createTestConfig } from '../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
- reportName:
- 'Detection Engine - Telemetry Integration Tests - Serverless Env - Complete License',
+ reportName: 'Detection Engine - Telemetry Integration Tests - Serverless Env - Complete Tier',
},
kbnTestServerArgs: [
`--xpack.securitySolution.enableExperimental=${JSON.stringify(['previewTelemetryUrlEnabled'])}`,
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/index.ts
similarity index 91%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/index.ts
index 5fef7869ba7c8..0425b6971d78e 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/index.ts
@@ -7,7 +7,7 @@
import { FtrProviderContext } from '../../../../ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection rule type telemetry', function () {
+ describe('Detections Response - Detection rule type telemetry', function () {
loadTestFile(require.resolve('./usage_collector/all_types'));
loadTestFile(require.resolve('./usage_collector/detection_rules'));
loadTestFile(require.resolve('./usage_collector/detection_rule_status'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/task_based/all_types.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/task_based/all_types.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/task_based/all_types.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/task_based/all_types.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/task_based/detection_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/task_based/detection_rules.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/task_based/detection_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/task_based/detection_rules.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/task_based/security_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/task_based/security_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/task_based/security_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/task_based/security_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/usage_collector/all_types.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/usage_collector/all_types.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/usage_collector/all_types.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/usage_collector/all_types.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/usage_collector/detection_rule_status.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/usage_collector/detection_rule_status.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/usage_collector/detection_rule_status.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/usage_collector/detection_rule_status.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/usage_collector/detection_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/usage_collector/detection_rules.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/usage_collector/detection_rules.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/usage_collector/detection_rules.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/usage_collector/detection_rules_legacy_action.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/usage_collector/detection_rules_legacy_action.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry/usage_collector/detection_rules_legacy_action.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/usage_collector/detection_rules_legacy_action.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/user_roles/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/configs/ess.config.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/user_roles/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/configs/ess.config.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/configs/serverless.config.ts
similarity index 79%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/configs/serverless.config.ts
index 853ffc6443890..0bdde41d3e831 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_read/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/configs/serverless.config.ts
@@ -4,12 +4,12 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
+
import { createTestConfig } from '../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
- reportName:
- 'Rules Management - Rule Read Integration Tests - Serverless Env - Complete License',
+ reportName: 'Detection Engine - User Roles Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/user_roles/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/index.ts
similarity index 87%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/user_roles/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/index.ts
index 7c1d0fe7cc751..788fdb54e71a6 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/user_roles/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/index.ts
@@ -7,7 +7,7 @@
import { FtrProviderContext } from '../../../../ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
- describe('Detection User Roles APIs', function () {
+ describe('Detection Response - User Roles APIs', function () {
loadTestFile(require.resolve('./read_privileges'));
});
};
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/user_roles/read_privileges.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/read_privileges.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/user_roles/read_privileges.ts
rename to x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/read_privileges.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/asset_criticality.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/asset_criticality.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/asset_criticality.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/asset_criticality.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/asset_criticality_privileges.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/asset_criticality_privileges.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/asset_criticality_privileges.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/asset_criticality_privileges.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/ess.config.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/ess.config.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/serverless.config.ts
similarity index 84%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/serverless.config.ts
index 35f50c7ad9f40..b7f36543504eb 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/serverless.config.ts
@@ -15,7 +15,6 @@ export default createTestConfig({
],
testFiles: [require.resolve('..')],
junit: {
- reportName:
- 'Entity Analytics - Risk Engine Integration Tests - Serverless Env - Complete License',
+ reportName: 'Entity Analytics - Risk Engine Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/index.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/index.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/index.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/init_and_status_apis.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/init_and_status_apis.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/init_and_status_apis.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/init_and_status_apis.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/risk_engine_privileges.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_engine_privileges.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/risk_engine_privileges.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_engine_privileges.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/risk_score_calculation.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_score_calculation.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/risk_score_calculation.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_score_calculation.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/risk_score_preview.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_score_preview.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/risk_score_preview.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_score_preview.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/risk_scoring_task/task_execution.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_scoring_task/task_execution.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/risk_scoring_task/task_execution.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_scoring_task/task_execution.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/risk_scoring_task/task_execution_nondefault_spaces.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_scoring_task/task_execution_nondefault_spaces.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/risk_scoring_task/task_execution_nondefault_spaces.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_scoring_task/task_execution_nondefault_spaces.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/telemetry_usage.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/telemetry_usage.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/telemetry_usage.ts
rename to x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/telemetry_usage.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/configs/ess.config.ts
deleted file mode 100644
index 3a0a941f48020..0000000000000
--- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/configs/ess.config.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { FtrConfigProviderContext } from '@kbn/test';
-
-export default async function ({ readConfigFile }: FtrConfigProviderContext) {
- const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.trial')
- );
-
- return {
- ...functionalConfig.getAll(),
- testFiles: [require.resolve('..')],
- junit: {
- reportName: 'Detection Engine - Exception Lists Integration Tests - ESS Env - Trial License',
- },
- };
-}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/configs/serverless.config.ts
deleted file mode 100644
index 989ebcd4a34f5..0000000000000
--- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/configs/serverless.config.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { createTestConfig } from '../../../../../config/serverless/config.base';
-
-export default createTestConfig({
- testFiles: [require.resolve('..')],
- junit: {
- reportName:
- 'Detection Engine - Exception Lists Integration Tests - Serverless Env - Complete License',
- },
-});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/configs/ess.config.ts
deleted file mode 100644
index 0af6ce99fbbb3..0000000000000
--- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/configs/ess.config.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { FtrConfigProviderContext } from '@kbn/test';
-
-export default async function ({ readConfigFile }: FtrConfigProviderContext) {
- const functionalConfig = await readConfigFile(
- require.resolve('../../../../../config/ess/config.base.trial')
- );
-
- return {
- ...functionalConfig.getAll(),
- testFiles: [require.resolve('..')],
- junit: {
- reportName: 'Detection Engine - Value Lists Integration Tests - ESS Env - Trial License',
- },
- };
-}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/configs/serverless.config.ts
deleted file mode 100644
index f2e5509441e09..0000000000000
--- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/configs/serverless.config.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { createTestConfig } from '../../../../../config/serverless/config.base';
-
-export default createTestConfig({
- testFiles: [require.resolve('..')],
- junit: {
- reportName:
- 'Detection Engine - Value Lists Integration Tests - Serverless Env - Complete License',
- },
-});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/configs/ess.config.ts
similarity index 86%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/configs/ess.config.ts
index 30b7daf5d02b3..d978a7056f82c 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/configs/ess.config.ts
@@ -16,7 +16,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
...functionalConfig.getAll(),
testFiles: [require.resolve('..')],
junit: {
- reportName: 'Detection Engine - Rule Patch Integration Tests - ESS Env - Trial License',
+ reportName: 'Exception Lists Integration Tests - ESS Env - Trial License',
},
};
}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/user_roles/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/configs/serverless.config.ts
similarity index 79%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/user_roles/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/configs/serverless.config.ts
index a2dd062fa0ac3..b6b140721257a 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/user_roles/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/configs/serverless.config.ts
@@ -10,7 +10,6 @@ import { createTestConfig } from '../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
- reportName:
- 'Detection Engine - User Roles Integration Tests - Serverless Env - Complete License',
+ reportName: 'Exception Lists Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/index.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/index.ts
similarity index 86%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/index.ts
index b490143ff28bd..90737109e585b 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/index.ts
@@ -7,7 +7,7 @@
import { FtrProviderContext } from '../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Exception Lists and Items API', function () {
+ describe('Detection Engine - Exception Lists and Items APIs', function () {
loadTestFile(require.resolve('./items'));
loadTestFile(require.resolve('./lists'));
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/create_exception_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/create_exception_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/create_exception_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/create_exception_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/delete_exception_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/delete_exception_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/delete_exception_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/delete_exception_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/find_exception_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/find_exception_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/find_exception_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/find_exception_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/index.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/index.ts
similarity index 92%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/index.ts
index df84a7a9ee3d5..5811ec752daf1 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/index.ts
@@ -7,7 +7,7 @@
import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Lists API', function () {
+ describe('Exception Lists - Items APIs', function () {
loadTestFile(require.resolve('./create_exception_list_items'));
loadTestFile(require.resolve('./read_exception_list_items'));
loadTestFile(require.resolve('./update_exception_list_items'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/read_exception_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/read_exception_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/read_exception_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/read_exception_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/update_exception_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/update_exception_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/items/update_exception_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/update_exception_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/create_exception_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/create_exception_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/create_exception_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/create_exception_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/delete_exception_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/delete_exception_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/delete_exception_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/delete_exception_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/duplicate_exception_list.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/duplicate_exception_list.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/duplicate_exception_list.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/duplicate_exception_list.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/export_exception_list.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/export_exception_list.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/export_exception_list.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/export_exception_list.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/find_exception_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/find_exception_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/find_exception_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/find_exception_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/get_exception_filter.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/get_exception_filter.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/get_exception_filter.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/get_exception_filter.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/import_exceptions.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/import_exceptions.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/import_exceptions.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/import_exceptions.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/index.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/index.ts
similarity index 94%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/index.ts
index 0e27b93b93b6f..f86be486aa8f6 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/index.ts
@@ -8,7 +8,7 @@
import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Lists API', function () {
+ describe('Exception Lists - Lists APIs', function () {
loadTestFile(require.resolve('./duplicate_exception_list'));
loadTestFile(require.resolve('./get_exception_filter'));
loadTestFile(require.resolve('./import_exceptions'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/read_exception_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/read_exception_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/read_exception_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/read_exception_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/summary_exception_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/summary_exception_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/summary_exception_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/summary_exception_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/update_exception_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/update_exception_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/exception_lists_items/lists/update_exception_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/lists/update_exception_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/configs/ess.config.ts
similarity index 86%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/configs/ess.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/configs/ess.config.ts
index fa76a9537ab3a..c7bb95bd59930 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_update/configs/ess.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/configs/ess.config.ts
@@ -16,7 +16,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
...functionalConfig.getAll(),
testFiles: [require.resolve('..')],
junit: {
- reportName: 'Detection Engine - Rule Update Integration Tests - ESS Env - Trial License',
+ reportName: 'Value Lists Integration Tests - ESS Env - Trial License',
},
};
}
diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/configs/serverless.config.ts
similarity index 79%
rename from x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/configs/serverless.config.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/configs/serverless.config.ts
index e95130ab73891..5d127d5c7b2d0 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_patch/configs/serverless.config.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/configs/serverless.config.ts
@@ -4,12 +4,12 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
+
import { createTestConfig } from '../../../../../config/serverless/config.base';
export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
- reportName:
- 'Detection Engine - Rule Patch Integration Tests - Serverless Env - Complete License',
+ reportName: 'Value Lists Integration Tests - Serverless Env - Complete Tier',
},
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/index.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/index.ts
similarity index 88%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/index.ts
index 9422d4b2315f9..c0e9c15f95e69 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/index.ts
@@ -7,7 +7,7 @@
import { FtrProviderContext } from '../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Lists and Items API', function () {
+ describe('Detection Engine - Value lists APIs', function () {
loadTestFile(require.resolve('./items'));
loadTestFile(require.resolve('./lists'));
});
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/create_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/create_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/create_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/create_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/delete_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/delete_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/delete_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/delete_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/export_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/export_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/export_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/export_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/find_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/find_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/find_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/find_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/import_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/import_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/import_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/import_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/import_list_items_migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/import_list_items_migrations.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/import_list_items_migrations.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/import_list_items_migrations.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/index.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/index.ts
similarity index 95%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/index.ts
index d89f7ca5566df..6b984cddfd02f 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/index.ts
@@ -7,7 +7,7 @@
import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Lists API', function () {
+ describe('Value Lists - Items APIs', function () {
loadTestFile(require.resolve('./create_list_items'));
loadTestFile(require.resolve('./patch_list_items'));
loadTestFile(require.resolve('./patch_list_items_migrations'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/patch_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/patch_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/patch_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/patch_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/patch_list_items_migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/patch_list_items_migrations.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/patch_list_items_migrations.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/patch_list_items_migrations.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/read_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/read_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/read_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/read_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/update_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/update_list_items.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/update_list_items.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/update_list_items.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/update_list_items_migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/update_list_items_migrations.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/items/update_list_items_migrations.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/items/update_list_items_migrations.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/create_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/create_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/create_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/create_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/create_lists_index.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/create_lists_index.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/create_lists_index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/create_lists_index.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/create_lists_index_migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/create_lists_index_migrations.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/create_lists_index_migrations.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/create_lists_index_migrations.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/delete_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/delete_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/delete_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/delete_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/find_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/find_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/find_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/find_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/find_lists_by_size.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/find_lists_by_size.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/find_lists_by_size.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/find_lists_by_size.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/index.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/index.ts
similarity index 95%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/index.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/index.ts
index c661171dfedbe..526e3b5b44fd0 100644
--- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/index.ts
+++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/index.ts
@@ -7,7 +7,7 @@
import { FtrProviderContext } from '../../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
- describe('Lists API', function () {
+ describe('Value Lists - Lists APIs', function () {
loadTestFile(require.resolve('./create_lists'));
loadTestFile(require.resolve('./create_lists_index'));
loadTestFile(require.resolve('./create_lists_index_migrations'));
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/patch_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/patch_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/patch_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/patch_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/patch_lists_migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/patch_lists_migrations.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/patch_lists_migrations.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/patch_lists_migrations.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/read_list_privileges.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/read_list_privileges.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/read_list_privileges.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/read_list_privileges.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/read_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/read_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/read_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/read_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/update_lists.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/update_lists.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/update_lists.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/update_lists.ts
diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/update_lists_migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/update_lists_migrations.ts
similarity index 100%
rename from x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/default_license/lists_items/lists/update_lists_migrations.ts
rename to x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/lists/update_lists_migrations.ts
diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/asset_criticality/host_flyout.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/asset_criticality/host_flyout.cy.ts
deleted file mode 100644
index 3d2ffc8e89412..0000000000000
--- a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/asset_criticality/host_flyout.cy.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { getNewRule } from '../../../objects/rule';
-import {
- HOST_DETAILS_FLYOUT_SECTION_HEADER,
- HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_SELECTOR,
- HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON,
- HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_TITLE,
- HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_LEVEL,
-} from '../../../screens/asset_criticality/flyouts';
-import { deleteAlertsAndRules } from '../../../tasks/api_calls/common';
-import {
- expandFirstAlertHostFlyout,
- selectAssetCriticalityLevel,
- toggleAssetCriticalityAccordion,
- toggleAssetCriticalityModal,
-} from '../../../tasks/asset_criticality/common';
-import { createRule } from '../../../tasks/api_calls/rules';
-import { waitForAlertsToPopulate } from '../../../tasks/create_new_rule';
-import { login } from '../../../tasks/login';
-import { visit } from '../../../tasks/navigation';
-import { ALERTS_URL } from '../../../urls/navigation';
-
-describe(
- 'Host details flyout',
- {
- tags: ['@ess'],
- env: {
- ftrConfig: {
- kbnServerArgs: [
- `--xpack.securitySolution.enableExperimental=${JSON.stringify([
- 'entityAnalyticsAssetCriticalityEnabled',
- ])}`,
- ],
- },
- },
- },
- () => {
- const rule = { ...getNewRule(), investigation_fields: { field_names: ['host.os.name'] } };
-
- beforeEach(() => {
- deleteAlertsAndRules();
- login();
- createRule(rule);
- visit(ALERTS_URL);
- waitForAlertsToPopulate();
- expandFirstAlertHostFlyout();
- });
-
- // FLAKY: https://github.com/elastic/kibana/issues/173991
- describe.skip('Host flyout', () => {
- it('should display header section', () => {
- cy.log('header and content');
-
- cy.get(HOST_DETAILS_FLYOUT_SECTION_HEADER).should('contain.text', 'Host details');
- });
-
- it('should display asset criticality accordion', () => {
- cy.log('asset criticality');
-
- cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_SELECTOR).should(
- 'contain.text',
- 'Asset Criticality'
- );
-
- toggleAssetCriticalityAccordion();
- cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON).should('have.text', 'Create');
- });
-
- it('should display asset criticality modal', () => {
- cy.log('asset criticality modal');
-
- toggleAssetCriticalityModal();
- cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_TITLE).should(
- 'have.text',
- 'Pick asset criticality level'
- );
- });
-
- it('should update asset criticality state', () => {
- cy.log('asset criticality update');
-
- selectAssetCriticalityLevel('Important');
- cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_LEVEL)
- .contains('Important')
- .should('be.visible');
- });
- });
- }
-);
diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/new_entity_flyout.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/new_entity_flyout.cy.ts
index 4eb8dc3c0abf1..ee5f504d9f7ab 100644
--- a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/new_entity_flyout.cy.ts
+++ b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/new_entity_flyout.cy.ts
@@ -8,6 +8,8 @@
import {
expandFirstAlertHostFlyout,
expandFirstAlertUserFlyout,
+ selectAssetCriticalityLevel,
+ toggleAssetCriticalityModal,
} from '../../tasks/asset_criticality/common';
import { login } from '../../tasks/login';
import { visitWithTimeRange } from '../../tasks/navigation';
@@ -19,6 +21,13 @@ import { RISK_INPUT_PANEL_HEADER, ASSET_CRITICALITY_BADGE } from '../../screens/
import { expandRiskInputsFlyoutPanel } from '../../tasks/risk_scores/risk_inputs_flyout_panel';
import { mockRiskEngineEnabled } from '../../tasks/entity_analytics';
import { deleteAlertsAndRules } from '../../tasks/api_calls/common';
+import {
+ ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON,
+ ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_LEVEL,
+ ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_TITLE,
+ ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_SELECTOR,
+} from '../../screens/asset_criticality/flyouts';
+import { deleteCriticality } from '../../tasks/api_calls/entity_analytics';
const USER_NAME = 'user1';
const SIEM_KIBANA_HOST_NAME = 'Host-fwarau82er';
@@ -33,6 +42,7 @@ describe(
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
'newUserDetailsFlyout',
'newHostDetailsFlyout',
+ 'entityAnalyticsAssetCriticalityEnabled',
])}`,
],
},
@@ -47,6 +57,8 @@ describe(
after(() => {
cy.task('esArchiverUnload', 'risk_scores_new_complete_data');
deleteAlertsAndRules(); // esArchiverUnload doesn't work properly when using with `useCreate` and `docsOnly` flags
+ deleteCriticality({ idField: 'host.name', idValue: SIEM_KIBANA_HOST_NAME });
+ deleteCriticality({ idField: 'user.name', idValue: USER_NAME });
});
beforeEach(() => {
@@ -73,6 +85,35 @@ describe(
expandRiskInputsFlyoutPanel();
cy.get(ASSET_CRITICALITY_BADGE).should('contain.text', 'Very important');
});
+
+ it('should display asset criticality accordion', () => {
+ cy.log('asset criticality');
+ expandFirstAlertUserFlyout();
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_SELECTOR).should(
+ 'contain.text',
+ 'Asset Criticality'
+ );
+
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON).should('have.text', 'Create');
+ });
+ it('should display asset criticality modal', () => {
+ cy.log('asset criticality modal');
+ expandFirstAlertUserFlyout();
+ toggleAssetCriticalityModal();
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_TITLE).should(
+ 'have.text',
+ 'Pick asset criticality level'
+ );
+ });
+
+ it('should update asset criticality state', () => {
+ cy.log('asset criticality update');
+ expandFirstAlertUserFlyout();
+ selectAssetCriticalityLevel('Important');
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_LEVEL)
+ .contains('Important')
+ .should('be.visible');
+ });
});
describe('Host details', () => {
@@ -88,11 +129,40 @@ describe(
});
it('should show asset criticality in the risk input panel', () => {
- waitForAlerts();
expandFirstAlertHostFlyout();
expandRiskInputsFlyoutPanel();
cy.get(ASSET_CRITICALITY_BADGE).should('contain.text', 'Very important');
});
+
+ it('should display asset criticality accordion', () => {
+ cy.log('asset criticality');
+ expandFirstAlertHostFlyout();
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_SELECTOR).should(
+ 'contain.text',
+ 'Asset Criticality'
+ );
+
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON).should('have.text', 'Create');
+ });
+
+ it('should display asset criticality modal', () => {
+ cy.log('asset criticality modal');
+ expandFirstAlertHostFlyout();
+ toggleAssetCriticalityModal();
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_TITLE).should(
+ 'have.text',
+ 'Pick asset criticality level'
+ );
+ });
+
+ it('should update asset criticality state', () => {
+ cy.log('asset criticality update');
+ expandFirstAlertHostFlyout();
+ selectAssetCriticalityLevel('Important');
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_LEVEL)
+ .contains('Important')
+ .should('be.visible');
+ });
});
}
);
diff --git a/x-pack/test/security_solution_cypress/cypress/screens/asset_criticality/flyouts.ts b/x-pack/test/security_solution_cypress/cypress/screens/asset_criticality/flyouts.ts
index 276feb83c45a3..d70b16bb881ff 100644
--- a/x-pack/test/security_solution_cypress/cypress/screens/asset_criticality/flyouts.ts
+++ b/x-pack/test/security_solution_cypress/cypress/screens/asset_criticality/flyouts.ts
@@ -7,25 +7,23 @@
import { getDataTestSubjectSelector } from '../../helpers/common';
-export const HOST_DETAILS_FLYOUT_SECTION_HEADER = getDataTestSubjectSelector('host-details-header');
-export const HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_SELECTOR = getDataTestSubjectSelector(
+export const ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_SELECTOR = getDataTestSubjectSelector(
'asset-criticality-selector'
);
-export const HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_LEVEL =
+export const ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_LEVEL =
getDataTestSubjectSelector('asset-criticality-level');
-export const HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON = getDataTestSubjectSelector(
+export const ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON = getDataTestSubjectSelector(
'asset-criticality-change-btn'
);
-export const HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_TITLE = getDataTestSubjectSelector(
+export const ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_TITLE = getDataTestSubjectSelector(
'asset-criticality-modal-title'
);
-export const HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT = getDataTestSubjectSelector(
+export const ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT = getDataTestSubjectSelector(
'asset-criticality-modal-select'
);
-export const HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT_OPTION = getDataTestSubjectSelector(
- 'asset-criticality-modal-select-option'
-);
-export const HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SAVE_BTN = getDataTestSubjectSelector(
+export const ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT_OPTION =
+ getDataTestSubjectSelector('asset-criticality-modal-select-option');
+export const ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SAVE_BTN = getDataTestSubjectSelector(
'asset-criticality-modal-save-btn'
);
diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/entity_analytics.ts b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/entity_analytics.ts
new file mode 100644
index 0000000000000..e84798f260a20
--- /dev/null
+++ b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/entity_analytics.ts
@@ -0,0 +1,18 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { rootRequest } from './common';
+
+export const deleteCriticality = (params: { idValue: string; idField: string }) => {
+ return rootRequest({
+ method: 'DELETE',
+ url: `/internal/asset_criticality?id_value=${params.idValue}&id_field=${params.idField}`,
+
+ failOnStatusCode: false,
+ timeout: 300000,
+ });
+};
diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/asset_criticality/common.ts b/x-pack/test/security_solution_cypress/cypress/tasks/asset_criticality/common.ts
index f867efc80f8b3..bdd586c373cb1 100644
--- a/x-pack/test/security_solution_cypress/cypress/tasks/asset_criticality/common.ts
+++ b/x-pack/test/security_solution_cypress/cypress/tasks/asset_criticality/common.ts
@@ -7,20 +7,20 @@
import { USER_COLUMN } from '../../screens/alerts';
import {
+ ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON,
+ ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SAVE_BTN,
+ ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT,
+ ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT_OPTION,
OPEN_HOST_FLYOUT_BUTTON,
OPEN_USER_FLYOUT_BUTTON,
- HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_SELECTOR,
- HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON,
- HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT,
- HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT_OPTION,
- HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SAVE_BTN,
} from '../../screens/asset_criticality/flyouts';
-import { scrollAlertTableColumnIntoView } from '../alerts';
+import { scrollAlertTableColumnIntoView, waitForAlerts } from '../alerts';
/**
* Find the first alert row in the alerts table then click on the host name to open the flyout
*/
export const expandFirstAlertHostFlyout = () => {
+ waitForAlerts();
// Cypress is flaky on clicking this button despite production not having that issue
// eslint-disable-next-line cypress/no-force
cy.get(OPEN_HOST_FLYOUT_BUTTON).first().click({ force: true });
@@ -30,32 +30,24 @@ export const expandFirstAlertHostFlyout = () => {
* Find the first alert row in the alerts table then click on the host name to open the flyout
*/
export const expandFirstAlertUserFlyout = () => {
+ waitForAlerts();
scrollAlertTableColumnIntoView(USER_COLUMN);
cy.get(OPEN_USER_FLYOUT_BUTTON).first().click();
};
-/**
- * Open the asset criticality accordion
- */
-export const toggleAssetCriticalityAccordion = () => {
- cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_SELECTOR).click();
-};
-
/**
* Open the asset criticality modal
*/
export const toggleAssetCriticalityModal = () => {
- toggleAssetCriticalityAccordion();
- cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON).click();
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON).click();
};
/**
* Open the asset criticality modal
*/
export const selectAssetCriticalityLevel = (option: string) => {
- toggleAssetCriticalityAccordion();
toggleAssetCriticalityModal();
- cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT).click();
- cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT_OPTION).contains(option).click();
- cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SAVE_BTN).click();
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT).click();
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT_OPTION).contains(option).click();
+ cy.get(ENTITY_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SAVE_BTN).click();
};
diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts b/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts
index 167b8e2d69be8..3cd55c8e8d9fe 100644
--- a/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts
+++ b/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts
@@ -553,15 +553,16 @@ export const fillDefineNewTermsRuleAndContinue = (rule: NewTermsRuleCreateProps)
cy.get(DEFINE_CONTINUE_BUTTON).should('exist').click({ force: true });
};
+export const fillEsqlQueryBar = (query: string) => {
+ // eslint-disable-next-line cypress/no-force
+ cy.get(ESQL_QUERY_BAR_INPUT_AREA).type(query, { force: true });
+};
+
export const clearEsqlQueryBar = () => {
// monaco editor under the hood is quite complex in matter to clear it
// underlying textarea holds just the last character of query displayed in search bar
// in order to clear it - it requires to select all text within editor and type in it
- cy.get(ESQL_QUERY_BAR_INPUT_AREA).type(Cypress.platform === 'darwin' ? '{cmd}a' : '{ctrl}a');
-};
-
-export const fillEsqlQueryBar = (query: string) => {
- cy.get(ESQL_QUERY_BAR_INPUT_AREA).type(query);
+ fillEsqlQueryBar(Cypress.platform === 'darwin' ? '{cmd}a' : '{ctrl}a');
};
/**
diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts b/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts
index f3609596e2888..19e455cd4b648 100644
--- a/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts
+++ b/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts
@@ -10,7 +10,6 @@ import {
DISCOVER_CONTAINER,
DISCOVER_DATA_GRID_UPDATING,
DISCOVER_DATA_VIEW_SWITCHER,
- DISCOVER_ESQL_INPUT,
GET_DISCOVER_COLUMN_TOGGLE_BTN,
DISCOVER_FIELD_SEARCH,
DISCOVER_DATA_VIEW_EDITOR_FLYOUT,
@@ -46,19 +45,26 @@ export const waitForDiscoverGridToLoad = () => {
cy.get(DISCOVER_FIELD_LIST_LOADING).should('not.exist');
};
+export const fillEsqlQueryBar = (query: string) => {
+ // eslint-disable-next-line cypress/no-force
+ cy.get(DISCOVER_ESQL_EDITABLE_INPUT).type(query, { force: true });
+};
+
export const selectCurrentDiscoverEsqlQuery = (
discoverEsqlInput = DISCOVER_ESQL_EDITABLE_INPUT
) => {
goToEsqlTab();
- cy.get(discoverEsqlInput).should('be.visible').click();
- cy.get(DISCOVER_ESQL_INPUT_EXPAND).click();
- cy.get(discoverEsqlInput).type(Cypress.platform === 'darwin' ? '{cmd+a}' : '{ctrl+a}');
+ // eslint-disable-next-line cypress/no-force
+ cy.get(discoverEsqlInput).click({ force: true });
+ // eslint-disable-next-line cypress/no-force
+ cy.get(DISCOVER_ESQL_INPUT_EXPAND).click({ force: true });
+ fillEsqlQueryBar(Cypress.platform === 'darwin' ? '{cmd+a}' : '{ctrl+a}');
};
export const addDiscoverEsqlQuery = (esqlQuery: string) => {
// ESQL input uses the monaco editor which doesn't allow for traditional input updates
selectCurrentDiscoverEsqlQuery(DISCOVER_ESQL_EDITABLE_INPUT);
- cy.get(DISCOVER_ESQL_EDITABLE_INPUT).type(`${esqlQuery}`);
+ fillEsqlQueryBar(esqlQuery);
cy.get(DISCOVER_ESQL_EDITABLE_INPUT).blur();
cy.get(GET_LOCAL_SEARCH_BAR_SUBMIT_BUTTON(DISCOVER_CONTAINER)).click();
};
@@ -76,7 +82,7 @@ export const verifyDiscoverEsqlQuery = (esqlQueryToVerify: string) => {
* https://github.com/cypress-io/cypress/issues/15863#issuecomment-816746693
*/
const unicodeReplacedQuery = esqlQueryToVerify.replaceAll(' ', '\u00b7');
- cy.get(DISCOVER_ESQL_INPUT).should('include.text', unicodeReplacedQuery);
+ cy.get(DISCOVER_ESQL_EDITABLE_INPUT).should(($input) => $input.val() === unicodeReplacedQuery);
};
export const submitDiscoverSearchBar = () => {
diff --git a/x-pack/test_serverless/api_integration/test_suites/observability/custom_threshold_rule/documents_count_fired.ts b/x-pack/test_serverless/api_integration/test_suites/observability/custom_threshold_rule/documents_count_fired.ts
index 57440ff8d9ef5..f48853fe26e0a 100644
--- a/x-pack/test_serverless/api_integration/test_suites/observability/custom_threshold_rule/documents_count_fired.ts
+++ b/x-pack/test_serverless/api_integration/test_suites/observability/custom_threshold_rule/documents_count_fired.ts
@@ -84,7 +84,8 @@ export default function ({ getService }: FtrProviderContext) {
await cleanup({ client: esClient, config: dataForgeConfig, logger });
});
- describe('Rule creation', () => {
+ // FLAKY: https://github.com/elastic/kibana/issues/175499
+ describe.skip('Rule creation', () => {
it('creates rule successfully', async () => {
actionId = await alertingApi.createIndexConnector({
name: 'Index Connector: Threshold API test',
diff --git a/x-pack/test_serverless/functional/test_suites/common/examples/partial_results/index.ts b/x-pack/test_serverless/functional/test_suites/common/examples/partial_results/index.ts
index 9ac96c87fa941..88298145edeb3 100644
--- a/x-pack/test_serverless/functional/test_suites/common/examples/partial_results/index.ts
+++ b/x-pack/test_serverless/functional/test_suites/common/examples/partial_results/index.ts
@@ -12,7 +12,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['common', 'svlCommonPage']);
- describe('Partial Results Example', function () {
+ // FLAKY: https://github.com/elastic/kibana/issues/167643
+ describe.skip('Partial Results Example', function () {
before(async () => {
// TODO: Serverless tests require login first
await PageObjects.svlCommonPage.login();
diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts
index f73a350a501eb..97b33e956a7e0 100644
--- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts
+++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/columns_selection.ts
@@ -9,7 +9,7 @@ import { log, timerange } from '@kbn/apm-synthtrace-client';
import moment from 'moment';
import { FtrProviderContext } from '../../../ftr_provider_context';
-const defaultLogColumns = ['@timestamp', 'service.name', 'host.name', 'content'];
+const defaultLogColumns = ['@timestamp', 'resource', 'content'];
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
@@ -60,8 +60,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
mode: 'absolute',
},
columns: [
- { field: 'service.name' },
- { field: 'host.name' },
+ { field: 'resource' },
{ field: 'content' },
{ field: 'data_stream.namespace' },
],
@@ -80,7 +79,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('render content virtual column properly', async () => {
it('should render log level and log message when present', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(0, 5);
+ const cellElement = await dataGrid.getCellElement(0, 4);
const cellValue = await cellElement.getVisibleText();
expect(cellValue.includes('info')).to.be(true);
expect(cellValue.includes('A sample log')).to.be(true);
@@ -89,7 +88,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render log message when present and skip log level when missing', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(1, 5);
+ const cellElement = await dataGrid.getCellElement(1, 4);
const cellValue = await cellElement.getVisibleText();
expect(cellValue.includes('info')).to.be(false);
expect(cellValue.includes('A sample log')).to.be(true);
@@ -98,7 +97,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render message from error object when top level message not present', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(2, 5);
+ const cellElement = await dataGrid.getCellElement(2, 4);
const cellValue = await cellElement.getVisibleText();
expect(cellValue.includes('info')).to.be(true);
expect(cellValue.includes('error.message')).to.be(true);
@@ -108,7 +107,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render message from event.original when top level message and error.message not present', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(3, 5);
+ const cellElement = await dataGrid.getCellElement(3, 4);
const cellValue = await cellElement.getVisibleText();
expect(cellValue.includes('info')).to.be(true);
expect(cellValue.includes('event.original')).to.be(true);
@@ -118,7 +117,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render the whole JSON when neither message, error.message and event.original are present', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(4, 5);
+ const cellElement = await dataGrid.getCellElement(4, 4);
const cellValue = await cellElement.getVisibleText();
expect(cellValue.includes('info')).to.be(true);
@@ -134,7 +133,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('on cell expansion with no message field should open JSON Viewer', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- await dataGrid.clickCellExpandButton(4, 5);
+ await dataGrid.clickCellExpandButton(4, 4);
await testSubjects.existOrFail('dataTableExpandCellActionJsonPopover');
});
});
@@ -142,19 +141,30 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('on cell expansion with message field should open regular popover', async () => {
await navigateToLogExplorer();
await retry.tryForTime(TEST_TIMEOUT, async () => {
- await dataGrid.clickCellExpandButton(3, 5);
+ await dataGrid.clickCellExpandButton(3, 4);
await testSubjects.existOrFail('euiDataGridExpansionPopover');
});
});
});
+ describe('render resource virtual column properly', async () => {
+ it('should render service name and host name when present', async () => {
+ await retry.tryForTime(TEST_TIMEOUT, async () => {
+ const cellElement = await dataGrid.getCellElement(0, 3);
+ const cellValue = await cellElement.getVisibleText();
+ expect(cellValue.includes('synth-service')).to.be(true);
+ expect(cellValue.includes('synth-host')).to.be(true);
+ });
+ });
+ });
+
describe('virtual column cell actions', async () => {
beforeEach(async () => {
await navigateToLogExplorer();
});
it('should render a popover with cell actions when a chip on content column is clicked', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(0, 5);
+ const cellElement = await dataGrid.getCellElement(0, 4);
const logLevelChip = await cellElement.findByTestSubject(
'dataTablePopoverChip_log.level'
);
@@ -170,7 +180,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render the table filtered where log.level value is info when filter in action is clicked', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(0, 5);
+ const cellElement = await dataGrid.getCellElement(0, 4);
const logLevelChip = await cellElement.findByTestSubject(
'dataTablePopoverChip_log.level'
);
@@ -190,7 +200,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should render the table filtered where log.level value is not info when filter out action is clicked', async () => {
await retry.tryForTime(TEST_TIMEOUT, async () => {
- const cellElement = await dataGrid.getCellElement(0, 5);
+ const cellElement = await dataGrid.getCellElement(0, 4);
const logLevelChip = await cellElement.findByTestSubject(
'dataTablePopoverChip_log.level'
);
@@ -205,6 +215,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.missingOrFail('dataTablePopoverChip_log.level');
});
});
+
+ it('should render the table filtered where service.name value is selected', async () => {
+ await retry.tryForTime(TEST_TIMEOUT, async () => {
+ const cellElement = await dataGrid.getCellElement(0, 3);
+ const serviceNameChip = await cellElement.findByTestSubject(
+ 'dataTablePopoverChip_service.name'
+ );
+ await serviceNameChip.click();
+
+ // Find Filter In button
+ const filterInButton = await testSubjects.find(
+ 'dataTableCellAction_addToFilterAction_service.name'
+ );
+
+ await filterInButton.click();
+ const rowWithLogLevelInfo = await testSubjects.findAll(
+ 'dataTablePopoverChip_service.name'
+ );
+
+ expect(rowWithLogLevelInfo.length).to.be(2);
+ });
+ });
});
});
}
@@ -217,7 +249,12 @@ function generateLogsData({ to, count = 1 }: { to: string; count?: number }) {
Array(count)
.fill(0)
.map(() => {
- return log.create().message('A sample log').logLevel('info').timestamp(timestamp);
+ return log
+ .create()
+ .message('A sample log')
+ .logLevel('info')
+ .timestamp(timestamp)
+ .defaults({ 'service.name': 'synth-service' });
})
);
@@ -231,7 +268,11 @@ function generateLogsData({ to, count = 1 }: { to: string; count?: number }) {
Array(count)
.fill(0)
.map(() => {
- return log.create().message('A sample log').timestamp(timestamp);
+ return log
+ .create()
+ .message('A sample log')
+ .timestamp(timestamp)
+ .defaults({ 'service.name': 'synth-service' });
})
);
@@ -245,11 +286,10 @@ function generateLogsData({ to, count = 1 }: { to: string; count?: number }) {
Array(count)
.fill(0)
.map(() => {
- return log
- .create()
- .logLevel('info')
- .timestamp(timestamp)
- .defaults({ 'error.message': 'message in error object' });
+ return log.create().logLevel('info').timestamp(timestamp).defaults({
+ 'error.message': 'message in error object',
+ 'service.name': 'node-service',
+ });
})
);
@@ -263,11 +303,10 @@ function generateLogsData({ to, count = 1 }: { to: string; count?: number }) {
Array(count)
.fill(0)
.map(() => {
- return log
- .create()
- .logLevel('info')
- .timestamp(timestamp)
- .defaults({ 'event.original': 'message in event original' });
+ return log.create().logLevel('info').timestamp(timestamp).defaults({
+ 'event.original': 'message in event original',
+ 'service.name': 'node-service',
+ });
})
);
diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts
index cb9f5f32f6542..de0f3b24d9a35 100644
--- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts
+++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/dataset_selector.ts
@@ -296,7 +296,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(nodes.length).to.be(20);
});
- cleanupAdditionalSetup();
+ await cleanupAdditionalSetup();
});
describe('clicking on integration and moving into the second navigation level', () => {
diff --git a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/header_menu.ts b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/header_menu.ts
index d245d2aa71911..386177dde6f67 100644
--- a/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/header_menu.ts
+++ b/x-pack/test_serverless/functional/test_suites/observability/observability_log_explorer/header_menu.ts
@@ -91,8 +91,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await retry.try(async () => {
expect(await PageObjects.discover.getColumnHeaders()).to.eql([
'@timestamp',
- 'service.name',
- 'host.name',
+ 'resource',
'content',
]);
});
@@ -151,8 +150,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(await PageObjects.discover.getColumnHeaders()).not.to.eql([
'@timestamp',
'content',
- 'service.name',
- 'host.name',
+ 'resource',
]);
});
diff --git a/x-pack/test_serverless/functional/test_suites/search/connectors/connectors_overview.ts b/x-pack/test_serverless/functional/test_suites/search/connectors/connectors_overview.ts
index 5fd27af7903ae..e3b5fe1f39a6c 100644
--- a/x-pack/test_serverless/functional/test_suites/search/connectors/connectors_overview.ts
+++ b/x-pack/test_serverless/functional/test_suites/search/connectors/connectors_overview.ts
@@ -62,58 +62,60 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await pageObjects.svlCommonNavigation.sidenav.clickLink({
deepLinkId: 'serverlessConnectors',
});
- browser.refresh();
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.expectConnectorTableToExist();
+ await browser.refresh();
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.expectConnectorTableToExist();
});
});
describe('connector table', async () => {
it('confirm searchBar to exist', async () => {
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.expectSearchBarToExist();
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.expectSearchBarToExist();
});
it('searchBar and select, filters connector table', async () => {
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.getConnectorFromConnectorTable(
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.getConnectorFromConnectorTable(
TEST_CONNECTOR_NAME
);
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.setSearchBarValue(
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.setSearchBarValue(
TEST_CONNECTOR_NAME
);
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.connectorNameExists(
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.connectorNameExists(
TEST_CONNECTOR_NAME
);
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.changeSearchBarTableSelectValue(
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.changeSearchBarTableSelectValue(
'Type'
);
await testSubjects.click('clearSearchButton');
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.setSearchBarValue('confluence');
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.expectConnectorTableToHaveNoItems();
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.setSearchBarValue(
+ 'confluence'
+ );
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.expectConnectorTableToHaveNoItems();
await testSubjects.click('clearSearchButton');
});
});
describe('delete connector', async () => {
it('delete connector button exist in table', async () => {
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.expectDeleteConnectorButtonExist();
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.expectDeleteConnectorButtonExist();
});
it('open delete connector modal', async () => {
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.openDeleteConnectorModal();
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.openDeleteConnectorModal();
});
it('delete connector button open modal', async () => {
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.confirmDeleteConnectorModalComponentsExists();
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.confirmDeleteConnectorModalComponentsExists();
});
it('delete connector field is disabled if field name does not match connector name', async () => {
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.deleteConnectorIncorrectName(
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.deleteConnectorIncorrectName(
'invalid'
);
});
it('delete connector button deletes connector', async () => {
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.deleteConnectorWithCorrectName(
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.deleteConnectorWithCorrectName(
TEST_CONNECTOR_NAME
);
});
it('confirm connector table is disappeared after delete ', async () => {
- pageObjects.svlSearchConnectorsPage.connectorOverviewPage.confirmConnectorTableIsDisappearedAfterDelete();
+ await pageObjects.svlSearchConnectorsPage.connectorOverviewPage.confirmConnectorTableIsDisappearedAfterDelete();
});
});
});
diff --git a/yarn.lock b/yarn.lock
index e40127be9e07d..367c8e5ffbf84 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -262,7 +262,7 @@
"@babel/helper-split-export-declaration" "^7.22.6"
semver "^6.3.1"
-"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.15", "@babel/helper-create-regexp-features-plugin@^7.22.5":
+"@babel/helper-create-regexp-features-plugin@^7.22.15", "@babel/helper-create-regexp-features-plugin@^7.22.5":
version "7.22.15"
resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz#5ee90093914ea09639b01c711db0d6775e558be1"
integrity sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w==
@@ -468,7 +468,7 @@
"@babel/helper-environment-visitor" "^7.22.20"
"@babel/helper-plugin-utils" "^7.22.5"
-"@babel/plugin-proposal-class-properties@^7.12.1", "@babel/plugin-proposal-class-properties@^7.18.6":
+"@babel/plugin-proposal-class-properties@^7.12.1":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3"
integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==
@@ -733,10 +733,9 @@
"@babel/plugin-syntax-unicode-sets-regex@^7.18.6":
version "7.18.6"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357"
- integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==
+ resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.18.6.tgz#19063fcf8771ec7b31d742339dac62433d0611fe"
+ integrity sha512-9S9X9RUefzrsHZmKMbDXxweEH+YlE8JJEuat9FdvW9Qh1cw7W64jELCtWNkPBPX5En45uy28KGvA/AySqUh8CQ==
dependencies:
- "@babel/helper-create-regexp-features-plugin" "^7.18.6"
"@babel/helper-plugin-utils" "^7.18.6"
"@babel/plugin-transform-arrow-functions@^7.12.1", "@babel/plugin-transform-arrow-functions@^7.23.3":
@@ -11913,12 +11912,12 @@ axe-core@^4.8.2:
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.8.2.tgz#2f6f3cde40935825cf4465e3c1c9e77b240ff6ae"
integrity sha512-/dlp0fxyM3R8YW7MFzaHWXrf4zzbr0vaYb23VBFCl83R7nWNPg/yaQw2Dc8jzCMmDVLhSdzH8MjrsuIUuvX+6g==
-axios@^1.0.0, axios@^1.3.4, axios@^1.6.0, axios@^1.6.3:
- version "1.6.5"
- resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.5.tgz#2c090da14aeeab3770ad30c3a1461bc970fb0cd8"
- integrity sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==
+axios@1.6.3, axios@^1.0.0, axios@^1.3.4, axios@^1.6.0:
+ version "1.6.3"
+ resolved "https://registry.npmjs.org/axios/-/axios-1.6.3.tgz#7f50f23b3aa246eff43c54834272346c396613f4"
+ integrity sha512-fWyNdeawGam70jXSVlKl+SUNVcL6j6W79CuSIPfi6HnDUmSCH6gyUys/HrqHeA/wU0Az41rRgean494d0Jb+ww==
dependencies:
- follow-redirects "^1.15.4"
+ follow-redirects "^1.15.0"
form-data "^4.0.0"
proxy-from-env "^1.1.0"
@@ -17307,10 +17306,10 @@ folktale@2.3.2:
resolved "https://registry.yarnpkg.com/folktale/-/folktale-2.3.2.tgz#38231b039e5ef36989920cbf805bf6b227bf4fd4"
integrity sha512-+8GbtQBwEqutP0v3uajDDoN64K2ehmHd0cjlghhxh0WpcfPzAIjPA03e1VvHlxL02FVGR0A6lwXsNQKn3H1RNQ==
-follow-redirects@^1.0.0, follow-redirects@^1.15.4:
- version "1.15.4"
- resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf"
- integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==
+follow-redirects@1.15.2, follow-redirects@^1.0.0, follow-redirects@^1.15.0:
+ version "1.15.2"
+ resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13"
+ integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==
font-awesome@4.7.0:
version "4.7.0"
@@ -20700,7 +20699,7 @@ js-yaml@3.14.1, js-yaml@^3.13.1, js-yaml@^3.14.1:
argparse "^1.0.7"
esprima "^4.0.0"
-js-yaml@4.1.0, js-yaml@^4.0.0, js-yaml@^4.1.0:
+js-yaml@4.1.0, js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
@@ -20851,6 +20850,11 @@ json5@^1.0.1, json5@^1.0.2:
dependencies:
minimist "^1.2.0"
+jsonc-parser@^3.0.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76"
+ integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==
+
jsondiffpatch@0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/jsondiffpatch/-/jsondiffpatch-0.4.1.tgz#9fb085036767f03534ebd46dcd841df6070c5773"
@@ -22789,23 +22793,51 @@ moment@>=1.6.0, moment@>=2.14.0, moment@^2.10.6, moment@^2.29.4:
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108"
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==
-monaco-editor@*, monaco-editor@^0.24.0:
- version "0.24.0"
- resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.24.0.tgz#990b55096bcc95d08d8d28e55264c6eb17707269"
- integrity sha512-o1f0Lz6ABFNTtnEqqqvlY9qzNx24rQZx1RgYNQ8SkWkE+Ka63keHH/RqxQ4QhN4fs/UYOnvAtEUZsPrzccH++A==
+monaco-editor@^0.44.0:
+ version "0.44.0"
+ resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.44.0.tgz#3c0fe3655923bbf7dd647057302070b5095b6c59"
+ integrity sha512-5SmjNStN6bSuSE5WPT2ZV+iYn1/yI9sd4Igtk23ChvqB7kDk9lZbB9F5frsuvpB+2njdIeGGFf2G4gbE6rCC9Q==
-monaco-yaml@3.2.1:
- version "3.2.1"
- resolved "https://registry.yarnpkg.com/monaco-yaml/-/monaco-yaml-3.2.1.tgz#45ce9f7f8140dc26249ac99eb0a9e5a9ab9beb87"
- integrity sha512-2geAd5I7H1SMgwTHBuyPAPK9WTAzxbl9XwDl5h6NY6n9j4qnlLLQKK1i0P9cAmUiV2uaiViz69RLNWqVU5BVsg==
+monaco-languageserver-types@^0.2.0:
+ version "0.2.3"
+ resolved "https://registry.yarnpkg.com/monaco-languageserver-types/-/monaco-languageserver-types-0.2.3.tgz#1f98324c5b9f1ac7356ef529bd25e53a5fa97943"
+ integrity sha512-QyV5R7s+rJ87bX1sRioMJZULWiTnMp0Vm+RLILgMEL0SqWuBsQBSW0EZunr4xMZhv6Qun3UZNCN4JrCCLURcgQ==
+ dependencies:
+ monaco-types "^0.1.0"
+ vscode-languageserver-protocol "^3.0.0"
+
+monaco-marker-data-provider@^1.0.0:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/monaco-marker-data-provider/-/monaco-marker-data-provider-1.1.1.tgz#0ca69f367152f5aa12cec2bda95f32b7403e876f"
+ integrity sha512-PGB7TJSZE5tmHzkxv/OEwK2RGNC2A7dcq4JRJnnj31CUAsfmw0Gl+1QTrH0W0deKhcQmQM0YVPaqgQ+0wCt8Mg==
+
+monaco-types@^0.1.0:
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/monaco-types/-/monaco-types-0.1.0.tgz#3a3066aba499cb5923cd60efc736f3f14a169e10"
+ integrity sha512-aWK7SN9hAqNYi0WosPoMjenMeXJjwCxDibOqWffyQ/qXdzB/86xshGQobRferfmNz7BSNQ8GB0MD0oby9/5fTQ==
+
+monaco-worker-manager@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/monaco-worker-manager/-/monaco-worker-manager-2.0.1.tgz#f67c54dfca34ed4b225d5de84e77b24b4e36de8a"
+ integrity sha512-kdPL0yvg5qjhKPNVjJoym331PY/5JC11aPJXtCZNwWRvBr6jhkIamvYAyiY5P1AWFmNOy0aRDRoMdZfa71h8kg==
+
+monaco-yaml@^5.1.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/monaco-yaml/-/monaco-yaml-5.1.0.tgz#ba3445b4f683328cb43bc31dc52bc06e66a95b81"
+ integrity sha512-DU+cgXSJdOFKQ4I4oLg0V+mHKq1dJX+7hbIE4fJsgegUf1zEHW3PNlGj6qabUU2HZIPJ5NmXEf005GU9YDzTYQ==
dependencies:
"@types/json-schema" "^7.0.0"
- js-yaml "^4.0.0"
+ jsonc-parser "^3.0.0"
+ monaco-languageserver-types "^0.2.0"
+ monaco-marker-data-provider "^1.0.0"
+ monaco-types "^0.1.0"
+ monaco-worker-manager "^2.0.0"
path-browserify "^1.0.0"
- prettier "2.0.5"
+ prettier "^2.0.0"
vscode-languageserver-textdocument "^1.0.0"
vscode-languageserver-types "^3.0.0"
- yaml-language-server-parser "^0.1.0"
+ vscode-uri "^3.0.0"
+ yaml "^2.0.0"
monitor-event-loop-delay@^1.0.0:
version "1.0.0"
@@ -25017,17 +25049,12 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"
-prettier@2.0.5:
- version "2.0.5"
- resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
- integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
-
"prettier@>=2.2.1 <=2.3.0":
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
- integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
+ integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==
-prettier@^2.7.1:
+prettier@^2.0.0, prettier@^2.7.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==
@@ -25902,13 +25929,12 @@ react-moment-proptypes@^1.7.0:
dependencies:
moment ">=1.6.0"
-react-monaco-editor@^0.41.2:
- version "0.41.2"
- resolved "https://registry.yarnpkg.com/react-monaco-editor/-/react-monaco-editor-0.41.2.tgz#7ec9cadc101d73003a908fca61c50011f237d2b5"
- integrity sha512-0nNqkkSLtUQDHtcCASv3ccYukD+P2uvFzcFZGh6iWg9RZF3Rj9/+jqsTNo2cl4avkX8JVGC/qnZr/g7hxXTBTQ==
+react-monaco-editor@^0.54.0:
+ version "0.54.0"
+ resolved "https://registry.yarnpkg.com/react-monaco-editor/-/react-monaco-editor-0.54.0.tgz#ec9293249a991b08264be723c1ec0ca3a6d480d8"
+ integrity sha512-9JwO69851mfpuhYLHlKbae7omQWJ/2ICE2lbL0VHyNyZR8rCOH7440u+zAtDgiOMpLwmYdY1sEZCdRefywX6GQ==
dependencies:
- monaco-editor "*"
- prop-types "^15.7.2"
+ prop-types "^15.8.1"
react-popper-tooltip@^3.1.1:
version "3.1.1"
@@ -31084,15 +31110,33 @@ vm-browserify@^1.0.1:
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==
+vscode-jsonrpc@8.2.0:
+ version "8.2.0"
+ resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz#f43dfa35fb51e763d17cd94dcca0c9458f35abf9"
+ integrity sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==
+
+vscode-languageserver-protocol@^3.0.0:
+ version "3.17.5"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz#864a8b8f390835572f4e13bd9f8313d0e3ac4bea"
+ integrity sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==
+ dependencies:
+ vscode-jsonrpc "8.2.0"
+ vscode-languageserver-types "3.17.5"
+
vscode-languageserver-textdocument@^1.0.0:
version "1.0.7"
resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz#16df468d5c2606103c90554ae05f9f3d335b771b"
integrity sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==
-vscode-languageserver-types@^3.0.0:
- version "3.17.2"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz#b2c2e7de405ad3d73a883e91989b850170ffc4f2"
- integrity sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==
+vscode-languageserver-types@3.17.5, vscode-languageserver-types@^3.0.0:
+ version "3.17.5"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz#3273676f0cf2eab40b3f44d085acbb7f08a39d8a"
+ integrity sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==
+
+vscode-uri@^3.0.0:
+ version "3.0.8"
+ resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f"
+ integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==
vt-pbf@^3.1.3:
version "3.1.3"
@@ -31844,20 +31888,15 @@ yaml-ast-parser@0.0.43:
resolved "https://registry.yarnpkg.com/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz#e8a23e6fb4c38076ab92995c5dca33f3d3d7c9bb"
integrity sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==
-yaml-language-server-parser@^0.1.0:
- version "0.1.3"
- resolved "https://registry.yarnpkg.com/yaml-language-server-parser/-/yaml-language-server-parser-0.1.3.tgz#f0e9082068291c7c330eefa1f3c9f1b4c3c54183"
- integrity sha512-xD2I+6M/vqQvcy4ded8JpXUaDHXmZMdhIO3OpuiFxstutwnW4whrfDzNcrsfXVdgMWqOUpdv3747Q081PFN1+g==
-
yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2:
version "1.10.2"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
-yaml@^2.2.1, yaml@^2.2.2:
- version "2.3.1"
- resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b"
- integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==
+yaml@^2.0.0, yaml@^2.2.1, yaml@^2.2.2:
+ version "2.3.4"
+ resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2"
+ integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==
yargs-parser@20.2.4, yargs-parser@^20.2.2, yargs-parser@^20.2.3:
version "20.2.4"