diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx index a0643c20d33d4..6301c9cc20b7c 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx @@ -13,13 +13,13 @@ import { useFindCspBenchmarkRule } from './use_csp_benchmark_rules'; import * as TEST_SUBJECTS from './test_subjects'; import { Chance } from 'chance'; import { TestProvider } from '../../test/test_provider'; +import type { CspBenchmarkRule } from '../../../common/types/latest'; import { useParams } from 'react-router-dom'; import { coreMock } from '@kbn/core/public/mocks'; -import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-plugin/common/types/latest'; const chance = new Chance(); -jest.mock('./use_csp_rules', () => ({ +jest.mock('./use_csp_benchmark_rules', () => ({ useFindCspBenchmarkRule: jest.fn(), useBulkUpdateCspBenchmarkRule: jest.fn(), })); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx index 17cd34b504738..3998b5ff51958 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx @@ -7,7 +7,7 @@ import React, { useState, useMemo } from 'react'; import { EuiPanel, EuiSpacer } from '@elastic/eui'; import { useParams } from 'react-router-dom'; -import { CspBenchmarkRule } from '@kbn/cloud-security-posture-plugin/common/types/latest'; +import { CspBenchmarkRule } from '../../../common/types/latest'; import { extractErrorMessage } from '../../../common/utils/helpers'; import { RulesTable } from './rules_table'; import { RulesTableHeader } from './rules_table_header'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts index ffc9c1f48fd2d..8dca9b63c1930 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts @@ -5,7 +5,10 @@ * 2.0. */ import { useQuery } from '@tanstack/react-query'; - +import { + FindCspBenchmarkRuleRequest, + FindCspBenchmarkRuleResponse, +} from '../../../common/types/latest'; import { useKibana } from '../../common/hooks/use_kibana'; import { @@ -13,10 +16,6 @@ import { FIND_CSP_BENCHMARK_RULE_API_CURRENT_VERSION, FIND_CSP_BENCHMARK_RULE_ROUTE_PATH, } from '../../../common/constants'; -import { - FindCspBenchmarkRuleRequest, - FindCspBenchmarkRuleResponse, -} from '@kbn/cloud-security-posture-plugin/common/types/latest'; export type RulesQuery = Pick< FindCspBenchmarkRuleRequest, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts index 70a67145e6608..37f85a08b8243 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts @@ -7,7 +7,7 @@ import type { SavedObjectsClientContract } from '@kbn/core/server'; import { transformError } from '@kbn/securitysolution-es-utils'; import type { AgentPolicy, ListResult, PackagePolicy } from '@kbn/fleet-plugin/common'; -import { CspBenchmarkRule } from '@kbn/cloud-security-posture-plugin/common/types/latest'; +import { CspBenchmarkRule } from '../../../common/types/latest'; import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../common/constants'; import { BENCHMARKS_ROUTE_PATH, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/rules/find/find_csp_benchmark_rule.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/rules/find/find_csp_benchmark_rule.test.ts index de3797ba29314..3c836c48c6910 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/rules/find/find_csp_benchmark_rule.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/rules/find/find_csp_benchmark_rule.test.ts @@ -6,7 +6,7 @@ */ import { getSortedCspBenchmarkRulesTemplates } from './find_csp_benchmark_rule'; -import { CspBenchmarkRule } from '@kbn/cloud-security-posture-plugin/common/types/latest'; +import { CspBenchmarkRule } from '../../../../common/types/latest'; describe('getSortedCspBenchmarkRules', () => { it('sorts by metadata.benchmark.rule_number, invalid semantic version still should still get sorted and empty values should be sorted last', () => { diff --git a/x-pack/plugins/cloud_security_posture/server/routes/rules/find/find_csp_benchmark_rule.ts b/x-pack/plugins/cloud_security_posture/server/routes/rules/find/find_csp_benchmark_rule.ts index 973487a6d9740..75e0ced19693d 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/rules/find/find_csp_benchmark_rule.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/rules/find/find_csp_benchmark_rule.ts @@ -15,7 +15,7 @@ import { FindCspBenchmarkRuleRequest, FindCspBenchmarkRuleResponse, findCspBenchmarkRuleRequestSchema, -} from '@kbn/cloud-security-posture-plugin/common/types/latest'; +} from '../../../../common/types/latest'; import { getBenchmarkFromPackagePolicy } from '../../../../common/utils/helpers'; import { FIND_CSP_BENCHMARK_RULE_ROUTE_PATH } from '../../../../common/constants'; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/rules/find/v1.ts b/x-pack/plugins/cloud_security_posture/server/routes/rules/find/v1.ts index cc758736e8e2a..c4527f14a88e1 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/rules/find/v1.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/rules/find/v1.ts @@ -6,18 +6,17 @@ */ import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import { getBenchmarkFilter } from '../../../../common/utils/helpers'; -import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../../common/constants'; -import { - getBenchmarkIdFromPackagePolicyId, - getSortedCspBenchmarkRulesTemplates, -} from './find_csp_benchmark_rule'; - import type { CspBenchmarkRule, FindCspBenchmarkRuleRequest, FindCspBenchmarkRuleResponse, -} from '@kbn/cloud-security-posture-plugin/common/types/latest'; +} from '../../../../common/types/latest'; +import { + getBenchmarkIdFromPackagePolicyId, + getSortedCspBenchmarkRulesTemplates, +} from './find_csp_benchmark_rule'; +import { getBenchmarkFilter } from '../../../../common/utils/helpers'; +import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../../common/constants'; export const findRuleHandler = async ( soClient: SavedObjectsClientContract, diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts index 116da8b7311b9..ebf90aa500097 100644 --- a/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts @@ -7,10 +7,10 @@ import { SECURITY_SOLUTION_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; import { SavedObjectsType } from '@kbn/core/server'; +import { rulesV1, rulesV2, rulesV3 } from '../../common/types'; import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../common/constants'; import { cspBenchmarkRuleMigrations } from './migrations'; import { cspBenchmarkRuleSavedObjectMapping } from './mappings'; -import { rulesV1, rulesV2, rulesV3 } from '@kbn/cloud-security-posture-plugin/common/types/'; export const cspBenchmarkRule: SavedObjectsType = { name: CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE, diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts index 9518c512d1b06..e440342d2083d 100644 --- a/x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { rulesV1, rulesV2, rulesV3 } from '@kbn/cloud-security-posture-plugin/common/types/'; import { SavedObjectMigrationMap, SavedObjectUnsanitizedDoc, SavedObjectMigrationContext, } from '@kbn/core/server'; +import { rulesV1, rulesV2, rulesV3 } from '../../../common/types'; function migrateCspBenchmarkRuleToV840( doc: SavedObjectUnsanitizedDoc, diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/saved_objects.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/saved_objects.ts index 2c59ae184e795..f806571fa195c 100644 --- a/x-pack/plugins/cloud_security_posture/server/saved_objects/saved_objects.ts +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/saved_objects.ts @@ -7,11 +7,11 @@ import { SavedObjectsServiceSetup } from '@kbn/core/server'; import { SECURITY_SOLUTION_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; +import { rulesV1, rulesV2, rulesV3 } from '../../common/types/index'; import { cspBenchmarkRuleSavedObjectMapping } from './mappings'; import { cspBenchmarkRuleMigrations } from './migrations'; -import { rulesV1, rulesV2, rulesV3 } from '@kbn/cloud-security-posture-plugin/common/types/'; -import { CspBenchmarkRule } from '@kbn/cloud-security-posture-plugin/common/types/latest'; +import { CspBenchmarkRule } from '../../common/types/latest'; import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../common/constants'; diff --git a/x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts b/x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts index 0308870274db2..f3b02be244462 100644 --- a/x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts +++ b/x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts @@ -6,13 +6,12 @@ */ import expect from '@kbn/expect'; import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; -import { FtrProviderContext } from '../../ftr_provider_context'; -import { createPackagePolicy } from './helper'; - import type { CspBenchmarkRule, FindCspBenchmarkRuleResponse, } from '@kbn/cloud-security-posture-plugin/common/types/latest'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { createPackagePolicy } from './helper'; export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts b/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts index cbbd748132b3b..72edcefc3853f 100644 --- a/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts +++ b/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts @@ -9,14 +9,14 @@ import { ELASTIC_HTTP_VERSION_HEADER, X_ELASTIC_INTERNAL_ORIGIN_REQUEST, } from '@kbn/core-http-common'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { createPackagePolicy } from '../../../apis/cloud_security_posture/helper'; // eslint-disable-line @kbn/imports/no_boundary_crossing - import type { CspBenchmarkRule, FindCspBenchmarkRuleResponse, } from '@kbn/cloud-security-posture-plugin/common/types/latest'; +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { createPackagePolicy } from '../../../apis/cloud_security_posture/helper'; + export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver');