From 18f8a959b7ea4b6a4f50a76ac337bffd559402ea Mon Sep 17 00:00:00 2001 From: Mark Hopkin Date: Fri, 1 Dec 2023 15:46:48 +0000 Subject: [PATCH] [Entity Analytics] Move all entity analytics API schemas into `entity_analytics` folder. (#172363) ## Summary Create `security_solution/common/api/entity_analytics` to house all entity analytics related apis, in this case `risk_score`, `risk_engine` and `asset_criticality`. This makes ownership clearer, simplifies the codeowners file, and will enable the entity analytics team to have shared schema components in `security_solution/common/api/entity_analytics/common` (something I want to do in an upcoming PR) I have removed `@elastic/security-threat-hunting-explore`'s ownersip of `/x-pack/plugins/security_solution/common/api/risk_score` let me know if you want to keep it! --- .github/CODEOWNERS | 3 +-- .../api/{ => entity_analytics}/asset_criticality/common.gen.ts | 0 .../asset_criticality/common.schema.yaml | 0 .../asset_criticality/create_asset_criticality.schema.yaml | 0 .../asset_criticality/delete_asset_criticality.schema.yaml | 0 .../asset_criticality/get_asset_criticality.schema.yaml | 0 .../asset_criticality/get_asset_criticality_status.gen.ts | 0 .../asset_criticality/get_asset_criticality_status.schema.yaml | 0 .../api/{ => entity_analytics}/asset_criticality/index.ts | 0 .../risk_engine/calculation_route_schema.yml | 0 .../common/api/{ => entity_analytics}/risk_engine/common.yml | 0 .../risk_engine/engine_disable_route_schema.yml | 0 .../risk_engine/engine_enable_route_schema.yml | 0 .../risk_engine/engine_init_route_schema.yml | 0 .../risk_engine/engine_status_route_schema.yml | 0 .../risk_engine/preview_route_schema.yml | 0 .../risk_score/create_index/create_index_route.ts | 0 .../create_prebuilt_saved_objects_route.test.ts | 0 .../create_prebuilt_saved_objects_route.ts | 0 .../create_stored_script/create_stored_script_route.ts | 0 .../risk_score/delete_indices/delete_indices_route.ts | 0 .../delete_prebuilt_saved_objects_route.ts | 0 .../delete_stored_script/delete_stored_script_route.ts | 0 .../common/api/{ => entity_analytics}/risk_score/index.ts | 0 .../risk_score/index_status/index_status_route.ts | 0 .../risk_score/install_modules/install_modules_route.ts | 2 +- .../read_prebuilt_dev_tool_content_route.ts | 0 .../asset_criticality/asset_criticality_data_client.ts | 2 +- .../lib/entity_analytics/asset_criticality/routes/delete.ts | 2 +- .../lib/entity_analytics/asset_criticality/routes/get.ts | 2 +- .../lib/entity_analytics/asset_criticality/routes/status.ts | 2 +- .../lib/entity_analytics/asset_criticality/routes/upsert.ts | 2 +- .../server/lib/risk_score/index_status/index.ts | 2 +- .../server/lib/risk_score/indices/create_index_route.ts | 2 +- .../server/lib/risk_score/indices/delete_indices_route.ts | 2 +- .../server/lib/risk_score/indices/lib/create_index.ts | 2 +- .../lib/risk_score/onboarding/routes/install_risk_scores.ts | 2 +- .../routes/read_prebuilt_dev_tool_content_route.ts | 2 +- .../lib/risk_score/prebuilt_dev_tool_content/schema.test.ts | 2 +- .../routes/create_prebuilt_saved_objects.ts | 2 +- .../routes/delete_prebuilt_saved_objects.ts | 2 +- .../lib/risk_score/stored_scripts/create_script_route.ts | 2 +- .../lib/risk_score/stored_scripts/delete_script_route.ts | 2 +- .../server/lib/risk_score/stored_scripts/lib/create_script.ts | 2 +- .../server/lib/risk_score/stored_scripts/lib/delete_script.ts | 2 +- 45 files changed, 20 insertions(+), 21 deletions(-) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/asset_criticality/common.gen.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/asset_criticality/common.schema.yaml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/asset_criticality/create_asset_criticality.schema.yaml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/asset_criticality/delete_asset_criticality.schema.yaml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/asset_criticality/get_asset_criticality.schema.yaml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/asset_criticality/get_asset_criticality_status.gen.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/asset_criticality/get_asset_criticality_status.schema.yaml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/asset_criticality/index.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_engine/calculation_route_schema.yml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_engine/common.yml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_engine/engine_disable_route_schema.yml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_engine/engine_enable_route_schema.yml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_engine/engine_init_route_schema.yml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_engine/engine_status_route_schema.yml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_engine/preview_route_schema.yml (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_score/create_index/create_index_route.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.test.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_score/create_stored_script/create_stored_script_route.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_score/delete_indices/delete_indices_route.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_score/delete_prebuilt_saved_objects/delete_prebuilt_saved_objects_route.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_score/delete_stored_script/delete_stored_script_route.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_score/index.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_score/index_status/index_status_route.ts (100%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_score/install_modules/install_modules_route.ts (89%) rename x-pack/plugins/security_solution/common/api/{ => entity_analytics}/risk_score/read_prebuilt_dev_tool_content/read_prebuilt_dev_tool_content_route.ts (100%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index eca88008aad0d..f84e5470f0dcd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1267,7 +1267,6 @@ x-pack/test/security_solution_cypress/cypress/tasks/expandable_flyout @elastic/ ## Security Solution sub teams - Threat Hunting Explore /x-pack/plugins/security_solution/common/api/tags @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/common/api/risk_score @elastic/security-threat-hunting-explore /x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts @elastic/security-threat-hunting-explore /x-pack/plugins/security_solution/common/search_strategy/security_solution/matrix_histogram @elastic/security-threat-hunting-explore /x-pack/plugins/security_solution/common/search_strategy/security_solution/network @elastic/security-threat-hunting-explore @@ -1475,7 +1474,7 @@ x-pack/plugins/security_solution/server/lib/entity_analytics @elastic/security-e x-pack/plugins/security_solution/server/lib/risk_score @elastic/security-entity-analytics x-pack/test/security_solution_api_integration/test_suites/entity_analytics @elastic/security-entity-analytics x-pack/plugins/security_solution/public/flyout/entity_details @elastic/security-entity-analytics -x-pack/plugins/security_solution/common/api/asset_criticality @elastic/security-entity-analytics +x-pack/plugins/security_solution/common/api/entity_analytics @elastic/security-entity-analytics /x-pack/plugins/security_solution/public/entity_analytics @elastic/security-entity-analytics /x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics @elastic/security-entity-analytics diff --git a/x-pack/plugins/security_solution/common/api/asset_criticality/common.gen.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/asset_criticality/common.gen.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/asset_criticality/common.schema.yaml b/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/asset_criticality/common.schema.yaml rename to x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/asset_criticality/create_asset_criticality.schema.yaml b/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/create_asset_criticality.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/asset_criticality/create_asset_criticality.schema.yaml rename to x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/create_asset_criticality.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/asset_criticality/delete_asset_criticality.schema.yaml b/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/delete_asset_criticality.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/asset_criticality/delete_asset_criticality.schema.yaml rename to x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/delete_asset_criticality.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/asset_criticality/get_asset_criticality.schema.yaml b/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/asset_criticality/get_asset_criticality.schema.yaml rename to x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/asset_criticality/get_asset_criticality_status.gen.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_status.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/asset_criticality/get_asset_criticality_status.gen.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_status.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/asset_criticality/get_asset_criticality_status.schema.yaml b/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_status.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/asset_criticality/get_asset_criticality_status.schema.yaml rename to x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_status.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/asset_criticality/index.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/asset_criticality/index.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/index.ts diff --git a/x-pack/plugins/security_solution/common/api/risk_engine/calculation_route_schema.yml b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/calculation_route_schema.yml similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_engine/calculation_route_schema.yml rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/calculation_route_schema.yml diff --git a/x-pack/plugins/security_solution/common/api/risk_engine/common.yml b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/common.yml similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_engine/common.yml rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/common.yml diff --git a/x-pack/plugins/security_solution/common/api/risk_engine/engine_disable_route_schema.yml b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_disable_route_schema.yml similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_engine/engine_disable_route_schema.yml rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_disable_route_schema.yml diff --git a/x-pack/plugins/security_solution/common/api/risk_engine/engine_enable_route_schema.yml b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_enable_route_schema.yml similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_engine/engine_enable_route_schema.yml rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_enable_route_schema.yml diff --git a/x-pack/plugins/security_solution/common/api/risk_engine/engine_init_route_schema.yml b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_init_route_schema.yml similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_engine/engine_init_route_schema.yml rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_init_route_schema.yml diff --git a/x-pack/plugins/security_solution/common/api/risk_engine/engine_status_route_schema.yml b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_status_route_schema.yml similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_engine/engine_status_route_schema.yml rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_status_route_schema.yml diff --git a/x-pack/plugins/security_solution/common/api/risk_engine/preview_route_schema.yml b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route_schema.yml similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_engine/preview_route_schema.yml rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route_schema.yml diff --git a/x-pack/plugins/security_solution/common/api/risk_score/create_index/create_index_route.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/create_index/create_index_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_score/create_index/create_index_route.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/create_index/create_index_route.ts diff --git a/x-pack/plugins/security_solution/common/api/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.test.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.test.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.ts diff --git a/x-pack/plugins/security_solution/common/api/risk_score/create_stored_script/create_stored_script_route.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/create_stored_script/create_stored_script_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_score/create_stored_script/create_stored_script_route.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/create_stored_script/create_stored_script_route.ts diff --git a/x-pack/plugins/security_solution/common/api/risk_score/delete_indices/delete_indices_route.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/delete_indices/delete_indices_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_score/delete_indices/delete_indices_route.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/delete_indices/delete_indices_route.ts diff --git a/x-pack/plugins/security_solution/common/api/risk_score/delete_prebuilt_saved_objects/delete_prebuilt_saved_objects_route.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/delete_prebuilt_saved_objects/delete_prebuilt_saved_objects_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_score/delete_prebuilt_saved_objects/delete_prebuilt_saved_objects_route.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/delete_prebuilt_saved_objects/delete_prebuilt_saved_objects_route.ts diff --git a/x-pack/plugins/security_solution/common/api/risk_score/delete_stored_script/delete_stored_script_route.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/delete_stored_script/delete_stored_script_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_score/delete_stored_script/delete_stored_script_route.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/delete_stored_script/delete_stored_script_route.ts diff --git a/x-pack/plugins/security_solution/common/api/risk_score/index.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_score/index.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/index.ts diff --git a/x-pack/plugins/security_solution/common/api/risk_score/index_status/index_status_route.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/index_status/index_status_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_score/index_status/index_status_route.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/index_status/index_status_route.ts diff --git a/x-pack/plugins/security_solution/common/api/risk_score/install_modules/install_modules_route.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/install_modules/install_modules_route.ts similarity index 89% rename from x-pack/plugins/security_solution/common/api/risk_score/install_modules/install_modules_route.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/install_modules/install_modules_route.ts index a17f10d724863..3f721f1c859d8 100644 --- a/x-pack/plugins/security_solution/common/api/risk_score/install_modules/install_modules_route.ts +++ b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/install_modules/install_modules_route.ts @@ -6,7 +6,7 @@ */ import { schema } from '@kbn/config-schema'; -import { RiskScoreEntity } from '../../../search_strategy'; +import { RiskScoreEntity } from '../../../../search_strategy'; export const onboardingRiskScoreRequestBody = { body: schema.object({ diff --git a/x-pack/plugins/security_solution/common/api/risk_score/read_prebuilt_dev_tool_content/read_prebuilt_dev_tool_content_route.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/read_prebuilt_dev_tool_content/read_prebuilt_dev_tool_content_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/risk_score/read_prebuilt_dev_tool_content/read_prebuilt_dev_tool_content_route.ts rename to x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/read_prebuilt_dev_tool_content/read_prebuilt_dev_tool_content_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.ts index 7e3d5dcd7b50c..6bb003df0fa85 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.ts @@ -6,7 +6,7 @@ */ import type { Logger, ElasticsearchClient } from '@kbn/core/server'; import { mappingFromFieldMap } from '@kbn/alerting-plugin/common'; -import type { AssetCriticalityRecord } from '../../../../common/api/asset_criticality'; +import type { AssetCriticalityRecord } from '../../../../common/api/entity_analytics/asset_criticality'; import { createOrUpdateIndex } from '../utils/create_or_update_index'; import { getAssetCriticalityIndex } from '../../../../common/asset_criticality'; import { assetCriticalityFieldMap } from './configurations'; diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/delete.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/delete.ts index 45daef8a1ac1b..1dae71a02f567 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/delete.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/delete.ts @@ -9,7 +9,7 @@ import { buildSiemResponse } from '@kbn/lists-plugin/server/routes/utils'; import { transformError } from '@kbn/securitysolution-es-utils'; import { ASSET_CRITICALITY_URL, APP_ID } from '../../../../../common/constants'; import type { SecuritySolutionPluginRouter } from '../../../../types'; -import { AssetCriticalityRecordIdParts } from '../../../../../common/api/asset_criticality'; +import { AssetCriticalityRecordIdParts } from '../../../../../common/api/entity_analytics/asset_criticality'; import { buildRouteValidationWithZod } from '../../../../utils/build_validation/route_validation'; import { checkAndInitAssetCriticalityResources } from '../check_and_init_asset_criticality_resources'; export const assetCriticalityDeleteRoute = ( diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/get.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/get.ts index e3551aac1eef6..dce278756ce2b 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/get.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/get.ts @@ -11,7 +11,7 @@ import { ASSET_CRITICALITY_URL, APP_ID } from '../../../../../common/constants'; import type { SecuritySolutionPluginRouter } from '../../../../types'; import { checkAndInitAssetCriticalityResources } from '../check_and_init_asset_criticality_resources'; import { buildRouteValidationWithZod } from '../../../../utils/build_validation/route_validation'; -import { AssetCriticalityRecordIdParts } from '../../../../../common/api/asset_criticality'; +import { AssetCriticalityRecordIdParts } from '../../../../../common/api/entity_analytics/asset_criticality'; export const assetCriticalityGetRoute = (router: SecuritySolutionPluginRouter, logger: Logger) => { router.versioned .get({ diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/status.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/status.ts index f53500aeb3a29..cb5625c57f1ec 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/status.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/status.ts @@ -7,7 +7,7 @@ import type { Logger } from '@kbn/core/server'; import { buildSiemResponse } from '@kbn/lists-plugin/server/routes/utils'; import { transformError } from '@kbn/securitysolution-es-utils'; -import type { AssetCriticalityStatusResponse } from '../../../../../common/api/asset_criticality'; +import type { AssetCriticalityStatusResponse } from '../../../../../common/api/entity_analytics/asset_criticality'; import { ASSET_CRITICALITY_STATUS_URL, APP_ID } from '../../../../../common/constants'; import type { SecuritySolutionPluginRouter } from '../../../../types'; import { checkAndInitAssetCriticalityResources } from '../check_and_init_asset_criticality_resources'; diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upsert.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upsert.ts index 6ad1e469ff0d4..65f71bb3bfe45 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upsert.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upsert.ts @@ -11,7 +11,7 @@ import { ASSET_CRITICALITY_URL, APP_ID } from '../../../../../common/constants'; import type { SecuritySolutionPluginRouter } from '../../../../types'; import { checkAndInitAssetCriticalityResources } from '../check_and_init_asset_criticality_resources'; import { buildRouteValidationWithZod } from '../../../../utils/build_validation/route_validation'; -import { CreateAssetCriticalityRecord } from '../../../../../common/api/asset_criticality'; +import { CreateAssetCriticalityRecord } from '../../../../../common/api/entity_analytics/asset_criticality'; export const assetCriticalityUpsertRoute = ( router: SecuritySolutionPluginRouter, logger: Logger diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/index_status/index.ts b/x-pack/plugins/security_solution/server/lib/risk_score/index_status/index.ts index 77e47f215713a..79eef256f8e93 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/index_status/index.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/index_status/index.ts @@ -11,7 +11,7 @@ import { APP_ID, RISK_SCORE_INDEX_STATUS_API_URL } from '../../../../common/cons import type { SecuritySolutionPluginRouter } from '../../../types'; import { buildRouteValidation } from '../../../utils/build_validation/route_validation'; import { buildSiemResponse } from '../../detection_engine/routes/utils'; -import { indexStatusRequestQuery } from '../../../../common/api/risk_score'; +import { indexStatusRequestQuery } from '../../../../common/api/entity_analytics/risk_score'; export const getRiskScoreIndexStatusRoute = (router: SecuritySolutionPluginRouter) => { router.versioned diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts b/x-pack/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts index 22987cf563d0b..ef4aacf251ff4 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts @@ -12,7 +12,7 @@ import { transformError } from '@kbn/securitysolution-es-utils'; import { RISK_SCORE_CREATE_INDEX } from '../../../../common/constants'; import type { SecuritySolutionPluginRouter } from '../../../types'; import { createIndex } from './lib/create_index'; -import { createEsIndexRequestBody } from '../../../../common/api/risk_score'; +import { createEsIndexRequestBody } from '../../../../common/api/entity_analytics/risk_score'; export const createEsIndexRoute = (router: SecuritySolutionPluginRouter, logger: Logger) => { router.versioned diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts b/x-pack/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts index 326963992a709..407e9e0a8f3e0 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts @@ -10,7 +10,7 @@ import { buildSiemResponse } from '@kbn/lists-plugin/server/routes/utils'; import { RISK_SCORE_DELETE_INDICES } from '../../../../common/constants'; import type { SecuritySolutionPluginRouter } from '../../../types'; import { deleteEsIndices } from './lib/delete_indices'; -import { deleteIndicesRequestBody } from '../../../../common/api/risk_score'; +import { deleteIndicesRequestBody } from '../../../../common/api/entity_analytics/risk_score'; export const deleteEsIndicesRoute = (router: SecuritySolutionPluginRouter) => { router.versioned diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/indices/lib/create_index.ts b/x-pack/plugins/security_solution/server/lib/risk_score/indices/lib/create_index.ts index 48d3c333dff09..4104c97812e0a 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/indices/lib/create_index.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/indices/lib/create_index.ts @@ -6,7 +6,7 @@ */ import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { transformError } from '@kbn/securitysolution-es-utils'; -import type { CreateEsIndexRequestBody } from '../../../../../common/api/risk_score'; +import type { CreateEsIndexRequestBody } from '../../../../../common/api/entity_analytics/risk_score'; export const createIndex = async ({ esClient, diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts b/x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts index f8afbbfae9365..627a9afd4e871 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts @@ -16,7 +16,7 @@ import type { SetupPlugins } from '../../../../plugin'; import { buildSiemResponse } from '../../../detection_engine/routes/utils'; import { installRiskScoreModule } from '../helpers/install_risk_score_module'; -import { onboardingRiskScoreRequestBody } from '../../../../../common/api/risk_score'; +import { onboardingRiskScoreRequestBody } from '../../../../../common/api/entity_analytics/risk_score'; export const installRiskScoresRoute = ( router: SecuritySolutionPluginRouter, diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts b/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts index 70edd32eee584..df819487e13b7 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts @@ -14,7 +14,7 @@ import { DEV_TOOL_PREBUILT_CONTENT } from '../../../../../common/constants'; import type { SecuritySolutionPluginRouter } from '../../../../types'; import { consoleMappings } from '../console_mappings'; -import { readConsoleRequestBody } from '../../../../../common/api/risk_score'; +import { readConsoleRequestBody } from '../../../../../common/api/entity_analytics/risk_score'; import { RiskScoreEntity } from '../../../../../common/search_strategy'; import { getView } from '../utils'; diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/schema.test.ts b/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/schema.test.ts index bf02aae37e5ca..d5856c31a5121 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/schema.test.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/schema.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { readConsoleRequestBody } from '../../../../common/api/risk_score'; +import { readConsoleRequestBody } from '../../../../common/api/entity_analytics/risk_score'; describe('ReadConsoleRequestSchema', () => { it('should throw error', () => { diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts b/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts index ce65983161da1..568489155707a 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts @@ -16,7 +16,7 @@ import { buildSiemResponse } from '../../../detection_engine/routes/utils'; import { buildFrameworkRequest } from '../../../timeline/utils/common'; import { bulkCreateSavedObjects } from '../helpers/bulk_create_saved_objects'; -import { createPrebuiltSavedObjectsRequestBody } from '../../../../../common/api/risk_score'; +import { createPrebuiltSavedObjectsRequestBody } from '../../../../../common/api/entity_analytics/risk_score'; export const createPrebuiltSavedObjectsRoute = ( router: SecuritySolutionPluginRouter, diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts b/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts index 9f2138b3c608f..c78d1f292afe6 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts @@ -16,7 +16,7 @@ import { buildSiemResponse } from '../../../detection_engine/routes/utils'; import { buildFrameworkRequest } from '../../../timeline/utils/common'; import { bulkDeleteSavedObjects } from '../helpers/bulk_delete_saved_objects'; -import { deletePrebuiltSavedObjectsRequestBody } from '../../../../../common/api/risk_score'; +import { deletePrebuiltSavedObjectsRequestBody } from '../../../../../common/api/entity_analytics/risk_score'; export const deletePrebuiltSavedObjectsRoute = ( router: SecuritySolutionPluginRouter, diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts b/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts index e5909892071c5..573d1d30bcd28 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts @@ -8,7 +8,7 @@ import type { Logger } from '@kbn/core/server'; import { buildSiemResponse } from '@kbn/lists-plugin/server/routes/utils'; import { transformError } from '@kbn/securitysolution-es-utils'; -import { createStoredScriptRequestBody } from '../../../../common/api/risk_score'; +import { createStoredScriptRequestBody } from '../../../../common/api/entity_analytics/risk_score'; import { RISK_SCORE_CREATE_STORED_SCRIPT } from '../../../../common/constants'; import type { SecuritySolutionPluginRouter } from '../../../types'; import { createStoredScript } from './lib/create_script'; diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts b/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts index 7f579b28802ec..0d7ef94be2635 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts @@ -10,7 +10,7 @@ import { buildSiemResponse } from '@kbn/lists-plugin/server/routes/utils'; import { RISK_SCORE_DELETE_STORED_SCRIPT } from '../../../../common/constants'; import type { SecuritySolutionPluginRouter } from '../../../types'; import { deleteStoredScript } from './lib/delete_script'; -import { deleteStoredScriptRequestBody } from '../../../../common/api/risk_score'; +import { deleteStoredScriptRequestBody } from '../../../../common/api/entity_analytics/risk_score'; export const deleteStoredScriptRoute = (router: SecuritySolutionPluginRouter) => { router.versioned diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/create_script.ts b/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/create_script.ts index fc56a3e049269..d6c2e5211625b 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/create_script.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/create_script.ts @@ -6,7 +6,7 @@ */ import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { transformError } from '@kbn/securitysolution-es-utils'; -import type { CreateStoredScriptRequestBody } from '../../../../../common/api/risk_score'; +import type { CreateStoredScriptRequestBody } from '../../../../../common/api/entity_analytics/risk_score'; export const createStoredScript = async ({ esClient, diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/delete_script.ts b/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/delete_script.ts index b6113b5f9f318..bbbf8e9582ff5 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/delete_script.ts +++ b/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/delete_script.ts @@ -5,7 +5,7 @@ * 2.0. */ import type { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; -import type { DeleteStoredScriptRequestBody } from '../../../../../common/api/risk_score'; +import type { DeleteStoredScriptRequestBody } from '../../../../../common/api/entity_analytics/risk_score'; export const deleteStoredScript = async ({ client,